Skip to content

Conversation

@sea212
Copy link
Contributor

@sea212 sea212 commented Apr 30, 2024

What does it do?

  • Make CI pass
  • Add migrations

What important points should reviewers know?

  • pallet-contracts required pallet-balance hold and freezes
  • Current PalletVersion of pallet-contracts is at 9, which indicates the storage layout version.

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues?

References

@sea212 sea212 added the s:in-progress The pull requests is currently being worked on label Apr 30, 2024
@sea212 sea212 self-assigned this Apr 30, 2024
Copy link
Contributor

@maltekliemann maltekliemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved minus the zeitgeist/battery-station typo

@mergify
Copy link
Contributor

mergify bot commented Apr 30, 2024

This pull request is now in conflicts. Could you fix it @sea212? 🙏

@mergify mergify bot added s:revision-needed The pull requests must be revised and removed s:in-progress The pull requests is currently being worked on labels Apr 30, 2024
@mergify mergify bot added s:in-progress The pull requests is currently being worked on and removed s:revision-needed The pull requests must be revised labels Apr 30, 2024
@sea212 sea212 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Apr 30, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (sea212-update-dependencies-v1.1.0@7fc38ee). Click here to learn what that means.

Files Patch % Lines
zrml/asset-router/src/pallet_impl/unbalanced.rs 33.33% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                         Coverage Diff                          @@
##             sea212-update-dependencies-v1.1.0    #1329   +/-   ##
====================================================================
  Coverage                                     ?   92.52%           
====================================================================
  Files                                        ?      198           
  Lines                                        ?    36036           
  Branches                                     ?        0           
====================================================================
  Hits                                         ?    33343           
  Misses                                       ?     2693           
  Partials                                     ?        0           
Flag Coverage Δ
tests 92.52% <90.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sea212 sea212 marked this pull request as ready for review April 30, 2024 21:48
@sea212 sea212 requested a review from Chralt98 as a code owner April 30, 2024 21:48
@mergify mergify bot added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Apr 30, 2024
@sea212 sea212 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Apr 30, 2024
@mergify mergify bot added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels May 1, 2024
@sea212 sea212 removed the s:in-progress The pull requests is currently being worked on label May 1, 2024
@sea212 sea212 added the s:review-needed The pull request requires reviews label May 1, 2024
@maltekliemann maltekliemann self-assigned this May 5, 2024
@mergify mergify bot added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels May 5, 2024
@maltekliemann maltekliemann added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels May 5, 2024
Copy link
Member

@Chralt98 Chralt98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this as a blue print:

#1079

From this I derive to look for the following repos:

  • substrate
  • cumulus
  • moonbeam
  • nimbus
  • orml
  • polkadot

I found the following migrations:

Using paritytech/cumulus@polkadot-v0.9.38...polkadot-v1.0.0

pallets/dmp-queue/src/migration.rs
pallets/parachain-system/src/migration.rs
pallets/xcmp-queue/src/migration.rs

I need to check if these migrations are automatically triggered by the on_runtime_hook. If yes, we can leave them out (because of implicit trigger) and don't have to state them explicitly in our migrations. So, OnRuntimeUpgrade is implemented. So I derive it's automatically triggered by our runtime executor.

Did we already execute this migration? https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.1.0/substrate/frame/contracts/src/migration/v09.rs

Using moonbeam-foundation/moonbeam@v0.31.1...v0.34.1

I found no migrations for that.

https://github.com/moonbeam-foundation/nimbus

The last version of nimbus is polkadot-v0.9.43 So now the question arises what are we going to do about this problem?

I found no migration for open-web3-stack/open-runtime-module-library@polkadot-v0.9.38...polkadot-v1.1.0

paritytech/polkadot@release-v0.9.38...release-v1.0.0

runtime/common/src/session/migration.rs
Those are executed implicitly runtime/parachains/src/configuration/migration/v5.rs and this runtime/parachains/src/configuration/migration/v6.rs and this runtime/parachains/src/configuration/migration_ump.rs , right?

paritytech/substrate@polkadot-v0.9.38...polkadot-v1.0.0

frame/contracts/src/migration.rs

frame/democracy/src/migrations/mod.rs (automatically triggered through OnRuntimeUpgrade hook)

Those are the commits from the monorepo transition to 1.1.0:

For cumulus:
paritytech/polkadot-sdk@af7ae72...polkadot-v1.1.0

For polkadot:
paritytech/polkadot-sdk@7c89f28...polkadot-v1.1.0

substrate/frame/bounties/src/migrations/v4.rs

substrate/frame/membership/src/migrations/v4.rs

Please check and verify if my information provided is correct.

Comment on lines +114 to +115
pub const MaxHolds: u32 = 1;
pub const MaxFreezes: u32 = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about these values?

Comment on lines +112 to +113
pub const MaxHolds: u32 = 1;
pub const MaxFreezes: u32 = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure about these values?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me. I don't think we use freezes or holds yet, so... If you have a suggestion though, let's hear it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought about setting the values to zero instead, because it was like this before. But maybe Harald had a particular reason for using one for both.

@maltekliemann
Copy link
Contributor

I got this as a blue print:

#1079

From this I derive to look for the following repos:

  • substrate
  • cumulus
  • moonbeam
  • nimbus
  • orml
  • polkadot

I found the following migrations:

Using paritytech/[email protected]

pallets/dmp-queue/src/migration.rs pallets/parachain-system/src/migration.rs pallets/xcmp-queue/src/migration.rs

I need to check if these migrations are automatically triggered by the on_runtime_hook. If yes, we can leave them out (because of implicit trigger) and don't have to state them explicitly in our migrations. So, OnRuntimeUpgrade is implemented. So I derive it's automatically triggered by our runtime executor.

These should have already been executed on our chain. The migrations have been added before and only been changed in the commit range you've checked (due to import reorgs or clippy requests). You can also compare the on-chain version with what's in the code.

Did we already execute this migration? https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.1.0/substrate/frame/contracts/src/migration/v09.rs

Yes, pallet-contracts v09 predates 0.9.38; our contracts pallet is at storage version 9.

https://github.com/moonbeam-foundation/nimbus

The last version of nimbus is polkadot-v0.9.43 So now the question arises what are we going to do about this problem?

You should be able to find what you're looking for in https://github.com/zeitgeistpm/moonkit.

I found no migration for open-web3-stack/[email protected]

paritytech/[email protected]

runtime/common/src/session/migration.rs Those are executed implicitly runtime/parachains/src/configuration/migration/v5.rs and this runtime/parachains/src/configuration/migration/v6.rs and this runtime/parachains/src/configuration/migration_ump.rs , right?

Doesn't matter as these are all relaychain specific packages.

paritytech/[email protected]

frame/contracts/src/migration.rs

frame/democracy/src/migrations/mod.rs (automatically triggered through OnRuntimeUpgrade hook)

The contracts migration should be covered by this PR, while the changes to democracy are already deployed (the commits only seem to move some stuff around, not add a migration).

Those are the commits from the monorepo transition to 1.1.0:

For cumulus: paritytech/[email protected]

For polkadot: paritytech/[email protected]

substrate/frame/bounties/src/migrations/v4.rs

As far as I understand, we're already at the correct storage state, it's just that Parity failed to upgrade StorageVersion, which is why we're behind.

substrate/frame/membership/src/migrations/v4.rs

Also, the link that you've provided doesn't show a new migration, as far as I can see. Only the copyright has been updated.

Please check and verify if my information provided is correct.

Appreciate the thorough review!

Copy link
Member

@Chralt98 Chralt98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1329 (comment)

Please just look at the comment above before.

Otherwise LGTM

@maltekliemann maltekliemann added s:accepted This pull request is ready for merge and removed s:review-needed The pull request requires reviews labels May 7, 2024
@mergify mergify bot merged commit 718ff99 into sea212-update-dependencies-v1.1.0 May 7, 2024
@mergify mergify bot deleted the sea212-update-dependencies-part-7 branch May 7, 2024 10:44
maltekliemann added a commit that referenced this pull request Jun 25, 2024
* Update dependencies (#1319)

* Update dependencies to polkadot-v1.1.0

* Format code

* Remove duplicate dependencies

* Update zrml-asset-router (#1321)

* Update zrml-primitives

* Partially update asset-router

* Finalize logic adjustments in asset-router

* Make asset-router tests compilable

* Correct Inspect routing for market assets in Currencies

* Directly invoke Inspect API for Currencies

* Add tests for remaining Unbalances functions

* Update remaining Zeitgeist pallets (#1322)

* Update zrml-asset-router (#1321)

* Upgrade zrml-market-commons

* Upgrade zrml-authorized && use MockBlock instead of MockBlockU32

* Upgrade zrml-court

* Upgrade zrml-global-disputes

* Upgrade liquidity mining

* Upgrade zrml-rikiddo

* Upgrade zrml-simple-disputes

* Upgrade zrml-styx

* Upgrade zrml-orderbook

* Upgrade zrml-parimutuel

* Upgrade zrml-swaps

* Upgrade zrml-prediction-markets

* Upgrade zrml-neo-swaps

* Upgrade zrml-hybrid-router

* Update license headers

* Update runtime (#1323)

* Update weight files & Runtime enum

* Use workspace metadata

* Always use serde serialization for asset types

* Make battery station standalone runtime compilable

* Make benchmark and try-runtime feature compilable

* Make BS build with all features

* Make parachain tests compile

* Partially fix xcm tests

* Use safe xcm version 2

* Update Zeitgeist runtime (except xcm tests)

* Format code

* Remove deprecated comment

* Integrate new xcm-emulator (#1324)

* Integrate new xcm-emulator environment

* Utilize new xcm-emulator interfaces

* Spawn relay-para network using patched xcm-emulator

* Use proper collator genesis config

* Fix Rococo tests

* Finalize Battery Station XCM tests

* Finalize Zeitgeist XCM tests

* Update client (#1327)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Update node/src/cli.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update try-runtime* Makefile targets

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Make CI succeed and add migrations (#1329)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Satisfy Clippy

* Fix benchmarks

* Add migrations

* Satisfy Clippy

* Update moonkit depedencies

* Free disk space more aggressively

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Update spec version, try-runtime Makefile

* Fix copyright notices

* Fix broken chain state (#1336)

* Add `StorageVersion` fix and contrats fix migrations

* Don't set pallet-balances' storage version

* Remove migrations from pallet-contracts config

* Clear storage tries of contracts

* Fix migration and info logs in try-runtime

* Fix licenses and comments

* Fix formatting

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify bot added a commit that referenced this pull request Jul 8, 2024
* Update dependencies to Polkadot v1.1.0 (#1331)

* Update dependencies (#1319)

* Update dependencies to polkadot-v1.1.0

* Format code

* Remove duplicate dependencies

* Update zrml-asset-router (#1321)

* Update zrml-primitives

* Partially update asset-router

* Finalize logic adjustments in asset-router

* Make asset-router tests compilable

* Correct Inspect routing for market assets in Currencies

* Directly invoke Inspect API for Currencies

* Add tests for remaining Unbalances functions

* Update remaining Zeitgeist pallets (#1322)

* Update zrml-asset-router (#1321)

* Upgrade zrml-market-commons

* Upgrade zrml-authorized && use MockBlock instead of MockBlockU32

* Upgrade zrml-court

* Upgrade zrml-global-disputes

* Upgrade liquidity mining

* Upgrade zrml-rikiddo

* Upgrade zrml-simple-disputes

* Upgrade zrml-styx

* Upgrade zrml-orderbook

* Upgrade zrml-parimutuel

* Upgrade zrml-swaps

* Upgrade zrml-prediction-markets

* Upgrade zrml-neo-swaps

* Upgrade zrml-hybrid-router

* Update license headers

* Update runtime (#1323)

* Update weight files & Runtime enum

* Use workspace metadata

* Always use serde serialization for asset types

* Make battery station standalone runtime compilable

* Make benchmark and try-runtime feature compilable

* Make BS build with all features

* Make parachain tests compile

* Partially fix xcm tests

* Use safe xcm version 2

* Update Zeitgeist runtime (except xcm tests)

* Format code

* Remove deprecated comment

* Integrate new xcm-emulator (#1324)

* Integrate new xcm-emulator environment

* Utilize new xcm-emulator interfaces

* Spawn relay-para network using patched xcm-emulator

* Use proper collator genesis config

* Fix Rococo tests

* Finalize Battery Station XCM tests

* Finalize Zeitgeist XCM tests

* Update client (#1327)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Update node/src/cli.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update try-runtime* Makefile targets

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Make CI succeed and add migrations (#1329)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Satisfy Clippy

* Fix benchmarks

* Add migrations

* Satisfy Clippy

* Update moonkit depedencies

* Free disk space more aggressively

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Update spec version, try-runtime Makefile

* Fix copyright notices

* Fix broken chain state (#1336)

* Add `StorageVersion` fix and contrats fix migrations

* Don't set pallet-balances' storage version

* Remove migrations from pallet-contracts config

* Clear storage tries of contracts

* Fix migration and info logs in try-runtime

* Fix licenses and comments

* Fix formatting

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Merge

* Fix benchmark

* Fix compiler error

* Fix tests and imports

* Fix imports (again...)

* Fix orderbook benchmarks

* Fix fuzz tests

* Fix formatting

* Fix orderbook fuzz

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify bot added a commit that referenced this pull request Aug 11, 2024
* Revert "New Asset System (#1295)" (#1338)

* Revert "New Asset System (#1295)"

This reverts commit a956877.

* Fix formatting

* Update copyright

* Remove pallet-assets dependency

* Fix fuzz tests

* Merge `main` into `develop` (#1345)

* Update dependencies to Polkadot v1.1.0 (#1331)

* Update dependencies (#1319)

* Update dependencies to polkadot-v1.1.0

* Format code

* Remove duplicate dependencies

* Update zrml-asset-router (#1321)

* Update zrml-primitives

* Partially update asset-router

* Finalize logic adjustments in asset-router

* Make asset-router tests compilable

* Correct Inspect routing for market assets in Currencies

* Directly invoke Inspect API for Currencies

* Add tests for remaining Unbalances functions

* Update remaining Zeitgeist pallets (#1322)

* Update zrml-asset-router (#1321)

* Upgrade zrml-market-commons

* Upgrade zrml-authorized && use MockBlock instead of MockBlockU32

* Upgrade zrml-court

* Upgrade zrml-global-disputes

* Upgrade liquidity mining

* Upgrade zrml-rikiddo

* Upgrade zrml-simple-disputes

* Upgrade zrml-styx

* Upgrade zrml-orderbook

* Upgrade zrml-parimutuel

* Upgrade zrml-swaps

* Upgrade zrml-prediction-markets

* Upgrade zrml-neo-swaps

* Upgrade zrml-hybrid-router

* Update license headers

* Update runtime (#1323)

* Update weight files & Runtime enum

* Use workspace metadata

* Always use serde serialization for asset types

* Make battery station standalone runtime compilable

* Make benchmark and try-runtime feature compilable

* Make BS build with all features

* Make parachain tests compile

* Partially fix xcm tests

* Use safe xcm version 2

* Update Zeitgeist runtime (except xcm tests)

* Format code

* Remove deprecated comment

* Integrate new xcm-emulator (#1324)

* Integrate new xcm-emulator environment

* Utilize new xcm-emulator interfaces

* Spawn relay-para network using patched xcm-emulator

* Use proper collator genesis config

* Fix Rococo tests

* Finalize Battery Station XCM tests

* Finalize Zeitgeist XCM tests

* Update client (#1327)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Update node/src/cli.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update try-runtime* Makefile targets

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Make CI succeed and add migrations (#1329)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Satisfy Clippy

* Fix benchmarks

* Add migrations

* Satisfy Clippy

* Update moonkit depedencies

* Free disk space more aggressively

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Update spec version, try-runtime Makefile

* Fix copyright notices

* Fix broken chain state (#1336)

* Add `StorageVersion` fix and contrats fix migrations

* Don't set pallet-balances' storage version

* Remove migrations from pallet-contracts config

* Clear storage tries of contracts

* Fix migration and info logs in try-runtime

* Fix licenses and comments

* Fix formatting

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Merge

* Fix benchmark

* Fix compiler error

* Fix tests and imports

* Fix imports (again...)

* Fix orderbook benchmarks

* Fix fuzz tests

* Fix formatting

* Fix orderbook fuzz

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Update versions to v0.5.3

* Fix Makefile

* Change endpoint of integration tests

* Fix copyright notices

* Run benchmarks

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Your Name <[email protected]>
mergify bot added a commit that referenced this pull request Aug 12, 2024
* Remove structs mentioned under TODO(#986) (#1342)

* Remove structs under TODO(#968)

* Remove OldOutcomeInfo and related structs

* Satisfy check-license

* Include buy/sell hybrid-router calls in proxy filters (#1343)

* Include buy/sell calls in proxy filters

* Add hybrid-router calls to HandleAssets

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Remove zrml-liquidity-mining (#1341)

* Remove zrml-liquidity-mining

* Fix formatting

* Fix copyright notices

* Remove zrml-liquidity-mining from benchmarks script

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Update style guide (#1339)

* Be more strict with feature branch size

* Clarify our workflow

* Fix formatting

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Revert "New Asset System (#1295)" (#1338)

* Revert "New Asset System (#1295)"

This reverts commit a956877.

* Fix formatting

* Update copyright

* Remove pallet-assets dependency

* Fix fuzz tests

* Remove zrml-rikiddo (#1340)

* Remove zrml-rikiddo

* Remove zrml-rikiddo from README

* Remove remnants of zrml-rikiddo

* Add note to changelog

* Remove Rikiddo constants from fuzz script

* Remove code owners

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Remove zrml-simple-disputes and migrate markets (#1344)

* Remove zrml-simple-disputes and migrate markets

* Fix formatting

* Minor improvement

* Fix redundant match guard

* Remove unused pallet constant

* Fix formatting

* Merge `main` into `develop` (#1345)

* Update dependencies to Polkadot v1.1.0 (#1331)

* Update dependencies (#1319)

* Update dependencies to polkadot-v1.1.0

* Format code

* Remove duplicate dependencies

* Update zrml-asset-router (#1321)

* Update zrml-primitives

* Partially update asset-router

* Finalize logic adjustments in asset-router

* Make asset-router tests compilable

* Correct Inspect routing for market assets in Currencies

* Directly invoke Inspect API for Currencies

* Add tests for remaining Unbalances functions

* Update remaining Zeitgeist pallets (#1322)

* Update zrml-asset-router (#1321)

* Upgrade zrml-market-commons

* Upgrade zrml-authorized && use MockBlock instead of MockBlockU32

* Upgrade zrml-court

* Upgrade zrml-global-disputes

* Upgrade liquidity mining

* Upgrade zrml-rikiddo

* Upgrade zrml-simple-disputes

* Upgrade zrml-styx

* Upgrade zrml-orderbook

* Upgrade zrml-parimutuel

* Upgrade zrml-swaps

* Upgrade zrml-prediction-markets

* Upgrade zrml-neo-swaps

* Upgrade zrml-hybrid-router

* Update license headers

* Update runtime (#1323)

* Update weight files & Runtime enum

* Use workspace metadata

* Always use serde serialization for asset types

* Make battery station standalone runtime compilable

* Make benchmark and try-runtime feature compilable

* Make BS build with all features

* Make parachain tests compile

* Partially fix xcm tests

* Use safe xcm version 2

* Update Zeitgeist runtime (except xcm tests)

* Format code

* Remove deprecated comment

* Integrate new xcm-emulator (#1324)

* Integrate new xcm-emulator environment

* Utilize new xcm-emulator interfaces

* Spawn relay-para network using patched xcm-emulator

* Use proper collator genesis config

* Fix Rococo tests

* Finalize Battery Station XCM tests

* Finalize Zeitgeist XCM tests

* Update client (#1327)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Update node/src/cli.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update try-runtime* Makefile targets

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Make CI succeed and add migrations (#1329)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Satisfy Clippy

* Fix benchmarks

* Add migrations

* Satisfy Clippy

* Update moonkit depedencies

* Free disk space more aggressively

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Update spec version, try-runtime Makefile

* Fix copyright notices

* Fix broken chain state (#1336)

* Add `StorageVersion` fix and contrats fix migrations

* Don't set pallet-balances' storage version

* Remove migrations from pallet-contracts config

* Clear storage tries of contracts

* Fix migration and info logs in try-runtime

* Fix licenses and comments

* Fix formatting

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Merge

* Fix benchmark

* Fix compiler error

* Fix tests and imports

* Fix imports (again...)

* Fix orderbook benchmarks

* Fix fuzz tests

* Fix formatting

* Fix orderbook fuzz

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Merge develop into develop-v0.5.4

* Update versions to v0.5.3

---------

Co-authored-by: Nikhil Saboo <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Harald Heckmann <[email protected]>
maltekliemann added a commit that referenced this pull request Sep 13, 2024
* Revert "New Asset System (#1295)" (#1338)

* Revert "New Asset System (#1295)"

This reverts commit a956877.

* Fix formatting

* Update copyright

* Remove pallet-assets dependency

* Fix fuzz tests

* Merge `main` into `develop` (#1345)

* Update dependencies to Polkadot v1.1.0 (#1331)

* Update dependencies (#1319)

* Update dependencies to polkadot-v1.1.0

* Format code

* Remove duplicate dependencies

* Update zrml-asset-router (#1321)

* Update zrml-primitives

* Partially update asset-router

* Finalize logic adjustments in asset-router

* Make asset-router tests compilable

* Correct Inspect routing for market assets in Currencies

* Directly invoke Inspect API for Currencies

* Add tests for remaining Unbalances functions

* Update remaining Zeitgeist pallets (#1322)

* Update zrml-asset-router (#1321)

* Upgrade zrml-market-commons

* Upgrade zrml-authorized && use MockBlock instead of MockBlockU32

* Upgrade zrml-court

* Upgrade zrml-global-disputes

* Upgrade liquidity mining

* Upgrade zrml-rikiddo

* Upgrade zrml-simple-disputes

* Upgrade zrml-styx

* Upgrade zrml-orderbook

* Upgrade zrml-parimutuel

* Upgrade zrml-swaps

* Upgrade zrml-prediction-markets

* Upgrade zrml-neo-swaps

* Upgrade zrml-hybrid-router

* Update license headers

* Update runtime (#1323)

* Update weight files & Runtime enum

* Use workspace metadata

* Always use serde serialization for asset types

* Make battery station standalone runtime compilable

* Make benchmark and try-runtime feature compilable

* Make BS build with all features

* Make parachain tests compile

* Partially fix xcm tests

* Use safe xcm version 2

* Update Zeitgeist runtime (except xcm tests)

* Format code

* Remove deprecated comment

* Integrate new xcm-emulator (#1324)

* Integrate new xcm-emulator environment

* Utilize new xcm-emulator interfaces

* Spawn relay-para network using patched xcm-emulator

* Use proper collator genesis config

* Fix Rococo tests

* Finalize Battery Station XCM tests

* Finalize Zeitgeist XCM tests

* Update client (#1327)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Update node/src/cli.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update try-runtime* Makefile targets

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Make CI succeed and add migrations (#1329)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Satisfy Clippy

* Fix benchmarks

* Add migrations

* Satisfy Clippy

* Update moonkit depedencies

* Free disk space more aggressively

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Update spec version, try-runtime Makefile

* Fix copyright notices

* Fix broken chain state (#1336)

* Add `StorageVersion` fix and contrats fix migrations

* Don't set pallet-balances' storage version

* Remove migrations from pallet-contracts config

* Clear storage tries of contracts

* Fix migration and info logs in try-runtime

* Fix licenses and comments

* Fix formatting

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Merge

* Fix benchmark

* Fix compiler error

* Fix tests and imports

* Fix imports (again...)

* Fix orderbook benchmarks

* Fix fuzz tests

* Fix formatting

* Fix orderbook fuzz

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Update versions to v0.5.3

* Restructure math module

* More scaffolding

* Implement combinatorial buy math

* Implement price calculation for combo

* Remove `println!`

* Implement equalization

* Implement selling

* Add tests for combinatorial buying

* Add more tests for combinatorial buying

* Add tests for equalization

* Add more tests/corner cases

* Implement full testing, fix critical bug

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Chralt98 added a commit that referenced this pull request Feb 25, 2025
* Implement Combinatorial Betting (#1354)

* Revert "New Asset System (#1295)" (#1338)

* Revert "New Asset System (#1295)"

This reverts commit a956877.

* Fix formatting

* Update copyright

* Remove pallet-assets dependency

* Fix fuzz tests

* Merge `main` into `develop` (#1345)

* Update dependencies to Polkadot v1.1.0 (#1331)

* Update dependencies (#1319)

* Update dependencies to polkadot-v1.1.0

* Format code

* Remove duplicate dependencies

* Update zrml-asset-router (#1321)

* Update zrml-primitives

* Partially update asset-router

* Finalize logic adjustments in asset-router

* Make asset-router tests compilable

* Correct Inspect routing for market assets in Currencies

* Directly invoke Inspect API for Currencies

* Add tests for remaining Unbalances functions

* Update remaining Zeitgeist pallets (#1322)

* Update zrml-asset-router (#1321)

* Upgrade zrml-market-commons

* Upgrade zrml-authorized && use MockBlock instead of MockBlockU32

* Upgrade zrml-court

* Upgrade zrml-global-disputes

* Upgrade liquidity mining

* Upgrade zrml-rikiddo

* Upgrade zrml-simple-disputes

* Upgrade zrml-styx

* Upgrade zrml-orderbook

* Upgrade zrml-parimutuel

* Upgrade zrml-swaps

* Upgrade zrml-prediction-markets

* Upgrade zrml-neo-swaps

* Upgrade zrml-hybrid-router

* Update license headers

* Update runtime (#1323)

* Update weight files & Runtime enum

* Use workspace metadata

* Always use serde serialization for asset types

* Make battery station standalone runtime compilable

* Make benchmark and try-runtime feature compilable

* Make BS build with all features

* Make parachain tests compile

* Partially fix xcm tests

* Use safe xcm version 2

* Update Zeitgeist runtime (except xcm tests)

* Format code

* Remove deprecated comment

* Integrate new xcm-emulator (#1324)

* Integrate new xcm-emulator environment

* Utilize new xcm-emulator interfaces

* Spawn relay-para network using patched xcm-emulator

* Use proper collator genesis config

* Fix Rococo tests

* Finalize Battery Station XCM tests

* Finalize Zeitgeist XCM tests

* Update client (#1327)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Update node/src/cli.rs

Co-authored-by: Malte Kliemann <[email protected]>

* Update try-runtime* Makefile targets

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Make CI succeed and add migrations (#1329)

* Fix rpc and work on client update

* Finalize standalone client

* Update parachain client

* Use same try-runtime subcommand in every case

* Satisfy Clippy

* Fix benchmarks

* Add migrations

* Satisfy Clippy

* Update moonkit depedencies

* Free disk space more aggressively

---------

Co-authored-by: Malte Kliemann <[email protected]>

* Update spec version, try-runtime Makefile

* Fix copyright notices

* Fix broken chain state (#1336)

* Add `StorageVersion` fix and contrats fix migrations

* Don't set pallet-balances' storage version

* Remove migrations from pallet-contracts config

* Clear storage tries of contracts

* Fix migration and info logs in try-runtime

* Fix licenses and comments

* Fix formatting

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Merge

* Fix benchmark

* Fix compiler error

* Fix tests and imports

* Fix imports (again...)

* Fix orderbook benchmarks

* Fix fuzz tests

* Fix formatting

* Fix orderbook fuzz

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Update versions to v0.5.3

* Restructure math module

* More scaffolding

* Implement combinatorial buy math

* Implement price calculation for combo

* Remove `println!`

* Implement equalization

* Implement selling

* Add tests for combinatorial buying

* Add more tests for combinatorial buying

* Add tests for equalization

* Add more tests/corner cases

* Implement full testing, fix critical bug

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Implement combinatorial betting extrinsics (#1365)

* Implement classical buying using combinatorial buys

* Calculate classical sells with combinatorial math

* Implement `combo_buy`

* Implement `combo_sell`

* Fix compiler and clippy issues (#1366)

* Fix compiler and clippy issues

* Fix formatting

* Fix tests

* Scaffold combo pallet (#1367)

* Scaffold combo pallet

* Fix dependencies/features

* Implement combinatorial tokens (#1368)

* More scaffolding

* Add `IdManager` trait

* Scaffold ID manager

* Use generics

* WIP

* Rough outline of `CryptographicIdManager` implementation

* Improve `MaybeToBytes` implementation for `bool`

* Implement pseudo-root

* Add more tests

* Implement `quadratic_residue` and add tests

* Partial implementation of decompression algorithm

* Loads of cleaning up

* Refactor

* Clean up `hash_pair`

* Simplify interface

* Simplify serialization

* More cleanup

* Clean up and tests

* Better `ToBytes` implementation

* Abstract `decompressor` tests

* Reorganize tests

* Minor clean up

* More clean up

* Test `get_collection_id`, fix bugs

* Clean up

* Expose `force_max_work` parameter and test it properly

* Properly forget dummies

* Add more tests

* Fix some error handling, docs, and add missing tests

* Prettify

* Implement zrml-combo extrinsics (#1369)

* Extend `Config`

* wip

* Some refactors

* Implement splitting tokens

* Implement merging tokens

* Replace `halo2curves` and `ethnum` dependency and fix clippy issues (#1370)

* .

* Use `core::hint`

* Replace `halo2curves` dependency with `ark-*` dependency

* Fix clippy issues

* Fix formatting

* Add tests for `combinatorial-tokens` (#1371)

* Add mock for zrml-combinatorial-tokens

* Add test framework

* Add negative tests for `split_token`

* Add more tests, fix some bugs, extend `Event` object

* Add more tests

* Add more integration tests

* Add more integration tests

* Add more integration tests

* More tests

* Add merge tests

* final tests

* fixes

* Refine combinatorial betting (#1372)

* Add numerical thresholds to combinatorial betting

* Add protected `exp` for normal bets

* Ensure correctness of partitions

* Check partitions

* Update copyright notices (#1373)

* Add licenses

* Add remark about LGPL-3.0 licensing by Gnosis

* Fix compiler errors (#1374)

* Fix formatting

* Fix mess with copyright notices

* Format `Cargo.toml` files (#1375)

* Implement and test numerical limits for combinatorial betting (#1376)

* Add numerical limits and tests

* Add missing license

* Implement multi-market combinatorial betting tests (#1377)

* .

* Add more tests

* .

* Detailed testing

* .

* Add tests for `InvalidAmountKeep`

* Clippy fixes

* Scaffold futarchy pallet (#1378)

* Scaffold futarchy pallet

* Scaffold test suite

* .

* .

* .

* Implement Scheduler mock

* .

* wip

* Implement and test futarchy

* Implement Events

* Fix futarchy errors (#1380)

* Fix clippy errors

* Move `FutarchyOracle` to primitives

* Implement `FutarchyOracle` for neo-swaps

* Add missing licenses

* Fix formatting

* Fix toml formatting

* Implement benchmarking

* Fix clippy errors

* .

* .

* .

* benchmarks work

* .

* .

* Update copyright notices

* Implement and run Decision Market Oracle Benchmarks (#1381)

* Add benchmark for the decision market oracle

* Add benchmarks to `DecisionMarketOracle` calls

* Fix clippy errors

* Remove old migrations (#1379) (#1382)

* Remove old migrations

* Update licenses

* Implement integration test for zrml-futarchy (#1383)

* Implement integration test for zrml-futarchy

* Fix test

* Introduce `PoolId` (#1384)

* Implement `redeem_position` (#1385)

* Add `PayoutApi` and the corresponding mock

* Implement redeeming tokens

* Add tests for `redeem_position`

* Test `redeem_position` and dummy implement `Payout`

* Implement `Payout` for `PredictionMarkets` (#1386)

* Fix copyright and formatting

* Implement `payout_vector` and test

* Fix copyright

* Benchmark combinatorial-tokens (#1387)

* Expose benchmarking parameter

* Add security notes to code

* Update and test `TokenMerged` event

* Implement `TokenRedeemed` event

* Test `TokenRedeemed` event

* Add `CombinatorialTokensBenchmarkHelper`

* Implement `redeem_position` benchmark

* Implement first benchmarks, prediction markets benchmark helper

* Clear up errors

* Include benchmarks

* Extend tests

* Implement more benchmarks

* .

* .

* Use weight in `redeem_position`

* .

* .

* .

* First split bench

* Horizontal splits benchmarked

* .

* .

* .

* Fix formatting and license notes (#1388)

* Fix formatting

* Fix copyright

* Implement Combinatorial Pools (#1389)

* Define and implement `CombinatorialTokensApi`

* Abstract position calculation

* Implement `CombinatorialTokensUnsafeApi::combinatorial_position`

* Add `CombinatorialTokens*Api` to `neo-swaps`

* Fix formatting

* Add copyright notices

* .

* .

* Implement `deploy_combinatorial_pool`

* Replace `market_id` with `pool_id` where appropriate

* pool storage

* .

* Implement `PoolType`

* Use `PoolOperations::is_active`

* Use market ID for complete set operations

* Use PoolId more

* Rewrite `distribute_fees` to make use of all markets

* .

* Fix duplicate pool problem / adapter

* .

* Fix sell tests

* Fix really annoying problem

* clean up tests

* .

* .

* Update copyright

* Fix tests

* Fix formatting

* Fix coverage

* Mkl neo swaps benchmarks (#1390)

* clean up TODO

* First benchmark

* .

* .

* .

* Sceond bench

* Use weights

* Use asset_count in deploy_combinatorial_pool

* .

* .

* Use weights

* Add weights of new modules

* Add storage migrations for Combinatorial Tokens Upgrade (#1401)

* add todos for storage migrations

* remove todo for asset storage migration

* add storage migration and try-runtime tests

* correct migration and tests

* update todos

* update migration tests

* add migration to runtime, fix clippy

* bump storage version

* remove corrupted pools

* correct clippy

* correct CI

* Audit fixes (#1395)

* (Issue No 1)

- Clarify `ComboMath` documentation
- Make test `combo_buy_fails_on_amount_out_below_min` more precise

* Fix `log_ceil` and add extensive tests

* (Issue No 7) Enable overflow checks

* (Issue No 9) Fix incorrect test

* (Issue No 10) Resolve FIXMEs

- Won't fix FIXME asking for better error messages
- Solve FIXME in neo-swaps by adding `try_mutate_exists` to
  `PoolStorage`

* Fix formatting

* (Issue No 13) Remove TODO by avoiding a migration

* (Issue No 13) Remove TODO by keeping low-level types

* (Issue No 13) Remove TODO by keeping low-level types

* (Issue No 13) Remove already fixed TODO

* (Issue No 13) Remove won't fix TODOs

* (Issue No 13) Remove more TODOs, some by implementing `CheckedIncRes`

* (Issue No 13) Remove code quality TODO

* (Issue No 14) Define `SCHEDULE_PRIORITY`

* (Issue No 14) Increase readability

* (Issue No 14) Reuse `r_over_b`

* (Issue No 14) Add clarifying comments

* (Issue No 14) Abstract common math code away

* Add missing file

* (Issue No 2) Replace `force_max_work` with `fuel` parameter

* (Issue 6) Replace `SubmitOrigin` with root

* (Issue Nos. 5 & 6) Squashed commit of the following:

commit 4517504
Author: Malte Kliemann <[email protected]>
Date:   Tue Dec 10 18:51:24 2024 +0100

    Benchmark `DecisionMarketOracle`

commit 5832f0b
Author: Malte Kliemann <[email protected]>
Date:   Tue Dec 10 16:55:48 2024 +0100

    Implement `DecisionMarketOracle` using scoreboard

commit e684d47
Author: Malte Kliemann <[email protected]>
Date:   Mon Dec 9 21:24:47 2024 +0100

    Add `BlockNumber` parameter to `update`

commit 5f51378
Author: Malte Kliemann <[email protected]>
Date:   Mon Dec 9 21:17:20 2024 +0100

    Update oracles on each block

commit 2b831fb
Author: Malte Kliemann <[email protected]>
Date:   Mon Dec 9 20:40:26 2024 +0100

    Implement `try_mutate_all`

commit 59cb185
Author: Malte Kliemann <[email protected]>
Date:   Mon Dec 9 18:24:56 2024 +0100

    Use `ProposalStorage` and `MaxProposals`

commit 58afe87
Author: Malte Kliemann <[email protected]>
Date:   Mon Dec 9 17:56:53 2024 +0100

    Add `MaxProposals` value

commit 22068d8
Author: Malte Kliemann <[email protected]>
Date:   Mon Dec 9 14:15:33 2024 +0100

    Add `update` function to `FutarchyOracle` trait

* Fix audit decompressor security miscellaneous comments (#1402)

* Update arkworks-rs dependencies

* Extend get_collection_id comment

* Distinguish collection id generation error

* Use immutable transformations

* fmt

* Update copyrights

* Use retrieval instead of generation for collection id error

* Fix misprint

* fix clippy

* Merge oracles into audit fixes (#1399)

* Add `update` function to `FutarchyOracle` trait

* Add `MaxProposals` value

* Use `ProposalStorage` and `MaxProposals`

* Implement `try_mutate_all`

* Update oracles on each block

* Add `BlockNumber` parameter to `update`

* Implement `DecisionMarketOracle` using scoreboard

* Benchmark `DecisionMarketOracle`

---------

Co-authored-by: Chralt <[email protected]>

* Add docs (#1391)

* Add some docs and remove TODOs

* More documentation

* .

* update docs to use fuel parameter

* Update zrml/combinatorial-tokens/README.md

* Update zrml/combinatorial-tokens/README.md

* fix comment

* add decision market oracle scoreboard to futarchy module doc

* update decision market oracle doc to include scoreboard

* add fuel parameter doc to complexity of deploy combinatorial pool

* correct the futarchy module documentation to use root origin for proposal

---------

Co-authored-by: Chralt98 <[email protected]>
Co-authored-by: Chralt <[email protected]>

* Add fuzz tests for combinatorial tokens, pool and futarchy (#1392)

* Implement fuzz tests for futarchy

* Minor fixes

* add first fuzz test for combo tokens

* Add test to script

* Add fuzz test for merge position

* .

* Add redeem fuzz test

* Add combinatorial pool fuzz tests

* Add neo-swaps fuzz to script

* combo buy

* Minor fixes, add to script

* Add combo sell

* use fuel parameter for fuzz tests

---------

Co-authored-by: Chralt98 <[email protected]>

* update comments in neo-swaps

* remove duplicated numerical limits check

* correct comments in split_position.rs

* fix comments in merge_position

* correct redeem_position test function name

* use HARD_DEADLINE scheduler priority

* fix futarchy benchmarks and fmt

* add comments for combo buy

* correct combo buy test

* rename test function

* add test comment

* add test comment

* correct neo-swaps benchmark

* add reminder from the documentation

* update gnosis doc references

* update gnosis doc reference

* update copyrights

* fix copyrights

* taplo fmt

* fix neo-swaps benchmarks after existential deposit bump

* fix deploy combinatorial pool benchmark

* fix decision market oracle benchmarks

---------

Co-authored-by: Harald Heckmann <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Your Name <[email protected]>
Co-authored-by: Chralt <[email protected]>
Co-authored-by: Chralt98 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s:accepted This pull request is ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants