diff --git a/.github/changelog-processor.py b/.github/changelog-processor.py index 10750aade7..29e86bd3ea 100755 --- a/.github/changelog-processor.py +++ b/.github/changelog-processor.py @@ -32,12 +32,39 @@ help="Print the changelog from the last release.", action="store_true" ) +group.add_argument( + "--validate-changelog", + dest="validate_changelog", + help="Validates that the changelog uses the correct syntax", + action="store_true" +) args = parser.parse_args() with open(args.changelog, "r") as changelog: lines = changelog.readlines() + if args.validate_changelog: + for line in lines: + if line.startswith("##"): + if line.startswith("###"): + continue + elif not line.startswith("## ["): + print("Line starting with `##` needs to be followed by ` [`, e.g.: `## [Unreleased]`, `## [400.2.1]`") + print(line) + sys.exit(-1) + elif line.strip().removeprefix("## [").split("]")[0].count(".") != 2 and not "unreleased" in line.lower(): + print("Only Major.Minor.Patch are supported as versioning") + print(line) + sys.exit(-1) + elif line.startswith("#"): + if line.strip() != "# Changelog": + print("Line starting with `#` is only allowed for `# Changelog`") + print(line) + sys.exit(-1) + + sys.exit(0) + changelog_last_release = "" found_last_version = False @@ -53,7 +80,6 @@ else: break - if args.changelog_last_release: print(changelog_last_release, end = "") sys.exit(0) @@ -63,7 +89,7 @@ elif args.should_release: if version.lower() == "unreleased": print("0", end = "") - sys.exit(-1) + sys.exit(0) elif version.count(".") != 2: print("0", end = "") sys.exit(-1) diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index ef1cfb7b88..e533fe048c 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -14,11 +14,11 @@ jobs: if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/merge') }} steps: - name: Get the GitHub handle of the fellows - uses: paritytech/get-fellows-action@v1.1.3 + uses: paritytech/get-fellows-action@v1.1.4 id: fellows - name: Generate a token id: merge_token - uses: actions/create-github-app-token@v1.8.1 + uses: actions/create-github-app-token@v1 with: app-id: ${{ secrets.MERGE_APP_ID }} private-key: ${{ secrets.MERGE_APP_KEY }} diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index f6a85e9b02..5e955521b8 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,14 +1,23 @@ -name: Modify Changelog +name: Verify Changelog + +# If you modify more test jobs, ensure that you add them as required to the job "confirmTestPassed" +# which is located at the end of this file (more info in the job) on: - pull_request_target: - types: - - synchronize - - edited + push: + branches: ["main", "release-*"] + pull_request: + types: [opened, reopened, synchronize, edited] + workflow_dispatch: + +# cancel previous runs +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: - verifyChangelog: + verify-changelog-updated: name: Verify that Changelog is Updated runs-on: ubuntu-latest env: @@ -22,3 +31,29 @@ jobs: - name: Set error if: steps.changed.outputs.matched != 'true' && !contains(github.event.pull_request.body, '[x] Does not require a CHANGELOG entry') run: echo "::error::CHANGELOG.md has not been modified. Either modify the file or check the checkbox in the body" && exit 1 + + verify-changelog-valid: + name: Verify that Changelog is valid + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ github.token }} + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Verify + run: .github/changelog-processor.py CHANGELOG.md --validate-changelog + + # This will only run if all the tests in its "needs" array passed. + # Add this as your required job, becuase if the matrix changes size (new things get added) + # it will still require all the steps to succeed. + # If you add more jobs, remember to add them to the "needs" array. + confirmChangelogChecksPassed: + runs-on: ubuntu-latest + name: All tests passed + # If any new job gets added, be sure to add it to this list + needs: + - verify-changelog-updated + - verify-changelog-valid + steps: + - run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/check-migrations.yml b/.github/workflows/check-migrations.yml index 72ba40db29..6b073bdb1f 100644 --- a/.github/workflows/check-migrations.yml +++ b/.github/workflows/check-migrations.yml @@ -65,7 +65,8 @@ jobs: fi # Disable the spec version check when we dont want to release. - if ! .github/changelog-processor.py CHANGELOG.md --should-release ; then + # The program prints either `1` or `0`. + if [ "$(.github/changelog-processor.py CHANGELOG.md --should-release)" = "0" ]; then EXTRA_FLAGS+=" --disable-spec-version-check" echo "Disabling the spec version check since we are not releasing" else diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index e5853d15b0..11e1139cf5 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -6,6 +6,12 @@ on: pull_request: workflow_dispatch: +# Cancel a currently running workflow from the same PR, branch or tag when a new workflow is +# triggered (ref https://stackoverflow.com/a/72408109) +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: rustfmt: runs-on: ubuntu-22.04 diff --git a/.github/workflows/review-bot.yml b/.github/workflows/review-bot.yml index 40306bad8c..b04b6159f2 100644 --- a/.github/workflows/review-bot.yml +++ b/.github/workflows/review-bot.yml @@ -16,17 +16,17 @@ jobs: steps: - name: Extract content of artifact id: number - uses: Bullrich/extract-text-from-artifact@v1.0.0 + uses: Bullrich/extract-text-from-artifact@v1.0.1 with: artifact-name: pr_number - name: Generate token id: team_token - uses: actions/create-github-app-token@v1.9.3 + uses: actions/create-github-app-token@v1 with: app-id: ${{ secrets.REVIEW_APP_ID }} private-key: ${{ secrets.REVIEW_APP_KEY }} - name: "Evaluates PR reviews and assigns reviewers" - uses: paritytech/review-bot@v2.4.1 + uses: paritytech/review-bot@v2.5.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} team-token: ${{ steps.team_token.outputs.token }} diff --git a/.github/workflows/review-trigger.yml b/.github/workflows/review-trigger.yml index fecac3acdb..783980467b 100644 --- a/.github/workflows/review-trigger.yml +++ b/.github/workflows/review-trigger.yml @@ -10,6 +10,8 @@ on: - review_request_removed - ready_for_review pull_request_review: + pull_request: + workflow_dispatch: jobs: trigger-review-bot: @@ -26,7 +28,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} - name: Get the GitHub handle of the fellows - uses: paritytech/get-fellows-action@v1.1.3 + uses: paritytech/get-fellows-action@v1.1.4 id: fellows # Require new reviews when the author is pushing and he is not a fellow - name: Fail when author pushes new code @@ -36,7 +38,7 @@ jobs: github.event_name == 'pull_request_target' && github.event.action == 'synchronize' && github.event.sender.login == github.event.pull_request.user.login && - contains(steps.fellows.outputs.github-handles, github.event.pull_request.user.login) + !contains(steps.fellows.outputs.github-handles, github.event.pull_request.user.login) run: | # We get the list of reviewers who approved the PR REVIEWERS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews \ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37d64a5b3f..57135cf99f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,11 +51,6 @@ jobs: matrix: runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }} steps: - - name: Cancel previous runs - uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # v0.11.0 - with: - access_token: ${{ github.token }} - - name: Install updates and protobuf-compiler run: sudo apt update && sudo apt install --assume-yes cmake protobuf-compiler diff --git a/CHANGELOG.md b/CHANGELOG.md index 877a08ba34..d9f97064f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,16 +4,114 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## Unreleased +## [1.2.8] 03.07.2024 + +### Added + +#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322): + +- Add `claim_assets` extrinsic to `pallet-xcm` ([SDK v1.9 #3403](https://github.com/paritytech/polkadot-sdk/pull/3403)). +- Add `Deposited`/`Withdrawn` events for `pallet-assets` ([SDK v1.12 #4312](https://github.com/paritytech/polkadot-sdk/pull/4312)). +- Add `MaxRank` Config to `pallet-core-fellowship` ([SDK v1.13 #3393](https://github.com/paritytech/polkadot-sdk/pull/3393)). +- Add Extra Check in Primary Username Setter ([SDK v1.13 #4534](https://github.com/paritytech/polkadot-sdk/pull/4534)). +- Add HRMP notification handlers to the xcm-executor ([SDK v1.10 #3696](https://github.com/paritytech/polkadot-sdk/pull/3696)). +- Add retry mechanics to `pallet-scheduler` ([SDK v1.8 #3060](https://github.com/paritytech/polkadot-sdk/pull/3060)). +- Add support for versioned notification for HRMP pallet ([SDK v1.12 #4281](https://github.com/paritytech/polkadot-sdk/pull/4281)). +- Adds ability to trigger tasks via unsigned transactions ([SDK v1.11 #4075](https://github.com/paritytech/polkadot-sdk/pull/4075)). +- Asset Conversion: Pool Account ID derivation with additional Pallet ID seed ([SDK v1.11 #3250](https://github.com/paritytech/polkadot-sdk/pull/3250)). +- Asset Conversion: Pool Touch Call ([SDK v1.11 #3251](https://github.com/paritytech/polkadot-sdk/pull/3251)). +- Balances: add failsafe for consumer ref underflow ([SDK v1.12 #3865](https://github.com/paritytech/polkadot-sdk/pull/3865)). +- Bridge: added force_set_pallet-state call to pallet-bridge-grandpa ([SDK v1.13 #4465](https://github.com/paritytech/polkadot-sdk/pull/4465)). +- Burn extrinsic call and `fn burn_from` `Preservation` argument ([SDK v1.12 #3964](https://github.com/paritytech/polkadot-sdk/pull/3964)). +- GenesisConfig presets for runtime ([SDK v1.11 #2714](https://github.com/paritytech/polkadot-sdk/pull/2714)). +- Im-online pallet offchain storage cleanup ([SDK v1.8 #2290](https://github.com/paritytech/polkadot-sdk/pull/2290)). +- Implements a percentage cap on staking rewards from era inflation ([SDK v1.8 #1660](https://github.com/paritytech/polkadot-sdk/pull/1660)). +- Introduce submit_finality_proof_ex call to bridges GRANDPA pallet ([SDK v1.8 #3225](https://github.com/paritytech/polkadot-sdk/pull/3225)). +- New call `hrmp.establish_channel_with_system` to allow parachains to establish a channel with a system parachain ([SDK v1.11 #3721](https://github.com/paritytech/polkadot-sdk/pull/3721)). +- New runtime api to check if a validator has pending pages of rewards for an era ([SDK v1.12 #4301](https://github.com/paritytech/polkadot-sdk/pull/4301)). +- Pallet-xcm: add new extrinsic for asset transfers using explicit reserve ([SDK v1.11 #3695](https://github.com/paritytech/polkadot-sdk/pull/3695)). +- All runtimes: XcmPaymentApi and DryRunApi ([polkadot-fellows/runtimes#359](https://github.com/polkadot-fellows/runtimes/pull/359)) +- Ranked collective introduce `Add` and `Remove` origins ([SDK v1.8 #3212](https://github.com/paritytech/polkadot-sdk/pull/3212)). +- Runtime apis to help with delegate-stake based Nomination Pools ([SDK v1.13 #4537](https://github.com/paritytech/polkadot-sdk/pull/4537)). +- Kusama system chains: enable PoV-reclaim. ### Changed -- Updated SDK from 1.8 to to 1.13 ([polkadot-fellows/runtimes#322](https://github.com/polkadot-fellows/runtimes/pull/322)). +- Snowbridge: Sync headers on demand ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/365)) +- Polkadot chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/345)). -### Added +#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322): -- Polkadot chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/345)) -- All runtimes: XcmPaymentApi and DryRunApi ([polkadot-fellows/runtimes#359](https://github.com/polkadot-fellows/runtimes/pull/359)) +- AdaptPrice trait is now price controlled ([SDK v1.13 #4521](https://github.com/paritytech/polkadot-sdk/pull/4521)). +- Allow StakingAdmin to manage nomination pool configurations ([SDK v1.11 #3959](https://github.com/paritytech/polkadot-sdk/pull/3959)). +- Bridge: make some headers submissions free ([SDK v1.12 #4102](https://github.com/paritytech/polkadot-sdk/pull/4102)). +- Improving on_demand_assigner emitted events ([SDK v1.13 #4339](https://github.com/paritytech/polkadot-sdk/pull/4339)). +- `pallet-broker::start_sales`: Take `extra_cores` and not total cores ([SDK v1.11 #4221](https://github.com/paritytech/polkadot-sdk/pull/4221)). +- Pallet-nomination-pools: `chill` is permissionless if depositor's stake is less than `min_nominator_bond` ([SDK v1.9 #3453](https://github.com/paritytech/polkadot-sdk/pull/3453)). +- `polkadot_runtime_parachains::coretime`: Expose `MaxXcmTransactWeight` ([SDK v1.11 #4189](https://github.com/paritytech/polkadot-sdk/pull/4189)). +- Pools: Make PermissionlessWithdraw the default claim permission ([SDK v1.10 #3438](https://github.com/paritytech/polkadot-sdk/pull/3438)). +- Prevents staking controllers from becoming stashes of different ledgers; Ensures that no ledger in bad state is mutated ([SDK v1.9 #3639](https://github.com/paritytech/polkadot-sdk/pull/3639)). +- Snowbridge: deposit extra fee to beneficiary on Asset Hub ([SDK v1.12 #4175](https://github.com/paritytech/polkadot-sdk/pull/4175)). +- Storage bound the XCMP queue pallet ([SDK v1.13 #3952](https://github.com/paritytech/polkadot-sdk/pull/3952)). +- Validator disabling strategy in runtime ([SDK v1.12 #2226](https://github.com/paritytech/polkadot-sdk/pull/2226)). + +### Fixed + +#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322): + +- CheckWeight checks for combined extrinsic length and proof size ([SDK v1.12 #4326](https://github.com/paritytech/polkadot-sdk/pull/4326)). +- Decrement total_deposit when clearing collection metadata ([SDK v1.11 #3976](https://github.com/paritytech/polkadot-sdk/pull/3976)). +- Detect incorrect pre-image length when submitting a referenda ([SDK v1.10 #3850](https://github.com/paritytech/polkadot-sdk/pull/3850)). +- Fix `schedule_code_upgrade` when called by the owner/root ([SDK v1.10 #3341](https://github.com/paritytech/polkadot-sdk/pull/3341)). +- Fix algorithmic complexity of the on-demand scheduler ([SDK v1.10 #3190](https://github.com/paritytech/polkadot-sdk/pull/3190)). +- Fix call enum's metadata regression ([SDK v1.9 #3513](https://github.com/paritytech/polkadot-sdk/pull/3513)). +- Fix dust unbonded for zero existential deposit ([SDK v1.12 #4364](https://github.com/paritytech/polkadot-sdk/pull/4364)). +- Fix extrinsics count logging in frame-system ([SDK v1.12 #4461](https://github.com/paritytech/polkadot-sdk/pull/4461)). +- Fix kusama 0 backing rewards when entering active set ([SDK v1.10 #3722](https://github.com/paritytech/polkadot-sdk/pull/3722)). +- Fix Stuck Collator Funds ([SDK v1.11 #4229](https://github.com/paritytech/polkadot-sdk/pull/4229)). +- Fix weight calculation and event emission in pallet-membership ([SDK v1.9 #3324](https://github.com/paritytech/polkadot-sdk/pull/3324)). +- Fix weight refund for `pallet-collator-selection::set_candidacy_bond` ([SDK v1.9 #3643](https://github.com/paritytech/polkadot-sdk/pull/3643)). +- Fixed `GrandpaConsensusLogReader::find_scheduled_change` ([SDK v1.11 #4208](https://github.com/paritytech/polkadot-sdk/pull/4208)). +- Fixes a scenario where a nomination pool's `TotalValueLocked` is out of sync due to staking's implicit withdraw ([SDK v1.8 #3052](https://github.com/paritytech/polkadot-sdk/pull/3052)). +- Handle legacy lease swaps on coretime ([SDK v1.10 #3714](https://github.com/paritytech/polkadot-sdk/pull/3714)). +- Ignore mandatory extrinsics in total PoV size check ([SDK v1.13 #4571](https://github.com/paritytech/polkadot-sdk/pull/4571)). +- Pallet assets: minor improvement on errors returned for some calls ([SDK v1.11 #4118](https://github.com/paritytech/polkadot-sdk/pull/4118)). +- Pallet-broker: Fix `Linear::adapt_price` behavior at zero ([SDK v1.9 #3636](https://github.com/paritytech/polkadot-sdk/pull/3636)). +- Pallet-broker: Fix claim revenue behaviour for zero timeslices ([SDK v1.11 #3997](https://github.com/paritytech/polkadot-sdk/pull/3997)). +- Pallet-broker: Support renewing leases expired in a previous period ([SDK v1.11 #4089](https://github.com/paritytech/polkadot-sdk/pull/4089)). +- Pallet-broker: Use saturating math in input validation ([SDK v1.11 #4151](https://github.com/paritytech/polkadot-sdk/pull/4151)). +- Pallet-xcm: fix transport fees for remote reserve transfers ([SDK v1.10 #3792](https://github.com/paritytech/polkadot-sdk/pull/3792)). +- Patch pool to handle extra consumer ref when destroying ([SDK v1.13 #4503](https://github.com/paritytech/polkadot-sdk/pull/4503)). +- Region reserve transfers fix ([SDK v1.11 #3455](https://github.com/paritytech/polkadot-sdk/pull/3455)). +- Snowbridge - Ethereum Client - Reject finalized updates without a sync committee in next store period ([SDK v1.13 #4478](https://github.com/paritytech/polkadot-sdk/pull/4478)). +- Treat XCM ExceedsStackLimit errors as transient in the MQ pallet ([SDK v1.12 #4202](https://github.com/paritytech/polkadot-sdk/pull/4202)). +- Unrequest a pre-image when it failed to execute ([SDK v1.10 #3849](https://github.com/paritytech/polkadot-sdk/pull/3849)). +- Validate code when scheduling uprades ([SDK v1.8 #3232](https://github.com/paritytech/polkadot-sdk/pull/3232)). +- XCMP: Use the number of 'ready' pages in XCMP suspend logic ([SDK v1.9 #2393](https://github.com/paritytech/polkadot-sdk/pull/2393)). + +### Removed + +#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322): + +- Deprecate dmp-queue pallet ([SDK v1.13 #4475](https://github.com/paritytech/polkadot-sdk/pull/4475)). +- Deprecate XCMv2 ([SDK v1.13 #4131](https://github.com/paritytech/polkadot-sdk/pull/4131)). +- Identity: Remove double encoding username signature payload ([SDK v1.13 #4646](https://github.com/paritytech/polkadot-sdk/pull/4646)). +- Pallet-xcm: deprecate execute and send in favor of execute_blob and send_blob ([SDK v1.10 #3749](https://github.com/paritytech/polkadot-sdk/pull/3749)). +- Pallet-xcm: deprecate transfer extrinsics without weight limit ([SDK v1.10 #3927](https://github.com/paritytech/polkadot-sdk/pull/3927)). +- Remove `parametrized-consensus-hook` feature ([SDK v1.13 #4380](https://github.com/paritytech/polkadot-sdk/pull/4380)). + +### Based on Polkadot-SDK + +- Upgrade dependencies to the [polkadot-sdk@1.13.0](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.13.0) release ([polkadot-fellows/runtimes#332](https://github.com/polkadot-fellows/runtimes/pull/332)) + +Note: This release only affects the following runtimes and is not a full system release: + +- Polkadot Relay Chain +- Polkadot Asset Hub +- Polkadot Bridge Hub +- Polkadot Collectives +- Kusama Relay Chain +- Kusama Bridge Hub ## [1.2.7] 14.06.2024 diff --git a/Cargo.lock b/Cargo.lock index 56500481b3..63226e79db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -595,6 +595,7 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", + "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", @@ -1699,6 +1700,7 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", + "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", @@ -2179,6 +2181,7 @@ dependencies = [ "collectives-polkadot-runtime", "coretime-kusama-runtime", "cumulus-primitives-core", + "encointer-kusama-runtime", "glutton-kusama-runtime", "kusama-runtime-constants", "pallet-staking", @@ -2583,6 +2586,7 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", + "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", @@ -3080,6 +3084,24 @@ dependencies = [ "sp-trie 36.0.0", ] +[[package]] +name = "cumulus-primitives-storage-weight-reclaim" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea10ccbf595c8b2e6dd34dcf8f5f213d6dd5e3de0f73b1eae71045ac04c692f" +dependencies = [ + "cumulus-primitives-core", + "cumulus-primitives-proof-size-hostfunction", + "docify", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime 38.0.0", + "sp-std", +] + [[package]] name = "cumulus-primitives-utility" version = "0.14.0" @@ -3689,6 +3711,165 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "encointer-balances-tx-payment" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f912501176bc6c3594ff9f1e60994d99faa41bd90395866d7aed87214bb5a3a4" +dependencies = [ + "encointer-primitives", + "frame-support", + "frame-system", + "log", + "pallet-asset-tx-payment", + "pallet-encointer-balances", + "pallet-encointer-ceremonies", + "pallet-transaction-payment", + "sp-runtime 38.0.0", +] + +[[package]] +name = "encointer-balances-tx-payment-rpc-runtime-api" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0708f366a77b08ec7e4e0b5977294d1498201c21fe560ddb10a714eddf9ca1" +dependencies = [ + "encointer-primitives", + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-std", +] + +[[package]] +name = "encointer-ceremonies-assignment" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4843d58de5b199ce7df902d13ee032b306dd753c49a70996b67f4457a209d817" +dependencies = [ + "encointer-primitives", + "sp-runtime 38.0.0", + "sp-std", +] + +[[package]] +name = "encointer-kusama-runtime" +version = "1.0.0" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "encointer-balances-tx-payment", + "encointer-balances-tx-payment-rpc-runtime-api", + "encointer-primitives", + "frame-benchmarking", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "kusama-runtime-constants", + "log", + "pallet-asset-tx-payment", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-collective", + "pallet-encointer-balances", + "pallet-encointer-bazaar", + "pallet-encointer-bazaar-rpc-runtime-api", + "pallet-encointer-ceremonies", + "pallet-encointer-ceremonies-rpc-runtime-api", + "pallet-encointer-communities", + "pallet-encointer-communities-rpc-runtime-api", + "pallet-encointer-faucet", + "pallet-encointer-reputation-commitments", + "pallet-encointer-scheduler", + "pallet-insecure-randomness-collective-flip", + "pallet-membership", + "pallet-message-queue", + "pallet-proxy", + "pallet-scheduler", + "pallet-session", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-common", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core 34.0.0", + "sp-genesis-builder", + "sp-inherents", + "sp-offchain", + "sp-runtime 38.0.0", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", + "system-parachains-constants", + "xcm-fee-payment-runtime-api", +] + +[[package]] +name = "encointer-meetup-validation" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7662dc01216f37278396d7375663d11af6ea676c78b9263745d50db507b477" +dependencies = [ + "encointer-primitives", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime 38.0.0", + "sp-std", +] + +[[package]] +name = "encointer-primitives" +version = "12.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c009e8a0f388b7e6c7cc59bf81a6f9783eb7493c5230282f1c899ec6e2c637" +dependencies = [ + "bs58 0.5.0", + "crc", + "ep-core", + "frame-support", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", + "sp-std", + "substrate-geohash", +] + [[package]] name = "enum-as-inner" version = "0.5.1" @@ -3763,6 +3944,24 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "ep-core" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21fa8791695ac76e98d9f7044201ae8e1ac036ae00a347337794c5d8a645e4ad" +dependencies = [ + "array-bytes", + "impl-serde", + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-runtime 38.0.0", + "sp-std", + "substrate-fixed", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -7670,6 +7869,191 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-encointer-balances" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a0ffd2d4a106903298ead5eec236d9dae348ce73db4b6d32690543e178f4b11" +dependencies = [ + "approx", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-asset-tx-payment", + "pallet-transaction-payment", + "parity-scale-codec", + "scale-info", + "sp-runtime 38.0.0", + "sp-std", +] + +[[package]] +name = "pallet-encointer-bazaar" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a3f0caa065fbb9a7274945d35d14b79a27263acb3ad6739f32e349e0e6ca94" +dependencies = [ + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-communities", + "parity-scale-codec", + "scale-info", + "sp-core 34.0.0", + "sp-std", +] + +[[package]] +name = "pallet-encointer-bazaar-rpc-runtime-api" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9abb60a54e20083a48be6a14fb267262efe3b1712a6ce9aaf65a32b5791f58" +dependencies = [ + "encointer-primitives", + "frame-support", + "parity-scale-codec", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-encointer-ceremonies" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2384656184280a803be722af24193248509874df198acd41b318f5d6f37c7f0f" +dependencies = [ + "encointer-ceremonies-assignment", + "encointer-meetup-validation", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-balances", + "pallet-encointer-communities", + "pallet-encointer-scheduler", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto 37.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", + "sp-std", +] + +[[package]] +name = "pallet-encointer-ceremonies-rpc-runtime-api" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0c64fe6380975c85c8ba5da27e1c6cc9bb1f1a00070cf8a6e827714fd0d1df" +dependencies = [ + "encointer-primitives", + "frame-support", + "parity-scale-codec", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-encointer-communities" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b7b944c3b3a26225f0925f41010b250fb0b168f1d37f57483c9b73c69ff944" +dependencies = [ + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-balances", + "pallet-encointer-scheduler", + "parity-scale-codec", + "scale-info", + "sp-io 37.0.0", + "sp-runtime 38.0.0", + "sp-std", +] + +[[package]] +name = "pallet-encointer-communities-rpc-runtime-api" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41510010990ea29c43476fa495721756e71b3828f0df41b6333230302bd0c95b" +dependencies = [ + "encointer-primitives", + "parity-scale-codec", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-encointer-faucet" +version = "12.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f45135e33671b00a9f00cb87e2364c68903a166b43b5e301b43c7624e045158b" +dependencies = [ + "approx", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-communities", + "pallet-encointer-reputation-commitments", + "parity-scale-codec", + "scale-info", + "sp-core 34.0.0", + "sp-runtime 38.0.0", + "sp-std", +] + +[[package]] +name = "pallet-encointer-reputation-commitments" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1be4add4c2fa83d305e40bdf8167d998dc6fdd6369f1b7c50687a728fb6df5e4" +dependencies = [ + "approx", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-ceremonies", + "pallet-encointer-communities", + "pallet-encointer-scheduler", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-core 34.0.0", + "sp-runtime 38.0.0", + "sp-std", +] + +[[package]] +name = "pallet-encointer-scheduler" +version = "12.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d760a2d2922618b1750ccd641e8d1b441d6f38dad5db347de5d3f27dddd8f647" +dependencies = [ + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-runtime 38.0.0", + "sp-std", +] + [[package]] name = "pallet-fast-unstake" version = "34.0.0" @@ -7790,6 +8174,39 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-insecure-randomness-collective-flip" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdbcd8635732846a585ee77ecd038e2701e7061ba89eb758d999d52931b02235" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "safe-mix", + "scale-info", + "sp-runtime 38.0.0", + "sp-std", +] + +[[package]] +name = "pallet-membership" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d48c79ce463ee54a9c6bf4ea82405499abc24999fa64f4a4e8b6336829d68c7" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", + "sp-std", +] + [[package]] name = "pallet-message-queue" version = "38.0.0" @@ -8898,6 +9315,7 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", + "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", "enumflags2", "frame-benchmarking", @@ -10519,6 +10937,15 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + [[package]] name = "rustc_version" version = "0.3.3" @@ -10739,6 +11166,15 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +[[package]] +name = "safe-mix" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d3d055a2582e6b00ed7a31c1524040aa391092bf636328350813f3a0605215c" +dependencies = [ + "rustc_version 0.2.3", +] + [[package]] name = "safe_arch" version = "0.7.1" @@ -11562,6 +11998,15 @@ dependencies = [ "semver-parser 0.7.0", ] +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser 0.7.0", +] + [[package]] name = "semver" version = "0.11.0" @@ -13778,6 +14223,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-fixed" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e83ba2b4f68f12ec6b0f55bac0a23a5bcaaf2676f1109c7a5ead6121c7f0622" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "substrate-typenum", +] + +[[package]] +name = "substrate-geohash" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2aad67d4ac1b37d97338ab6fd18fd5ec79c35a24112028e6feda0d67142e9a" +dependencies = [ + "parity-scale-codec", + "scale-info", + "substrate-fixed", +] + [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" @@ -13805,6 +14273,16 @@ dependencies = [ "sp-runtime 38.0.0", ] +[[package]] +name = "substrate-typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f0091e93c2c75b233ae39424c52cb8a662c0811fb68add149e20e5d7e8a788" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + [[package]] name = "substrate-wasm-builder" version = "23.0.0" diff --git a/Cargo.toml b/Cargo.toml index f18283f4d3..1981686f66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,11 +54,12 @@ cumulus-pallet-xcmp-queue = { version = "0.14.0", default-features = false } cumulus-primitives-aura = { version = "0.14.0", default-features = false } cumulus-primitives-core = { version = "0.14.0", default-features = false } cumulus-primitives-utility = { version = "0.14.0", default-features = false } +cumulus-primitives-storage-weight-reclaim = { version = "5.0.0", default-features = false } emulated-integration-tests-common = { version = "10.0.0" } -encointer-balances-tx-payment = { version = "~6.1.0", default-features = false } -encointer-balances-tx-payment-rpc-runtime-api = { version = "~6.1.0", default-features = false } -# FAIL-CI @ggwpez encointer-kusama-runtime = { path = "system-parachains/encointer" } -encointer-primitives = { version = "~6.1.0", default-features = false } +encointer-balances-tx-payment = { version = "~12.1.0", default-features = false } +encointer-balances-tx-payment-rpc-runtime-api = { version = "~12.1.0", default-features = false } +encointer-kusama-runtime = { path = "system-parachains/encointer" } +encointer-primitives = { version = "~12.2.0", default-features = false } enumflags2 = { version = "0.7.7" } frame-benchmarking = { version = "35.0.0", default-features = false } frame-election-provider-support = { version = "35.0.0", default-features = false } @@ -105,16 +106,16 @@ pallet-conviction-voting = { version = "35.0.0", default-features = false } pallet-core-fellowship = { version = "19.0.0", default-features = false } pallet-election-provider-multi-phase = { version = "34.0.0", default-features = false } pallet-election-provider-support-benchmarking = { version = "34.0.0", default-features = false } -pallet-encointer-balances = { version = "~6.1.0", default-features = false } -pallet-encointer-bazaar = { version = "~6.1.0", default-features = false } -pallet-encointer-bazaar-rpc-runtime-api = { version = "~6.1.0", default-features = false } -pallet-encointer-ceremonies = { version = "~6.1.0", default-features = false } -pallet-encointer-ceremonies-rpc-runtime-api = { version = "~6.1.0", default-features = false } -pallet-encointer-communities = { version = "~6.1.0", default-features = false } -pallet-encointer-communities-rpc-runtime-api = { version = "~6.1.0", default-features = false } -pallet-encointer-faucet = { version = "~6.2.0", default-features = false } -pallet-encointer-reputation-commitments = { version = "~6.1.0", default-features = false } -pallet-encointer-scheduler = { version = "~6.1.0", default-features = false } +pallet-encointer-balances = { version = "~12.1.0", default-features = false } +pallet-encointer-bazaar = { version = "~12.1.0", default-features = false } +pallet-encointer-bazaar-rpc-runtime-api = { version = "~12.1.0", default-features = false } +pallet-encointer-ceremonies = { version = "~12.1.0", default-features = false } +pallet-encointer-ceremonies-rpc-runtime-api = { version = "~12.1.0", default-features = false } +pallet-encointer-communities = { version = "~12.1.0", default-features = false } +pallet-encointer-communities-rpc-runtime-api = { version = "~12.1.0", default-features = false } +pallet-encointer-faucet = { version = "~12.2.0", default-features = false } +pallet-encointer-reputation-commitments = { version = "~12.1.0", default-features = false } +pallet-encointer-scheduler = { version = "~12.1.0", default-features = false } pallet-fast-unstake = { version = "34.0.0", default-features = false } pallet-glutton = { version = "21.0.0", default-features = false } pallet-grandpa = { version = "35.0.0", default-features = false } diff --git a/chain-spec-generator/Cargo.toml b/chain-spec-generator/Cargo.toml index c5ec5c7b77..2db832f0a3 100644 --- a/chain-spec-generator/Cargo.toml +++ b/chain-spec-generator/Cargo.toml @@ -35,7 +35,7 @@ asset-hub-kusama-runtime = { workspace = true } collectives-polkadot-runtime = { workspace = true } bridge-hub-polkadot-runtime = { workspace = true } bridge-hub-kusama-runtime = { workspace = true } -# FAIL-CI @ggwpez encointer-kusama-runtime = { workspace = true } +encointer-kusama-runtime = { workspace = true } glutton-kusama-runtime = { workspace = true } coretime-kusama-runtime = { workspace = true } people-kusama-runtime = { workspace = true } @@ -51,7 +51,6 @@ runtime-benchmarks = [ "collectives-polkadot-runtime/runtime-benchmarks", "coretime-kusama-runtime/runtime-benchmarks", "cumulus-primitives-core/runtime-benchmarks", - # FAIL-CI @ggwpez "encointer-kusama-runtime/runtime-benchmarks", "glutton-kusama-runtime/runtime-benchmarks", "kusama-runtime/runtime-benchmarks", "pallet-staking/runtime-benchmarks", @@ -62,5 +61,5 @@ runtime-benchmarks = [ "polkadot-runtime/runtime-benchmarks", "runtime-parachains/runtime-benchmarks", "sp-runtime/runtime-benchmarks", - # FAIL-CI @ggwpez "encointer-kusama-runtime/runtime-benchmarks" + "encointer-kusama-runtime/runtime-benchmarks" ] diff --git a/chain-spec-generator/src/relay_chain_specs.rs b/chain-spec-generator/src/relay_chain_specs.rs index 865e5f5f58..fafc276d9d 100644 --- a/chain-spec-generator/src/relay_chain_specs.rs +++ b/chain-spec-generator/src/relay_chain_specs.rs @@ -21,7 +21,10 @@ use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; use grandpa::AuthorityId as GrandpaId; use kusama_runtime_constants::currency::UNITS as KSM; use pallet_staking::Forcing; -use polkadot_primitives::{AccountId, AccountPublic, AssignmentId, ValidatorId}; +use polkadot_primitives::{ + AccountId, AccountPublic, ApprovalVotingParams, AssignmentId, AsyncBackingParams, NodeFeatures, + ValidatorId, +}; use polkadot_runtime_constants::currency::UNITS as DOT; use runtime_parachains::configuration::HostConfiguration; use sc_chain_spec::{ChainSpec, ChainType, NoExtension}; @@ -74,7 +77,22 @@ fn default_parachains_host_configuration() -> HostConfiguration` command. +After that, you can run `./run-tests.sh ` command. E.g. `./run-test.sh 0001-polkadot-kusama-asset-transfer`. diff --git a/integration-tests/bridges/run-test.sh b/integration-tests/bridges/run-test.sh index baa542825e..c9e7858820 100755 --- a/integration-tests/bridges/run-test.sh +++ b/integration-tests/bridges/run-test.sh @@ -25,8 +25,8 @@ export FRAMEWORK_PATH=$framework_repo_path/bridges/testing/framework echo export ZOMBIENET_BINARY=$LOCAL_BRIDGE_TESTING_PATH/bin/zombienet -export POLKADOT_BINARY=/home/serban/workplace/sources/polkadot-sdk/target/release/polkadot -export POLKADOT_PARACHAIN_BINARY=/home/serban/workplace/sources/polkadot-sdk/target/release/polkadot-parachain +export POLKADOT_BINARY=$LOCAL_BRIDGE_TESTING_PATH/bin/polkadot +export POLKADOT_PARACHAIN_BINARY=$LOCAL_BRIDGE_TESTING_PATH/bin/polkadot-parachain export CHAIN_SPEC_GEN_BINARY=$LOCAL_BRIDGE_TESTING_PATH/bin/chain-spec-generator export SUBSTRATE_RELAY_BINARY=$LOCAL_BRIDGE_TESTING_PATH/bin/substrate-relay diff --git a/integration-tests/bridges/sudo-relay.patch b/integration-tests/bridges/sudo-relay.patch new file mode 100644 index 0000000000..e9f90eab64 --- /dev/null +++ b/integration-tests/bridges/sudo-relay.patch @@ -0,0 +1,140 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 3873911e9..69bcc63be 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -10914,6 +10914,7 @@ dependencies = [ + "pallet-staking-reward-fn", + "pallet-staking-runtime-api", + "pallet-state-trie-migration", ++ "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", +@@ -16003,6 +16004,7 @@ dependencies = [ + "pallet-society", + "pallet-staking", + "pallet-staking-runtime-api", ++ "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", +diff --git a/chain-spec-generator/src/relay_chain_specs.rs b/chain-spec-generator/src/relay_chain_specs.rs +index e8c2fa3c8..3b90f7a54 100644 +--- a/chain-spec-generator/src/relay_chain_specs.rs ++++ b/chain-spec-generator/src/relay_chain_specs.rs +@@ -223,6 +223,9 @@ pub fn polkadot_testnet_genesis( + }) + .collect::>(), + }, ++ "sudo": { ++ "key": Some(_root_key), ++ }, + "staking": { + "minimumValidatorCount": 1, + "validatorCount": initial_authorities.len() as u32, +@@ -286,6 +289,9 @@ pub fn kusama_testnet_genesis( + }) + .collect::>(), + }, ++ "sudo": { ++ "key": Some(_root_key), ++ }, + "staking": { + "minimumValidatorCount": 1, + "validatorCount": initial_authorities.len() as u32, +diff --git a/relay/kusama/Cargo.toml b/relay/kusama/Cargo.toml +index 9f4601f92..9785cb124 100644 +--- a/relay/kusama/Cargo.toml ++++ b/relay/kusama/Cargo.toml +@@ -104,6 +104,8 @@ xcm-builder = { workspace = true } + + sp-debug-derive = { workspace = true } + ++pallet-sudo = { workspace = true } ++ + [dev-dependencies] + sp-keyring = { workspace = true } + sp-trie = { workspace = true } +@@ -174,6 +176,7 @@ std = [ + "pallet-society/std", + "pallet-staking-runtime-api/std", + "pallet-staking/std", ++ "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", +diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs +index 05724aee5..7d8f60205 100644 +--- a/relay/kusama/src/lib.rs ++++ b/relay/kusama/src/lib.rs +@@ -1641,6 +1641,12 @@ impl pallet_im_online::Config for Runtime { + type ValidatorSet = Historical; + } + ++impl pallet_sudo::Config for Runtime { ++ type RuntimeEvent = RuntimeEvent; ++ type RuntimeCall = RuntimeCall; ++ type WeightInfo = (); ++} ++ + construct_runtime! { + pub enum Runtime + { +@@ -1771,6 +1777,9 @@ construct_runtime! { + + // Pallet for migrating Identity to a parachain. To be removed post-migration. + IdentityMigrator: identity_migrator = 248, ++ ++ // Sudo. ++ Sudo: pallet_sudo = 255, + } + } + +diff --git a/relay/polkadot/Cargo.toml b/relay/polkadot/Cargo.toml +index c7f8c92b6..53c87f0e8 100644 +--- a/relay/polkadot/Cargo.toml ++++ b/relay/polkadot/Cargo.toml +@@ -101,6 +101,8 @@ xcm-builder = { workspace = true } + + sp-debug-derive = { workspace = true } + ++pallet-sudo = { workspace = true } ++ + [dev-dependencies] + sp-keyring = { workspace = true } + sp-trie = { workspace = true } +@@ -168,6 +170,7 @@ std = [ + "pallet-staking-runtime-api/std", + "pallet-staking/std", + "pallet-state-trie-migration/std", ++ "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", +diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs +index b31948725..39d62fe20 100644 +--- a/relay/polkadot/src/lib.rs ++++ b/relay/polkadot/src/lib.rs +@@ -1650,6 +1650,12 @@ impl pallet_im_online::Config for Runtime { + type ValidatorSet = Historical; + } + ++impl pallet_sudo::Config for Runtime { ++ type RuntimeEvent = RuntimeEvent; ++ type RuntimeCall = RuntimeCall; ++ type WeightInfo = (); ++} ++ + construct_runtime! { + pub enum Runtime + { +@@ -1759,6 +1765,9 @@ construct_runtime! { + // refer to block. See issue #160 for details. + Mmr: pallet_mmr = 201, + BeefyMmrLeaf: pallet_beefy_mmr = 202, ++ ++ // Sudo. ++ Sudo: pallet_sudo = 255, + } + } + diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs index 757089282c..59eacd0517 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/send_xcm.rs @@ -61,10 +61,13 @@ fn send_xcm_from_kusama_relay_to_polkadot_asset_hub_should_fail_on_not_applicabl #[test] fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { // Initially set only default version on all runtimes - AssetHubKusama::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); - BridgeHubKusama::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); - BridgeHubPolkadot::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); - AssetHubPolkadot::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + let newer_xcm_version = xcm::prelude::XCM_VERSION; + let older_xcm_version = newer_xcm_version - 1; + + AssetHubKusama::force_default_xcm_version(Some(older_xcm_version)); + BridgeHubKusama::force_default_xcm_version(Some(older_xcm_version)); + BridgeHubPolkadot::force_default_xcm_version(Some(older_xcm_version)); + AssetHubPolkadot::force_default_xcm_version(Some(older_xcm_version)); // prepare data let destination = asset_hub_polkadot_location(); @@ -87,42 +90,12 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { ); // set destination version - AssetHubKusama::force_xcm_version(destination.clone(), xcm::v3::prelude::XCM_VERSION); - - // TODO: remove this block, when removing `xcm:v2` - { - // send XCM from AssetHubKusama - fails - AssetHubKusama is set to the default/safe `2` - // version, which does not have the `ExportMessage` instruction. If the default `2` is - // changed to `3`, then this assert can go away" - assert_err!( - send_asset_from_asset_hub_kusama(destination.clone(), (native_token.clone(), amount)), - DispatchError::Module(sp_runtime::ModuleError { - index: 31, - error: [1, 0, 0, 0], - message: Some("SendFailure") - }) - ); - - // set exact version for BridgeHubPolkadot to `2` without `ExportMessage` instruction - AssetHubKusama::force_xcm_version( - ParentThen(Parachain(BridgeHubKusama::para_id().into()).into()).into(), - xcm::v2::prelude::XCM_VERSION, - ); - // send XCM from AssetHubKusama - fails - `ExportMessage` is not in `2` - assert_err!( - send_asset_from_asset_hub_kusama(destination.clone(), (native_token.clone(), amount)), - DispatchError::Module(sp_runtime::ModuleError { - index: 31, - error: [1, 0, 0, 0], - message: Some("SendFailure") - }) - ); - } + AssetHubKusama::force_xcm_version(destination.clone(), newer_xcm_version); // set version with `ExportMessage` for BridgeHubKusama AssetHubKusama::force_xcm_version( ParentThen(Parachain(BridgeHubKusama::para_id().into()).into()).into(), - xcm::v3::prelude::XCM_VERSION, + newer_xcm_version, ); // send XCM from AssetHubKusama - ok assert_ok!(send_asset_from_asset_hub_kusama( @@ -134,14 +107,11 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { assert_bridge_hub_kusama_message_accepted(false); // set version for remote BridgeHub on BridgeHubKusama - BridgeHubKusama::force_xcm_version( - bridge_hub_polkadot_location(), - xcm::v3::prelude::XCM_VERSION, - ); + BridgeHubKusama::force_xcm_version(bridge_hub_polkadot_location(), newer_xcm_version); // set version for AssetHubPolkadot on BridgeHubPolkadot BridgeHubPolkadot::force_xcm_version( ParentThen(Parachain(AssetHubPolkadot::para_id().into()).into()).into(), - xcm::v3::prelude::XCM_VERSION, + newer_xcm_version, ); // send XCM from AssetHubKusama - ok @@ -164,20 +134,4 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { ] ); }); - - // TODO: remove this block, when removing `xcm:v2` - { - // set `2` version for remote BridgeHub on BridgeHubKusama, which does not have - // `UniversalOrigin` and `DescendOrigin` - BridgeHubKusama::force_xcm_version( - bridge_hub_polkadot_location(), - xcm::v2::prelude::XCM_VERSION, - ); - - // send XCM from AssetHubKusama - ok - assert_ok!(send_asset_from_asset_hub_kusama(destination, (native_token, amount))); - // message is not accepted on the local BridgeHub (`DestinationUnsupported`) because we - // cannot add `UniversalOrigin` and `DescendOrigin` - assert_bridge_hub_kusama_message_accepted(false); - } } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs index 4102ddeb56..568fedece7 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/send_xcm.rs @@ -61,10 +61,13 @@ fn send_xcm_from_polkadot_relay_to_kusama_asset_hub_should_fail_on_not_applicabl #[test] fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { // Initially set only default version on all runtimes - AssetHubKusama::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); - BridgeHubKusama::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); - BridgeHubPolkadot::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); - AssetHubPolkadot::force_default_xcm_version(Some(xcm::v2::prelude::XCM_VERSION)); + let newer_xcm_version = xcm::prelude::XCM_VERSION; + let older_xcm_version = newer_xcm_version - 1; + + AssetHubKusama::force_default_xcm_version(Some(older_xcm_version)); + BridgeHubKusama::force_default_xcm_version(Some(older_xcm_version)); + BridgeHubPolkadot::force_default_xcm_version(Some(older_xcm_version)); + AssetHubPolkadot::force_default_xcm_version(Some(older_xcm_version)); // prepare data let destination = asset_hub_kusama_location(); @@ -87,42 +90,12 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { ); // set destination version - AssetHubPolkadot::force_xcm_version(destination.clone(), xcm::v3::prelude::XCM_VERSION); - - // TODO: remove this block, when removing `xcm:v2` - { - // send XCM from AssetHubKusama - fails - AssetHubKusama is set to the default/safe `2` - // version, which does not have the `ExportMessage` instruction. If the default `2` is - // changed to `3`, then this assert can go away" - assert_err!( - send_asset_from_asset_hub_polkadot(destination.clone(), (native_token.clone(), amount)), - DispatchError::Module(sp_runtime::ModuleError { - index: 31, - error: [1, 0, 0, 0], - message: Some("SendFailure") - }) - ); - - // set exact version for BridgeHubPolkadot to `2` without `ExportMessage` instruction - AssetHubPolkadot::force_xcm_version( - ParentThen(Parachain(BridgeHubPolkadot::para_id().into()).into()).into(), - xcm::v2::prelude::XCM_VERSION, - ); - // send XCM from AssetHubPolkadot - fails - `ExportMessage` is not in `2` - assert_err!( - send_asset_from_asset_hub_polkadot(destination.clone(), (native_token.clone(), amount)), - DispatchError::Module(sp_runtime::ModuleError { - index: 31, - error: [1, 0, 0, 0], - message: Some("SendFailure") - }) - ); - } + AssetHubPolkadot::force_xcm_version(destination.clone(), newer_xcm_version); // set version with `ExportMessage` for BridgeHubPolkadot AssetHubPolkadot::force_xcm_version( ParentThen(Parachain(BridgeHubPolkadot::para_id().into()).into()).into(), - xcm::v3::prelude::XCM_VERSION, + newer_xcm_version, ); // send XCM from AssetHubPolkadot - ok assert_ok!(send_asset_from_asset_hub_polkadot( @@ -134,14 +107,11 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { assert_bridge_hub_polkadot_message_accepted(false); // set version for remote BridgeHub on BridgeHubPolkadot - BridgeHubPolkadot::force_xcm_version( - bridge_hub_kusama_location(), - xcm::v3::prelude::XCM_VERSION, - ); + BridgeHubPolkadot::force_xcm_version(bridge_hub_kusama_location(), newer_xcm_version); // set version for AssetHubKusama on BridgeHubKusama BridgeHubKusama::force_xcm_version( ParentThen(Parachain(AssetHubKusama::para_id().into()).into()).into(), - xcm::v3::prelude::XCM_VERSION, + newer_xcm_version, ); // send XCM from AssetHubPolkadot - ok @@ -164,20 +134,4 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() { ] ); }); - - // TODO: remove this block, when removing `xcm:v2` - { - // set `2` version for remote BridgeHub on BridgeHubKusama, which does not have - // `UniversalOrigin` and `DescendOrigin` - BridgeHubPolkadot::force_xcm_version( - bridge_hub_kusama_location(), - xcm::v2::prelude::XCM_VERSION, - ); - - // send XCM from AssetHubPolkadot - ok - assert_ok!(send_asset_from_asset_hub_polkadot(destination, (native_token, amount))); - // message is not accepted on the local BridgeHub (`DestinationUnsupported`) because we - // cannot add `UniversalOrigin` and `DescendOrigin` - assert_bridge_hub_polkadot_message_accepted(false); - } } diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index c209463e6a..d66f9293e7 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -36,10 +36,8 @@ use polkadot_runtime_common::{ impls::{ DealWithFees, LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter, }, - paras_registrar, prod_or_fast, slots, - traits::Leaser, - BalanceToU256, BlockHashCount, BlockLength, CurrencyToVote, SlowAdjustingFeeUpdate, - U256ToBalance, + paras_registrar, prod_or_fast, slots, BalanceToU256, BlockHashCount, BlockLength, + CurrencyToVote, SlowAdjustingFeeUpdate, U256ToBalance, }; use scale_info::TypeInfo; use sp_std::{ @@ -98,8 +96,7 @@ use sp_runtime::{ IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, BoundToRuntimeAppPublic, FixedU128, KeyTypeId, Perbill, Percent, Permill, - RuntimeAppPublic, RuntimeDebug, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, }; use sp_staking::SessionIndex; #[cfg(any(feature = "std", test))] @@ -164,7 +161,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("kusama"), impl_name: create_runtime_str!("parity-kusama"), authoring_version: 2, - spec_version: 1_002_006, + spec_version: 1_002_008, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 26, @@ -455,46 +452,6 @@ impl pallet_authorship::Config for Runtime { type EventHandler = Staking; } -#[derive(Clone, Debug, PartialEq, Eq, Encode, Decode)] -pub struct OldSessionKeys { - pub grandpa: ::Public, - pub babe: ::Public, - pub im_online: pallet_im_online::sr25519::AuthorityId, - pub para_validator: ::Public, - pub para_assignment: ::Public, - pub authority_discovery: ::Public, - pub beefy: ::Public, -} - -impl OpaqueKeys for OldSessionKeys { - type KeyTypeIdProviders = (); - fn key_ids() -> &'static [KeyTypeId] { - &[ - <::Public>::ID, - <::Public>::ID, - sp_core::crypto::key_types::IM_ONLINE, - <::Public>::ID, - <::Public>::ID, - <::Public>::ID, - <::Public>::ID, - ] - } - fn get_raw(&self, i: KeyTypeId) -> &[u8] { - match i { - <::Public>::ID => self.grandpa.as_ref(), - <::Public>::ID => self.babe.as_ref(), - sp_core::crypto::key_types::IM_ONLINE => self.im_online.as_ref(), - <::Public>::ID => self.para_validator.as_ref(), - <::Public>::ID => - self.para_assignment.as_ref(), - <::Public>::ID => - self.authority_discovery.as_ref(), - <::Public>::ID => self.beefy.as_ref(), - _ => &[], - } - } -} - impl_opaque_keys! { pub struct SessionKeys { pub grandpa: Grandpa, @@ -506,18 +463,6 @@ impl_opaque_keys! { } } -// remove this when removing `OldSessionKeys` -fn transform_session_keys(_val: AccountId, old: OldSessionKeys) -> SessionKeys { - SessionKeys { - grandpa: old.grandpa, - babe: old.babe, - para_validator: old.para_validator, - para_assignment: old.para_assignment, - authority_discovery: old.authority_discovery, - beefy: old.beefy, - } -} - impl pallet_session::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; @@ -1262,6 +1207,7 @@ parameter_types! { /// /// This is not a good value for para-chains since the `Scheduler` already uses up to 80% block weight. pub MessageQueueServiceWeight: Weight = Perbill::from_percent(20) * BlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * BlockWeights::get().max_block; pub const MessageQueueHeapSize: u32 = 65_536; pub const MessageQueueMaxStale: u32 = 16; } @@ -1302,7 +1248,7 @@ impl pallet_message_queue::Config for Runtime { type QueueChangeHandler = ParaInclusion; type QueuePausedQuery = (); type WeightInfo = weights::pallet_message_queue::WeightInfo; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl parachains_dmp::Config for Runtime {} @@ -1342,7 +1288,7 @@ parameter_types! { pub MaxXcmTransactWeight: Weight = Weight::from_parts( 250 * WEIGHT_REF_TIME_PER_MICROS, 20 * WEIGHT_PROOF_SIZE_PER_KB - ); // FAIL-CI @donal need to check it this is sensible. + ); } impl coretime::Config for Runtime { @@ -1783,415 +1729,13 @@ pub type Migrations = (migrations::Unreleased, migrations::Permanent); #[allow(deprecated, missing_docs)] pub mod migrations { use super::*; - use frame_support::traits::OnRuntimeUpgrade; - use frame_system::RawOrigin; - use pallet_scheduler::WeightInfo as SchedulerWeightInfo; - use polkadot_runtime_common::auctions::WeightInfo as AuctionsWeightInfo; - use runtime_parachains::configuration::WeightInfo; - #[cfg(feature = "try-runtime")] - use sp_core::crypto::ByteArray; - - pub struct GetLegacyLeaseImpl; - impl coretime::migration::GetLegacyLease for GetLegacyLeaseImpl { - fn get_parachain_lease_in_blocks(para: ParaId) -> Option { - let now = frame_system::Pallet::::block_number(); - let lease = slots::Leases::::get(para); - if lease.is_empty() { - return None - } - // Lease not yet started/or having holes, refund (coretime can't handle this): - if lease.iter().any(Option::is_none) { - if let Err(err) = slots::Pallet::::clear_all_leases( - frame_system::RawOrigin::Root.into(), - para, - ) { - log::error!( - target: "runtime", - "Clearing lease for para: {:?} failed, with error: {:?}", - para, - err - ); - }; - return None - } - let (index, _) = - as Leaser>::lease_period_index(now)?; - Some(index.saturating_add(lease.len() as u32).saturating_mul(LeasePeriod::get())) - } - } - - /// Enable the elastic scaling node side feature. - /// - /// This is required for Coretime to ensure the relay chain processes parachains that are - /// assigned to multiple cores. - pub struct EnableElasticScalingNodeFeature; - impl OnRuntimeUpgrade for EnableElasticScalingNodeFeature { - fn on_runtime_upgrade() -> Weight { - let _ = Configuration::set_node_feature(RawOrigin::Root.into(), 1, true); - weights::runtime_parachains_configuration::WeightInfo::::set_node_feature() - } - } - - parameter_types! { - pub const StateTrieMigrationName: &'static str = "StateTrieMigration"; - pub const ImOnlinePalletName: &'static str = "ImOnline"; - pub const IdentityPalletName: &'static str = "Identity"; - pub const IdentityMigratorPalletName: &'static str = "IdentityMigrator"; - } - - /// Upgrade Session keys to exclude `ImOnline` key. - /// When this is removed, should also remove `OldSessionKeys`. - pub struct UpgradeSessionKeys; - const UPGRADE_SESSION_KEYS_FROM_SPEC: u32 = 1001003; - - impl OnRuntimeUpgrade for UpgradeSessionKeys { - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { - if System::last_runtime_upgrade_spec_version() > UPGRADE_SESSION_KEYS_FROM_SPEC { - log::warn!(target: "runtime::session_keys", "Skipping session keys migration pre-upgrade check due to spec version (already applied?)"); - return Ok(Vec::new()) - } - - log::info!(target: "runtime::session_keys", "Collecting pre-upgrade session keys state"); - let key_ids = SessionKeys::key_ids(); - frame_support::ensure!( - !key_ids.iter().any(|k| *k == sp_core::crypto::key_types::IM_ONLINE), - "New session keys contain the ImOnline key that should have been removed", - ); - let storage_key = pallet_session::QueuedKeys::::hashed_key(); - let mut state: Vec = Vec::new(); - frame_support::storage::unhashed::get::>( - &storage_key, - ) - .ok_or::("Queued keys are not available".into())? - .into_iter() - .for_each(|(id, keys)| { - state.extend_from_slice(id.as_slice()); - for key_id in key_ids { - state.extend_from_slice(keys.get_raw(*key_id)); - } - }); - frame_support::ensure!(!state.is_empty(), "Queued keys are not empty before upgrade"); - Ok(state) - } - - fn on_runtime_upgrade() -> Weight { - if System::last_runtime_upgrade_spec_version() > UPGRADE_SESSION_KEYS_FROM_SPEC { - log::info!("Skipping session keys upgrade: already applied"); - return ::DbWeight::get().reads(1) - } - log::trace!("Upgrading session keys"); - Session::upgrade_keys::(transform_session_keys); - Perbill::from_percent(50) * BlockWeights::get().max_block - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade( - old_state: sp_std::vec::Vec, - ) -> Result<(), sp_runtime::TryRuntimeError> { - if System::last_runtime_upgrade_spec_version() > UPGRADE_SESSION_KEYS_FROM_SPEC { - log::warn!(target: "runtime::session_keys", "Skipping session keys migration post-upgrade check due to spec version (already applied?)"); - return Ok(()) - } - - let key_ids = SessionKeys::key_ids(); - let mut new_state: Vec = Vec::new(); - pallet_session::QueuedKeys::::get().into_iter().for_each(|(id, keys)| { - new_state.extend_from_slice(id.as_slice()); - for key_id in key_ids { - new_state.extend_from_slice(keys.get_raw(*key_id)); - } - }); - frame_support::ensure!( - !new_state.is_empty(), - "Queued keys are not empty after upgrade" - ); - frame_support::ensure!( - old_state == new_state, - "Pre-upgrade and post-upgrade keys do not match!" - ); - log::info!(target: "runtime::session_keys", "Session keys migrated successfully"); - Ok(()) - } - } - - /// Cancel all ongoing auctions. - /// - /// Any leases that come into existence after coretime was launched will not be served. Yet, - /// any ongoing auctions must be cancelled. - /// - /// Safety: - /// - /// - After coretime is launched, there are no auctions anymore. So if this forgotten to - /// be removed after the runtime upgrade, running this again on the next one is harmless. - /// - I am assuming scheduler `TaskName`s are unique, so removal of the scheduled entry - /// multiple times should also be fine. - pub struct CancelAuctions; - impl OnRuntimeUpgrade for CancelAuctions { - fn on_runtime_upgrade() -> Weight { - if let Err(err) = Auctions::cancel_auction(frame_system::RawOrigin::Root.into()) { - log::debug!(target: "runtime", "Cancelling auctions failed: {:?}", err); - } - // Cancel scheduled auction as well: - if let Err(err) = Scheduler::cancel_named( - pallet_custom_origins::Origin::AuctionAdmin.into(), - [ - 0x5c, 0x68, 0xbf, 0x0c, 0x2d, 0x11, 0x04, 0x91, 0x6b, 0xa5, 0xa4, 0xde, 0xe6, - 0xb8, 0x14, 0xe8, 0x2b, 0x27, 0x93, 0x78, 0x4c, 0xb6, 0xe7, 0x69, 0x04, 0x00, - 0x1a, 0x59, 0x49, 0xc1, 0x63, 0xb1, - ], - ) { - log::debug!(target: "runtime", "Cancelling scheduled auctions failed: {:?}", err); - } - weights::polkadot_runtime_common_auctions::WeightInfo::::cancel_auction() - .saturating_add(weights::pallet_scheduler::WeightInfo::::cancel_named( - ::MaxScheduledPerBlock::get(), - )) - } - } - - /// Migration to remove deprecated judgement proxies. - mod clear_judgement_proxies { - use super::*; - - use frame_support::{ - pallet_prelude::ValueQuery, - storage_alias, - traits::{Currency, ReservableCurrency}, - Twox64Concat, - }; - use frame_system::pallet_prelude::BlockNumberFor; - use pallet_proxy::ProxyDefinition; - use sp_runtime::{BoundedVec, Saturating}; - - /// ProxyType including the deprecated `IdentityJudgement`. - #[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - RuntimeDebug, - MaxEncodedLen, - TypeInfo, - )] - pub enum PrevProxyType { - Any, - NonTransfer, - Governance, - Staking, - IdentityJudgement, - CancelProxy, - Auction, - Society, - NominationPools, - } - - type BalanceOf = <::Currency as Currency< - ::AccountId, - >>::Balance; - - type PrevProxiesValue = ( - BoundedVec>, MaxProxies>, - BalanceOf, - ); - - /// Proxies including the deprecated `IdentityJudgement` type. - #[storage_alias] - pub type Proxies = StorageMap< - pallet_proxy::Pallet, - Twox64Concat, - AccountId, - PrevProxiesValue, - ValueQuery, - >; - - pub struct Migration; - impl OnRuntimeUpgrade for Migration { - /// Compute the expected post-upgrade state for Proxies stroage, and the reserved value - /// for all accounts with a proxy. - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { - let mut expected_proxies: BTreeMap> = - BTreeMap::new(); - let mut expected_reserved_amounts: BTreeMap = BTreeMap::new(); - - for (who, (mut proxies, old_deposit)) in - Proxies::::iter().collect::>() - { - let proxies_len_before = proxies.len() as u64; - proxies.retain(|proxy| proxy.proxy_type != PrevProxyType::IdentityJudgement); - let proxies_len_after = proxies.len() as u64; - - let new_deposit = - pallet_proxy::Pallet::::deposit(proxies.len() as u32); - - let current_reserved = - >::reserved_balance(&who); - - // Update the deposit only if proxies were removed and the deposit decreased. - if new_deposit < old_deposit && proxies_len_after < proxies_len_before { - // If there're no proxies left, they should be removed - if proxies.len() > 0 { - expected_proxies.insert(who.clone(), (proxies, new_deposit)); - } - expected_reserved_amounts.insert( - who, - current_reserved.saturating_sub(old_deposit - new_deposit), - ); - } else { - // Deposit should not change. If any proxies needed to be removed, this - // won't impact that. - expected_proxies.insert(who.clone(), (proxies, old_deposit)); - expected_reserved_amounts.insert(who, current_reserved); - } - } - - let pre_upgrade_state = (expected_proxies, expected_reserved_amounts); - Ok(pre_upgrade_state.encode()) - } - - fn on_runtime_upgrade() -> Weight { - let mut reads = 0u64; - let mut writes = 0u64; - let mut proxies_removed_total = 0u64; - - Proxies::::translate( - |who: AccountId, (mut proxies, old_deposit): PrevProxiesValue| { - // Remove filter out IdentityJudgement proxies. - let proxies_len_before = proxies.len() as u64; - proxies - .retain(|proxy| proxy.proxy_type != PrevProxyType::IdentityJudgement); - let proxies_len_after = proxies.len() as u64; - - let deposit = if proxies_len_before > proxies_len_after { - log::info!( - "Removing {} IdentityJudgement proxies for {:?}", - proxies_len_before - proxies_len_after, - &who - ); - proxies_removed_total - .saturating_accrue(proxies_len_before - proxies_len_after); - - let new_deposit = - pallet_proxy::Pallet::::deposit(proxies.len() as u32); - - // Be kind and don't increase the deposit in case it increased (can - // happen if param change). - let deposit = new_deposit.min(old_deposit); - if deposit < old_deposit { - writes.saturating_inc(); - >::unreserve( - &who, - old_deposit - deposit, - ); - } - - deposit - } else { - // Nothing to do, use the old deposit. - old_deposit - }; - - reads.saturating_accrue(proxies_len_before + 1); - writes.saturating_accrue(proxies_len_after + 1); - - // No need to keep the k/v around if there're no proxies left. - match proxies.is_empty() { - true => { - debug_assert_eq!(deposit, 0); - None - }, - false => Some((proxies, deposit)), - } - }, - ); - - log::info!("Removed {} IdentityJudgement proxies in total", proxies_removed_total); - ::DbWeight::get().reads_writes(reads, writes) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { - use frame_support::ensure; - use sp_runtime::TryRuntimeError; - - let (expected_proxies, expected_total_reserved): ( - BTreeMap>, - BTreeMap, - ) = Decode::decode(&mut &state[..]).expect("Failed to decode pre-upgrade state"); - - // Check Proxies storage is as expected - for (who, (proxies, deposit)) in Proxies::::iter() { - match expected_proxies.get(&who) { - Some((expected_proxies, expected_deposit)) => { - ensure!(&proxies == expected_proxies, "Unexpected Proxy"); - ensure!(&deposit == expected_deposit, "Unexpected deposit"); - }, - None => { - return Err(TryRuntimeError::Other("Missing Proxy")); - }, - } - } - - // Check the total reserved amounts for every account is as expected - for (who, expected_reserved) in expected_total_reserved.iter() { - let current_reserved = - >::reserved_balance(who); - - ensure!(current_reserved == *expected_reserved, "Reserved balance mismatch"); - } - - // Check there are no extra entries in the expected state that are not in the - // current state - for (who, _) in expected_proxies.iter() { - if !Proxies::::contains_key(who) { - return Err(TryRuntimeError::Other("Extra entry in expected state")); - } - } - - Ok(()) - } - } - } /// Unreleased migrations. Add new ones here: pub type Unreleased = ( - frame_support::migrations::RemovePallet, - pallet_nomination_pools::migration::versioned::V7ToV8, - pallet_staking::migrations::v14::MigrateToV14, - parachains_configuration::migration::v10::MigrateToV10, - parachains_configuration::migration::v11::MigrateToV11, - pallet_grandpa::migrations::MigrateV4ToV5, - parachains_scheduler::migration::MigrateV1ToV2, - // Migrate from legacy lease to coretime. Needs to run after configuration v11 - coretime::migration::MigrateToCoretime< - Runtime, - crate::xcm_config::XcmRouter, - GetLegacyLeaseImpl, - >, - EnableElasticScalingNodeFeature, - // Upgrade `SessionKeys` to exclude `ImOnline` - UpgradeSessionKeys, - // Remove `im-online` pallet on-chain storage - frame_support::migrations::RemovePallet< - ImOnlinePalletName, - ::DbWeight, - >, - CancelAuctions, - // Remove `identity` and `identity-migrator`. - frame_support::migrations::RemovePallet< - IdentityPalletName, - ::DbWeight, - >, - frame_support::migrations::RemovePallet< - IdentityMigratorPalletName, - ::DbWeight, - >, - clear_judgement_proxies::Migration, + parachains_configuration::migration::v12::MigrateToV12, + pallet_staking::migrations::v15::MigrateV14ToV15, + parachains_inclusion::migration::MigrateToV1, + parachains_assigner_on_demand::migration::MigrateV0ToV1, ); /// Migrations/checks that do not need to be versioned and can run on every update. diff --git a/relay/kusama/src/xcm_config.rs b/relay/kusama/src/xcm_config.rs index b642353341..58f91920fd 100644 --- a/relay/kusama/src/xcm_config.rs +++ b/relay/kusama/src/xcm_config.rs @@ -190,7 +190,7 @@ pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; - type XcmRecorder = XcmPallet; // FAIL-CI @cisco please check + type XcmRecorder = XcmPallet; type AssetTransactor = LocalAssetTransactor; type OriginConverter = LocalOriginConverter; type IsReserve = (); @@ -300,7 +300,7 @@ impl pallet_xcm::Config for Runtime { } #[test] -fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() { +fn karura_liquid_staking_xcm_has_sane_weight_upper_limit() { use codec::Decode; use frame_support::dispatch::GetDispatchInfo; use xcm::VersionedXcm; @@ -308,9 +308,8 @@ fn karura_liquid_staking_xcm_has_sane_weight_upper_limt() { // should be [WithdrawAsset, BuyExecution, Transact, RefundSurplus, DepositAsset] let blob = hex_literal::hex!("02140004000000000700e40b540213000000000700e40b54020006010700c817a804341801000006010b00c490bf4302140d010003ffffffff000100411f"); - let Ok(VersionedXcm::V2(old_xcm_v2)) = - VersionedXcm::::decode(&mut &blob[..]) - else { + #[allow(deprecated)] // `xcm::v2` is deprecated + let Ok(VersionedXcm::V2(old_xcm_v2)) = VersionedXcm::::decode(&mut &blob[..]) else { panic!("can't decode XCM blob") }; let old_xcm_v3: xcm::v3::Xcm = diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 8b8cc5af42..15ce7ff842 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -91,8 +91,7 @@ use sp_runtime::{ IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, BoundToRuntimeAppPublic, FixedU128, KeyTypeId, Perbill, Percent, Permill, - RuntimeAppPublic, RuntimeDebug, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, }; use sp_staking::SessionIndex; use sp_std::{ @@ -157,7 +156,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("polkadot"), impl_name: create_runtime_str!("parity-polkadot"), authoring_version: 0, - spec_version: 1_002_007, + spec_version: 1_002_008, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 26, @@ -460,46 +459,6 @@ impl pallet_authorship::Config for Runtime { type EventHandler = Staking; } -#[derive(Clone, Debug, PartialEq, Eq, Encode, Decode)] -pub struct OldSessionKeys { - pub grandpa: ::Public, - pub babe: ::Public, - pub im_online: pallet_im_online::sr25519::AuthorityId, - pub para_validator: ::Public, - pub para_assignment: ::Public, - pub authority_discovery: ::Public, - pub beefy: ::Public, -} - -impl OpaqueKeys for OldSessionKeys { - type KeyTypeIdProviders = (); - fn key_ids() -> &'static [KeyTypeId] { - &[ - <::Public>::ID, - <::Public>::ID, - sp_core::crypto::key_types::IM_ONLINE, - <::Public>::ID, - <::Public>::ID, - <::Public>::ID, - <::Public>::ID, - ] - } - fn get_raw(&self, i: KeyTypeId) -> &[u8] { - match i { - <::Public>::ID => self.grandpa.as_ref(), - <::Public>::ID => self.babe.as_ref(), - sp_core::crypto::key_types::IM_ONLINE => self.im_online.as_ref(), - <::Public>::ID => self.para_validator.as_ref(), - <::Public>::ID => - self.para_assignment.as_ref(), - <::Public>::ID => - self.authority_discovery.as_ref(), - <::Public>::ID => self.beefy.as_ref(), - _ => &[], - } - } -} - impl_opaque_keys! { pub struct SessionKeys { pub grandpa: Grandpa, @@ -511,18 +470,6 @@ impl_opaque_keys! { } } -// remove this when removing `OldSessionKeys` -fn transform_session_keys(_v: AccountId, old: OldSessionKeys) -> SessionKeys { - SessionKeys { - grandpa: old.grandpa, - babe: old.babe, - para_validator: old.para_validator, - para_assignment: old.para_assignment, - authority_discovery: old.authority_discovery, - beefy: old.beefy, - } -} - impl pallet_session::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; @@ -863,7 +810,7 @@ impl pallet_identity::Config for Runtime { type RegistrarOrigin = EitherOf, GeneralAdmin>; type OffchainSignature = Signature; type SigningPublicKey = ::Signer; - type UsernameAuthorityOrigin = EnsureRoot; + type UsernameAuthorityOrigin = EitherOf, GeneralAdmin>; type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>; type MaxSuffixLength = ConstU32<7>; type MaxUsernameLength = ConstU32<32>; @@ -1361,6 +1308,7 @@ parameter_types! { /// /// This is not a good value for para-chains since the `Scheduler` already uses up to 80% block weight. pub MessageQueueServiceWeight: Weight = Perbill::from_percent(20) * BlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * BlockWeights::get().max_block; pub const MessageQueueHeapSize: u32 = 65_536; pub const MessageQueueMaxStale: u32 = 8; } @@ -1401,7 +1349,7 @@ impl pallet_message_queue::Config for Runtime { type QueueChangeHandler = ParaInclusion; type QueuePausedQuery = (); type WeightInfo = weights::pallet_message_queue::WeightInfo; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl parachains_dmp::Config for Runtime {} @@ -1838,110 +1786,21 @@ pub type Migrations = (migrations::Unreleased, migrations::Permanent); #[allow(deprecated, missing_docs)] pub mod migrations { use super::*; - #[cfg(feature = "try-runtime")] - use sp_core::crypto::ByteArray; parameter_types! { pub const ImOnlinePalletName: &'static str = "ImOnline"; } - /// Upgrade Session keys to exclude `ImOnline` key. - /// When this is removed, should also remove `OldSessionKeys`. - pub struct UpgradeSessionKeys; - const UPGRADE_SESSION_KEYS_FROM_SPEC: u32 = 1001003; - - impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys { - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { - if System::last_runtime_upgrade_spec_version() > UPGRADE_SESSION_KEYS_FROM_SPEC { - log::warn!(target: "runtime::session_keys", "Skipping session keys migration pre-upgrade check due to spec version (already applied?)"); - return Ok(Vec::new()) - } - - log::info!(target: "runtime::session_keys", "Collecting pre-upgrade session keys state"); - let key_ids = SessionKeys::key_ids(); - frame_support::ensure!( - key_ids - .into_iter() - .find(|&k| *k == sp_core::crypto::key_types::IM_ONLINE) - .is_none(), - "New session keys contain the ImOnline key that should have been removed", - ); - let storage_key = pallet_session::QueuedKeys::::hashed_key(); - let mut state: Vec = Vec::new(); - frame_support::storage::unhashed::get::>( - &storage_key, - ) - .ok_or::("Queued keys are not available".into())? - .into_iter() - .for_each(|(id, keys)| { - state.extend_from_slice(id.as_slice()); - for key_id in key_ids { - state.extend_from_slice(keys.get_raw(*key_id)); - } - }); - frame_support::ensure!(state.len() > 0, "Queued keys are not empty before upgrade"); - Ok(state) - } - - fn on_runtime_upgrade() -> Weight { - if System::last_runtime_upgrade_spec_version() > UPGRADE_SESSION_KEYS_FROM_SPEC { - log::info!("Skipping session keys upgrade: already applied"); - return ::DbWeight::get().reads(1) - } - log::trace!("Upgrading session keys"); - Session::upgrade_keys::(transform_session_keys); - Perbill::from_percent(50) * BlockWeights::get().max_block - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade( - old_state: sp_std::vec::Vec, - ) -> Result<(), sp_runtime::TryRuntimeError> { - if System::last_runtime_upgrade_spec_version() > UPGRADE_SESSION_KEYS_FROM_SPEC { - log::warn!(target: "runtime::session_keys", "Skipping session keys migration post-upgrade check due to spec version (already applied?)"); - return Ok(()) - } - - let key_ids = SessionKeys::key_ids(); - let mut new_state: Vec = Vec::new(); - pallet_session::QueuedKeys::::get().into_iter().for_each(|(id, keys)| { - new_state.extend_from_slice(id.as_slice()); - for key_id in key_ids { - new_state.extend_from_slice(keys.get_raw(*key_id)); - } - }); - frame_support::ensure!(new_state.len() > 0, "Queued keys are not empty after upgrade"); - frame_support::ensure!( - old_state == new_state, - "Pre-upgrade and post-upgrade keys do not match!" - ); - log::info!(target: "runtime::session_keys", "Session keys migrated successfully"); - Ok(()) - } - } - - // We don't have a limit in the Relay Chain. - const IDENTITY_MIGRATION_KEY_LIMIT: u64 = u64::MAX; - /// Unreleased migrations. Add new ones here: pub type Unreleased = ( - init_state_migration::InitMigrate, - // Upgrade SessionKeys to exclude ImOnline key - UpgradeSessionKeys, - pallet_nomination_pools::migration::versioned::V7ToV8, - pallet_staking::migrations::v14::MigrateToV14, - parachains_configuration::migration::v10::MigrateToV10, - parachains_configuration::migration::v11::MigrateToV11, - pallet_grandpa::migrations::MigrateV4ToV5, - // Migrate Identity pallet for Usernames - pallet_identity::migration::versioned::V0ToV1, - parachains_scheduler::migration::MigrateV1ToV2, // Remove `im-online` pallet on-chain storage frame_support::migrations::RemovePallet< ImOnlinePalletName, ::DbWeight, >, + parachains_configuration::migration::v12::MigrateToV12, + parachains_inclusion::migration::MigrateToV1, + pallet_staking::migrations::v15::MigrateV14ToV15, ); /// Migrations/checks that do not need to be versioned and can run on every update. @@ -3311,65 +3170,3 @@ mod remote_tests { }); } } - -mod init_state_migration { - use super::Runtime; - use frame_support::traits::OnRuntimeUpgrade; - use pallet_state_trie_migration::{AutoLimits, MigrationLimits, MigrationProcess}; - #[cfg(not(feature = "std"))] - use sp_std::prelude::*; - - /// Initialize an automatic migration process. - pub struct InitMigrate; - impl OnRuntimeUpgrade for InitMigrate { - #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, sp_runtime::DispatchError> { - use codec::Encode; - let migration_should_start = AutoLimits::::get().is_none() && - MigrationProcess::::get() == Default::default(); - Ok(migration_should_start.encode()) - } - - fn on_runtime_upgrade() -> frame_support::weights::Weight { - if AutoLimits::::get().is_some() { - log::warn!("Automatic trie migration already started, not proceeding."); - return ::DbWeight::get().reads(1) - }; - - if MigrationProcess::::get() != Default::default() { - log::warn!("MigrationProcess is not Default. Not proceeding."); - return ::DbWeight::get().reads(2) - }; - - // Migration is not already running and `MigraitonProcess` is Default. Ready to run - // migrations. - // - // We use limits to target 600ko proofs per block and - // avg 800_000_000_000 of weight per block. - // See spreadsheet 4800_400 in - // https://raw.githubusercontent.com/cheme/substrate/try-runtime-mig/ksm.ods - AutoLimits::::put(Some(MigrationLimits { item: 4_800, size: 204800 * 2 })); - log::info!("Automatic trie migration started."); - ::DbWeight::get().reads_writes(2, 1) - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade( - migration_should_start_bytes: Vec, - ) -> Result<(), sp_runtime::DispatchError> { - use codec::Decode; - let migration_should_start: bool = - Decode::decode(&mut migration_should_start_bytes.as_slice()) - .expect("failed to decode migration should start"); - - if migration_should_start { - frame_support::ensure!( - AutoLimits::::get().is_some(), - sp_runtime::DispatchError::Other("Automigration did not start as expected.") - ); - } - - Ok(()) - } - } -} diff --git a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml index ae3f763878..2e7bd9d438 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml +++ b/system-parachains/asset-hubs/asset-hub-kusama/Cargo.toml @@ -92,6 +92,7 @@ cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } +cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -209,6 +210,7 @@ std = [ "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", "cumulus-primitives-core/std", + "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", "frame-executive/std", diff --git a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs index 46794b7252..42b4befc18 100644 --- a/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs @@ -135,7 +135,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("statemine"), impl_name: create_runtime_str!("statemine"), authoring_version: 1, - spec_version: 1_002_006, + spec_version: 1_002_008, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 15, @@ -405,10 +405,8 @@ pub type NativeAndAssets = fungible::UnionOf< AccountId, >; -pub type PoolIdToAccountId = pallet_asset_conversion::AccountIdConverter< - AssetConversionPalletId, - (xcm::v3::Location, xcm::v3::Location), ->; +pub type PoolIdToAccountId = + pallet_asset_conversion::AccountIdConverterNoSeed<(xcm::v3::Location, xcm::v3::Location)>; impl pallet_asset_conversion::Config for Runtime { type RuntimeEvent = RuntimeEvent; @@ -422,7 +420,7 @@ impl pallet_asset_conversion::Config for Runtime { AccountId, Self::AssetKind, PoolIdToAccountId, - >; // FAIL-CI @muharem please fix + >; type PoolAssetId = u32; type PoolAssets = PoolAssets; type PoolSetupFee = PoolSetupFee; @@ -728,6 +726,7 @@ impl parachain_info::Config for Runtime {} parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -750,7 +749,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl cumulus_pallet_aura_ext::Config for Runtime {} @@ -1064,6 +1063,7 @@ pub type SignedExtra = ( frame_system::CheckWeight, pallet_asset_conversion_tx_payment::ChargeAssetTxPayment, frame_metadata_hash_extension::CheckMetadataHash, + cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs index b43e0f40f5..68a3bfb318 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/impls.rs @@ -15,65 +15,6 @@ use crate::*; -// TODO: the types in the module copied from the PR: https://github.com/paritytech/polkadot-sdk/pull/3250 -// and should be removed when changes from the PR will get released. -// FAIL-CI @muharem please delete -pub(crate) mod pool { - use super::*; - use core::marker::PhantomData; - use pallet_asset_conversion::PoolLocator; - use sp_core::Get; - use sp_runtime::traits::{TrailingZeroInput, TryConvert}; - - /// Pool locator that mandates the inclusion of the specified `FirstAsset` in every asset pair. - /// - /// The `PoolId` is represented as a tuple of `AssetKind`s with `FirstAsset` always positioned - /// as the first element. - pub struct WithFirstAsset( - PhantomData<(FirstAsset, AccountId, AssetKind, AccountIdConverter)>, - ); - impl - PoolLocator - for WithFirstAsset - where - AssetKind: Eq + Clone + Encode, - AccountId: Decode, - FirstAsset: Get, - AccountIdConverter: for<'a> TryConvert<&'a (AssetKind, AssetKind), AccountId>, - { - fn pool_id(asset1: &AssetKind, asset2: &AssetKind) -> Result<(AssetKind, AssetKind), ()> { - if asset1 == asset2 { - return Err(()); - } - let first = FirstAsset::get(); - if first == *asset1 { - Ok((first, asset2.clone())) - } else if first == *asset2 { - Ok((first, asset1.clone())) - } else { - Err(()) - } - } - fn address(id: &(AssetKind, AssetKind)) -> Result { - AccountIdConverter::try_convert(id).map_err(|_| ()) - } - } - - /// `PoolId` to `AccountId` conversion. - pub struct AccountIdConverter(PhantomData<(Seed, PoolId)>); - impl TryConvert<&PoolId, AccountId> for AccountIdConverter - where - PoolId: Encode, - AccountId: Decode, - Seed: Get, - { - fn try_convert(id: &PoolId) -> Result { - sp_io::hashing::blake2_256(&Encode::encode(&(Seed::get(), id))[..]) - .using_encoded(|e| Decode::decode(&mut TrailingZeroInput::new(e)).map_err(|_| id)) - } - } -} - // TODO: move implementations to the polkadot-sdk. pub mod tx_payment { use super::*; diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index 19d1d245c3..db4537a508 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -153,7 +153,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("statemint"), impl_name: create_runtime_str!("statemint"), authoring_version: 1, - spec_version: 1_002_006, + spec_version: 1_002_008, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 15, @@ -645,6 +645,7 @@ impl parachain_info::Config for Runtime {} parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -667,7 +668,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl cumulus_pallet_aura_ext::Config for Runtime {} @@ -950,8 +951,12 @@ impl pallet_asset_conversion::Config for Runtime { type AssetKind = xcm::v3::Location; type Assets = NativeAndAssets; type PoolId = (Self::AssetKind, Self::AssetKind); - type PoolLocator = - impls::pool::WithFirstAsset; + type PoolLocator = pallet_asset_conversion::WithFirstAsset< + DotLocationV3, + AccountId, + Self::AssetKind, + PoolIdToAccountId, + >; type PoolAssetId = u32; type PoolAssets = PoolAssets; type PoolSetupFee = PoolSetupFee; diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index e07241c843..3d972459a8 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -81,6 +81,7 @@ cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { features = ["bridging"], workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } +cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -153,6 +154,7 @@ std = [ "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", "cumulus-primitives-core/std", + "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", "frame-executive/std", diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/primitives/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/primitives/src/lib.rs index f7bc00518c..b3c243a732 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/primitives/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/primitives/src/lib.rs @@ -61,7 +61,7 @@ impl Chain for BridgeHubKusama { impl Parachain for BridgeHubKusama { const PARACHAIN_ID: u32 = BRIDGE_HUB_KUSAMA_PARACHAIN_ID; - const MAX_HEADER_SIZE: u32 = MAX_BRIDGE_HUB_HEADER_SIZE; // FAIL-CI @svyatonik please check + const MAX_HEADER_SIZE: u32 = MAX_BRIDGE_HUB_HEADER_SIZE; } impl ChainWithMessages for BridgeHubKusama { diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_ethereum_config.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_ethereum_config.rs index 3f3e2507d5..7a7c2909c3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_ethereum_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_ethereum_config.rs @@ -87,7 +87,7 @@ impl snowbridge_pallet_outbound_queue::Config for Runtime { type Channels = EthereumSystem; } -#[cfg(not(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test)))] +#[cfg(not(any(feature = "std", feature = "runtime-benchmarks", test)))] parameter_types! { pub const ChainForkVersions: ForkVersions = ForkVersions { genesis: Fork { @@ -113,7 +113,7 @@ parameter_types! { }; } -#[cfg(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test))] +#[cfg(any(feature = "std", feature = "runtime-benchmarks", test))] parameter_types! { pub const ChainForkVersions: ForkVersions = ForkVersions { genesis: Fork { diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs index f205032eea..0c61f2f660 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs @@ -165,8 +165,8 @@ impl pallet_bridge_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; type BridgedChain = bp_polkadot::Polkadot; type HeadersToKeep = RelayChainHeadersToKeep; - type MaxFreeHeadersPerBlock = ConstU32<4>; // FAIL-CI @svyatonik - type FreeHeadersInterval = ConstU32<5>; // FAIL-CI @svyatonik + type MaxFreeHeadersPerBlock = ConstU32<4>; + type FreeHeadersInterval = ConstU32<5>; type WeightInfo = weights::pallet_bridge_grandpa::WeightInfo; } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 7b58cad685..96784c165d 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -121,6 +121,7 @@ pub type SignedExtra = ( BridgeRejectObsoleteHeadersAndMessages, bridge_to_polkadot_config::RefundBridgeHubPolkadotMessages, frame_metadata_hash_extension::CheckMetadataHash, + cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, ); bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! { @@ -171,7 +172,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bridge-hub-kusama"), impl_name: create_runtime_str!("bridge-hub-kusama"), authoring_version: 1, - spec_version: 1_002_006, + spec_version: 1_002_008, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 5, @@ -349,6 +350,7 @@ parameter_types! { /// extrinsics. The `force_checkpoint` and `submit` extrinsics (for submit, optionally) includes /// the sync committee's pubkeys (512 x 48 bytes). pub MessageQueueServiceWeight: Weight = Perbill::from_percent(60) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -377,7 +379,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl cumulus_pallet_aura_ext::Config for Runtime {} diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/snowbridge_pallet_ethereum_client.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/snowbridge_pallet_ethereum_client.rs index 95682d9ad5..6211433d7f 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/snowbridge_pallet_ethereum_client.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/snowbridge_pallet_ethereum_client.rs @@ -13,12 +13,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + //! Autogenerated weights for `snowbridge_pallet_ethereum_client` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-07-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./bridge-hub-kusama-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -60,19 +61,17 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:0 w:1) /// Proof: `EthereumBeaconClient::CurrentSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) - /// Storage: `EthereumBeaconClient::LatestExecutionState` (r:0 w:1) - /// Proof: `EthereumBeaconClient::LatestExecutionState` (`max_values`: Some(1), `max_size`: Some(80), added: 575, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:0 w:1) /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) fn force_checkpoint() -> Weight { // Proof Size summary in bytes: // Measured: `42` // Estimated: `3501` - // Minimum execution time: 104_613_642_000 picoseconds. - Weight::from_parts(104_853_038_000, 0) + // Minimum execution time: 121_589_655_000 picoseconds. + Weight::from_parts(122_147_489_000, 0) .saturating_add(Weight::from_parts(0, 3501)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(9)) + .saturating_add(T::DbWeight::get().writes(8)) } /// Storage: `EthereumBeaconClient::OperatingMode` (r:1 w:0) /// Proof: `EthereumBeaconClient::OperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) @@ -80,8 +79,6 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:1 w:0) /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) - /// Storage: `EthereumBeaconClient::LatestExecutionState` (r:1 w:0) - /// Proof: `EthereumBeaconClient::LatestExecutionState` (`max_values`: Some(1), `max_size`: Some(80), added: 575, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::NextSyncCommittee` (r:1 w:0) /// Proof: `EthereumBeaconClient::NextSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:1 w:0) @@ -92,10 +89,10 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for // Proof Size summary in bytes: // Measured: `92715` // Estimated: `93857` - // Minimum execution time: 25_994_917_000 picoseconds. - Weight::from_parts(26_043_912_000, 0) + // Minimum execution time: 31_625_954_000 picoseconds. + Weight::from_parts(31_669_815_000, 0) .saturating_add(Weight::from_parts(0, 93857)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(6)) } /// Storage: `EthereumBeaconClient::OperatingMode` (r:1 w:0) /// Proof: `EthereumBeaconClient::OperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) @@ -103,8 +100,6 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:1 w:0) /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) - /// Storage: `EthereumBeaconClient::LatestExecutionState` (r:1 w:0) - /// Proof: `EthereumBeaconClient::LatestExecutionState` (`max_values`: Some(1), `max_size`: Some(80), added: 575, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::NextSyncCommittee` (r:1 w:1) /// Proof: `EthereumBeaconClient::NextSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:1 w:0) @@ -115,10 +110,10 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for // Proof Size summary in bytes: // Measured: `92715` // Estimated: `93857` - // Minimum execution time: 130_917_835_000 picoseconds. - Weight::from_parts(131_033_271_000, 0) + // Minimum execution time: 153_268_539_000 picoseconds. + Weight::from_parts(153_784_773_000, 0) .saturating_add(Weight::from_parts(0, 93857)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/snowbridge_pallet_inbound_queue.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/snowbridge_pallet_inbound_queue.rs index 11561a092b..09484022da 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/snowbridge_pallet_inbound_queue.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/snowbridge_pallet_inbound_queue.rs @@ -13,12 +13,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + //! Autogenerated weights for `snowbridge_pallet_inbound_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-07-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./bridge-hub-kusama-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -48,8 +49,10 @@ pub struct WeightInfo(PhantomData); impl snowbridge_pallet_inbound_queue::WeightInfo for WeightInfo { /// Storage: `EthereumInboundQueue::OperatingMode` (r:1 w:0) /// Proof: `EthereumInboundQueue::OperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) - /// Storage: `EthereumBeaconClient::ExecutionHeaders` (r:1 w:0) - /// Proof: `EthereumBeaconClient::ExecutionHeaders` (`max_values`: None, `max_size`: Some(136), added: 2611, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::LatestFinalizedBlockRoot` (r:1 w:0) + /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:1 w:0) + /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// Storage: UNKNOWN KEY `0xaed97c7854d601808b98ae43079dafb3` (r:1 w:0) /// Proof: UNKNOWN KEY `0xaed97c7854d601808b98ae43079dafb3` (r:1 w:0) /// Storage: `EthereumSystem::Channels` (r:1 w:0) @@ -62,12 +65,12 @@ impl snowbridge_pallet_inbound_queue::WeightInfo for We /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn submit() -> Weight { // Proof Size summary in bytes: - // Measured: `743` - // Estimated: `4208` - // Minimum execution time: 102_623_000 picoseconds. - Weight::from_parts(106_279_000, 0) - .saturating_add(Weight::from_parts(0, 4208)) - .saturating_add(T::DbWeight::get().reads(7)) + // Measured: `697` + // Estimated: `4162` + // Minimum execution time: 175_181_000 picoseconds. + Weight::from_parts(177_031_000, 0) + .saturating_add(Weight::from_parts(0, 4162)) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs index cd2db38318..20b3b28dbd 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs @@ -256,6 +256,7 @@ fn construct_extrinsic( BridgeRejectObsoleteHeadersAndMessages, (RefundBridgeHubPolkadotMessages::default()), frame_metadata_hash_extension::CheckMetadataHash::::new(false), + cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::::new(), ); let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap(); let signature = payload.using_encoded(|e| sender.sign(e)); diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs index 805f8cb051..5aaabf4380 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs @@ -83,6 +83,7 @@ fn construct_extrinsic( BridgeRejectObsoleteHeadersAndMessages, (RefundBridgeHubPolkadotMessages::default()), frame_metadata_hash_extension::CheckMetadataHash::::new(false), + cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::::new(), ); let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap(); let signature = payload.using_encoded(|e| sender.sign(e)); diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/src/lib.rs index 4f0eebe127..40947b410a 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/src/lib.rs @@ -58,7 +58,7 @@ impl Chain for BridgeHubPolkadot { impl Parachain for BridgeHubPolkadot { const PARACHAIN_ID: u32 = BRIDGE_HUB_POLKADOT_PARACHAIN_ID; - const MAX_HEADER_SIZE: u32 = MAX_BRIDGE_HUB_HEADER_SIZE; // FAIL-CI @svyatonik please check + const MAX_HEADER_SIZE: u32 = MAX_BRIDGE_HUB_HEADER_SIZE; } impl ChainWithMessages for BridgeHubPolkadot { diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_ethereum_config.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_ethereum_config.rs index b2b95cab32..342b169bab 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_ethereum_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_ethereum_config.rs @@ -87,7 +87,7 @@ impl snowbridge_pallet_outbound_queue::Config for Runtime { type Channels = EthereumSystem; } -#[cfg(not(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test)))] +#[cfg(not(any(feature = "std", feature = "runtime-benchmarks", test)))] parameter_types! { pub const ChainForkVersions: ForkVersions = ForkVersions { genesis: Fork { @@ -113,7 +113,7 @@ parameter_types! { }; } -#[cfg(any(feature = "std", feature = "fast-runtime", feature = "runtime-benchmarks", test))] +#[cfg(any(feature = "std", feature = "runtime-benchmarks", test))] parameter_types! { pub const ChainForkVersions: ForkVersions = ForkVersions { genesis: Fork { diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs index e61961ec81..a478039bcc 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs @@ -165,8 +165,8 @@ impl pallet_bridge_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; type BridgedChain = bp_kusama::Kusama; type HeadersToKeep = RelayChainHeadersToKeep; - type MaxFreeHeadersPerBlock = ConstU32<4>; // FAIL-CI @svyatonik - type FreeHeadersInterval = ConstU32<5>; // FAIL-CI @svyatonik + type MaxFreeHeadersPerBlock = ConstU32<4>; + type FreeHeadersInterval = ConstU32<5>; type WeightInfo = weights::pallet_bridge_grandpa::WeightInfo; } diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 167470c2ed..2c41fa5ee3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -180,7 +180,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bridge-hub-polkadot"), impl_name: create_runtime_str!("bridge-hub-polkadot"), authoring_version: 1, - spec_version: 1_002_006, + spec_version: 1_002_008, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 4, @@ -358,6 +358,7 @@ parameter_types! { /// extrinsics. The `force_checkpoint` and `submit` extrinsics (for submit, optionally) includes /// the sync committee's pubkeys (512 x 48 bytes). pub MessageQueueServiceWeight: Weight = Perbill::from_percent(60) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -386,7 +387,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl cumulus_pallet_aura_ext::Config for Runtime {} diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/snowbridge_pallet_ethereum_client.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/snowbridge_pallet_ethereum_client.rs index 0894f17246..34e229cd89 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/snowbridge_pallet_ethereum_client.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/snowbridge_pallet_ethereum_client.rs @@ -13,12 +13,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + //! Autogenerated weights for `snowbridge_pallet_ethereum_client` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-07-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./bridge-hub-polkadot-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -60,19 +61,17 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:0 w:1) /// Proof: `EthereumBeaconClient::CurrentSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) - /// Storage: `EthereumBeaconClient::LatestExecutionState` (r:0 w:1) - /// Proof: `EthereumBeaconClient::LatestExecutionState` (`max_values`: Some(1), `max_size`: Some(80), added: 575, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:0 w:1) /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) fn force_checkpoint() -> Weight { // Proof Size summary in bytes: // Measured: `114` // Estimated: `3501` - // Minimum execution time: 101_311_912_000 picoseconds. - Weight::from_parts(101_492_831_000, 0) + // Minimum execution time: 121_085_131_000 picoseconds. + Weight::from_parts(121_259_783_000, 0) .saturating_add(Weight::from_parts(0, 3501)) .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(9)) + .saturating_add(T::DbWeight::get().writes(8)) } /// Storage: `EthereumBeaconClient::OperatingMode` (r:1 w:0) /// Proof: `EthereumBeaconClient::OperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) @@ -80,8 +79,6 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:1 w:0) /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) - /// Storage: `EthereumBeaconClient::LatestExecutionState` (r:1 w:0) - /// Proof: `EthereumBeaconClient::LatestExecutionState` (`max_values`: Some(1), `max_size`: Some(80), added: 575, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::NextSyncCommittee` (r:1 w:0) /// Proof: `EthereumBeaconClient::NextSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:1 w:0) @@ -92,10 +89,10 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for // Proof Size summary in bytes: // Measured: `92787` // Estimated: `93857` - // Minimum execution time: 25_164_795_000 picoseconds. - Weight::from_parts(25_229_383_000, 0) + // Minimum execution time: 31_330_152_000 picoseconds. + Weight::from_parts(31_359_573_000, 0) .saturating_add(Weight::from_parts(0, 93857)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(6)) } /// Storage: `EthereumBeaconClient::OperatingMode` (r:1 w:0) /// Proof: `EthereumBeaconClient::OperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) @@ -103,8 +100,6 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:1 w:0) /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) - /// Storage: `EthereumBeaconClient::LatestExecutionState` (r:1 w:0) - /// Proof: `EthereumBeaconClient::LatestExecutionState` (`max_values`: Some(1), `max_size`: Some(80), added: 575, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::NextSyncCommittee` (r:1 w:1) /// Proof: `EthereumBeaconClient::NextSyncCommittee` (`max_values`: Some(1), `max_size`: Some(92372), added: 92867, mode: `MaxEncodedLen`) /// Storage: `EthereumBeaconClient::CurrentSyncCommittee` (r:1 w:0) @@ -115,10 +110,10 @@ impl snowbridge_pallet_ethereum_client::WeightInfo for // Proof Size summary in bytes: // Measured: `92787` // Estimated: `93857` - // Minimum execution time: 126_786_733_000 picoseconds. - Weight::from_parts(126_936_460_000, 0) + // Minimum execution time: 152_429_993_000 picoseconds. + Weight::from_parts(152_677_694_000, 0) .saturating_add(Weight::from_parts(0, 93857)) - .saturating_add(T::DbWeight::get().reads(7)) + .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(1)) } } diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/snowbridge_pallet_inbound_queue.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/snowbridge_pallet_inbound_queue.rs index f912397030..b9cf0dc9b0 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/snowbridge_pallet_inbound_queue.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/snowbridge_pallet_inbound_queue.rs @@ -13,12 +13,13 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + //! Autogenerated weights for `snowbridge_pallet_inbound_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-03-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-07-01, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `ggwpez-ref-hw`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! HOSTNAME: `ggwpez-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` //! WASM-EXECUTION: `Compiled`, CHAIN: `Some("./bridge-hub-polkadot-chain-spec.json")`, DB CACHE: 1024 // Executed Command: @@ -48,8 +49,10 @@ pub struct WeightInfo(PhantomData); impl snowbridge_pallet_inbound_queue::WeightInfo for WeightInfo { /// Storage: `EthereumInboundQueue::OperatingMode` (r:1 w:0) /// Proof: `EthereumInboundQueue::OperatingMode` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) - /// Storage: `EthereumBeaconClient::ExecutionHeaders` (r:1 w:0) - /// Proof: `EthereumBeaconClient::ExecutionHeaders` (`max_values`: None, `max_size`: Some(136), added: 2611, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::LatestFinalizedBlockRoot` (r:1 w:0) + /// Proof: `EthereumBeaconClient::LatestFinalizedBlockRoot` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `EthereumBeaconClient::FinalizedBeaconState` (r:1 w:0) + /// Proof: `EthereumBeaconClient::FinalizedBeaconState` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) /// Storage: UNKNOWN KEY `0xaed97c7854d601808b98ae43079dafb3` (r:1 w:0) /// Proof: UNKNOWN KEY `0xaed97c7854d601808b98ae43079dafb3` (r:1 w:0) /// Storage: `EthereumSystem::Channels` (r:1 w:0) @@ -62,12 +65,12 @@ impl snowbridge_pallet_inbound_queue::WeightInfo for We /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn submit() -> Weight { // Proof Size summary in bytes: - // Measured: `815` - // Estimated: `4280` - // Minimum execution time: 104_849_000 picoseconds. - Weight::from_parts(107_855_000, 0) - .saturating_add(Weight::from_parts(0, 4280)) - .saturating_add(T::DbWeight::get().reads(7)) + // Measured: `768` + // Estimated: `4233` + // Minimum execution time: 175_861_000 picoseconds. + Weight::from_parts(178_291_000, 0) + .saturating_add(Weight::from_parts(0, 4233)) + .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(2)) } } diff --git a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs index 54a5a91349..6bef9702ef 100644 --- a/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs +++ b/system-parachains/collectives/collectives-polkadot/src/ambassador/mod.rs @@ -212,7 +212,8 @@ impl pallet_core_fellowship::Config for Runtime { type ApproveOrigin = PromoteOrigin; type PromoteOrigin = PromoteOrigin; type EvidenceSize = ConstU32<65536>; - type MaxRank = ConstU32<3>; + // TODO https://github.com/polkadot-fellows/runtimes/issues/370 + type MaxRank = ConstU32<9>; } parameter_types! { diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index b73b9afc81..7fb5fc5dfa 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -119,7 +119,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("collectives"), impl_name: create_runtime_str!("collectives"), authoring_version: 1, - spec_version: 1_002_006, + spec_version: 1_002_008, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 7, @@ -413,6 +413,7 @@ impl parachain_info::Config for Runtime {} parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -435,7 +436,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl cumulus_pallet_aura_ext::Config for Runtime {} @@ -758,6 +759,8 @@ type Migrations = ( cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, pallet_collator_selection::migration::v2::MigrationToV2, cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, + pallet_core_fellowship::migration::MigrateV0ToV1, + pallet_core_fellowship::migration::MigrateV0ToV1, // permanent pallet_xcm::migration::MigrateToLatestXcmVersion, ); diff --git a/system-parachains/coretime/coretime-kusama/Cargo.toml b/system-parachains/coretime/coretime-kusama/Cargo.toml index aefc814fd2..6af63bf4e1 100644 --- a/system-parachains/coretime/coretime-kusama/Cargo.toml +++ b/system-parachains/coretime/coretime-kusama/Cargo.toml @@ -73,6 +73,7 @@ cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-aura = { workspace = true } cumulus-primitives-core = { workspace = true } +cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -95,6 +96,7 @@ std = [ "cumulus-pallet-xcmp-queue/std", "cumulus-primitives-aura/std", "cumulus-primitives-core/std", + "cumulus-primitives-storage-weight-reclaim/std", "cumulus-primitives-utility/std", "frame-benchmarking?/std", "frame-executive/std", diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index 1c3dfe8ad9..a2b87a2509 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -105,6 +105,7 @@ pub type SignedExtra = ( frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, frame_metadata_hash_extension::CheckMetadataHash, + cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, ); /// Unchecked extrinsic type as expected by this runtime. @@ -116,6 +117,8 @@ pub type Migrations = ( pallet_xcm::migration::MigrateToLatestXcmVersion, pallet_collator_selection::migration::v2::MigrationToV2, cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, + pallet_broker::migration::MigrateV0ToV1, + pallet_broker::migration::MigrateV1ToV2, ); /// Executive: handles dispatch to the various modules. @@ -300,6 +303,7 @@ type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -322,7 +326,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl parachain_info::Config for Runtime {} diff --git a/system-parachains/encointer/src/lib.rs b/system-parachains/encointer/src/lib.rs index ecb2c747b7..782a079194 100644 --- a/system-parachains/encointer/src/lib.rs +++ b/system-parachains/encointer/src/lib.rs @@ -104,7 +104,7 @@ use system_parachains_constants::{ }; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use xcm::{ - latest::prelude::{AssetId as XcmAssetId, BodyId, + latest::prelude::{AssetId as XcmAssetId, BodyId}, VersionedXcm, VersionedLocation, VersionedAssets, VersionedAssetId, }; use xcm_fee_payment_runtime_api::{ @@ -444,6 +444,7 @@ impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -466,7 +467,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } parameter_types! { @@ -924,12 +925,12 @@ impl_runtime_apis! { impl xcm_fee_payment_runtime_api::fees::XcmPaymentApi for Runtime { fn query_acceptable_payment_assets(xcm_version: xcm::Version) -> Result, XcmPaymentApiError> { - let acceptable_assets = vec![AssetId(xcm_config::KsmLocation::get())]; + let acceptable_assets = vec![XcmAssetId(xcm_config::KsmLocation::get())]; PolkadotXcm::query_acceptable_payment_assets(xcm_version, acceptable_assets) } fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result { - match asset.try_as::() { + match asset.try_as::() { Ok(asset_id) if asset_id.0 == xcm_config::KsmLocation::get() => { // for native token Ok(WeightToFee::weight_to_fee(&weight)) diff --git a/system-parachains/encointer/src/weights/pallet_membership.rs b/system-parachains/encointer/src/weights/pallet_membership.rs index 64cd26a9cf..c79b52ca1c 100644 --- a/system-parachains/encointer/src/weights/pallet_membership.rs +++ b/system-parachains/encointer/src/weights/pallet_membership.rs @@ -47,7 +47,6 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_membership::WeightInfo for WeightInfo { fn reset_members(m: u32) -> Weight { - // FAIL-CI @bkontur we need to regenerate all the weights... Weight::from_parts(10_462_422, 0) .saturating_add(Weight::from_parts(0, 4687)) // Standard Error: 247 diff --git a/system-parachains/gluttons/glutton-kusama/src/lib.rs b/system-parachains/gluttons/glutton-kusama/src/lib.rs index 856a36434e..591157b7bb 100644 --- a/system-parachains/gluttons/glutton-kusama/src/lib.rs +++ b/system-parachains/gluttons/glutton-kusama/src/lib.rs @@ -196,6 +196,7 @@ impl parachain_info::Config for Runtime {} parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -217,7 +218,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl pallet_glutton::Config for Runtime { diff --git a/system-parachains/people/people-kusama/Cargo.toml b/system-parachains/people/people-kusama/Cargo.toml index a80ff8b41f..321df5d416 100644 --- a/system-parachains/people/people-kusama/Cargo.toml +++ b/system-parachains/people/people-kusama/Cargo.toml @@ -71,6 +71,7 @@ cumulus-pallet-session-benchmarking = { workspace = true } cumulus-pallet-xcm = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } cumulus-primitives-core = { workspace = true } +cumulus-primitives-storage-weight-reclaim = { workspace = true } cumulus-primitives-utility = { workspace = true } pallet-collator-selection = { workspace = true } parachain-info = { workspace = true } @@ -92,6 +93,7 @@ std = [ "cumulus-primitives-aura/std", "cumulus-primitives-core/std", "cumulus-primitives-utility/std", + "cumulus-primitives-storage-weight-reclaim/std", "enumflags2/std", "frame-benchmarking?/std", "frame-executive/std", diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index cbfc093598..0585af8e62 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -142,6 +142,7 @@ pub type SignedExtra = ( frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, frame_metadata_hash_extension::CheckMetadataHash, + cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim, ); /// Unchecked extrinsic type as expected by this runtime. @@ -321,8 +322,8 @@ type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< >; parameter_types! { - pub MessageQueueServiceWeight: Weight = - Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -345,7 +346,7 @@ impl pallet_message_queue::Config for Runtime { type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; type WeightInfo = weights::pallet_message_queue::WeightInfo; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } impl parachain_info::Config for Runtime {} diff --git a/system-parachains/people/people-kusama/src/people.rs b/system-parachains/people/people-kusama/src/people.rs index 5f260c9a3d..dc2c708bce 100644 --- a/system-parachains/people/people-kusama/src/people.rs +++ b/system-parachains/people/people-kusama/src/people.rs @@ -39,8 +39,14 @@ parameter_types! { pub const SubAccountDeposit: Balance = system_para_deposit(1, 53); pub RelayTreasuryAccount: AccountId = parachains_common::TREASURY_PALLET_ID.into_account_truncating(); + pub const GeneralAdminBodyId: BodyId = BodyId::Administration; } +pub type IdentityAdminOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; + impl pallet_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -52,10 +58,10 @@ impl pallet_identity::Config for Runtime { type MaxRegistrars = ConstU32<20>; type Slashed = ToParentTreasury; type ForceOrigin = EnsureRoot; - type RegistrarOrigin = EnsureRoot; + type RegistrarOrigin = IdentityAdminOrigin; type OffchainSignature = Signature; type SigningPublicKey = ::Signer; - type UsernameAuthorityOrigin = EnsureRoot; + type UsernameAuthorityOrigin = IdentityAdminOrigin; type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>; type MaxSuffixLength = ConstU32<7>; type MaxUsernameLength = ConstU32<32>; diff --git a/system-parachains/people/people-polkadot/src/lib.rs b/system-parachains/people/people-polkadot/src/lib.rs index 5ff3d4226d..3208474c6e 100644 --- a/system-parachains/people/people-polkadot/src/lib.rs +++ b/system-parachains/people/people-polkadot/src/lib.rs @@ -267,8 +267,8 @@ type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< >; parameter_types! { - pub MessageQueueServiceWeight: Weight = - Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(20) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -290,7 +290,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = sp_core::ConstU32<{ 64 * 1024 }>; type MaxStale = sp_core::ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; type WeightInfo = weights::pallet_message_queue::WeightInfo; } diff --git a/system-parachains/people/people-polkadot/src/people.rs b/system-parachains/people/people-polkadot/src/people.rs index 5f260c9a3d..026ec0f881 100644 --- a/system-parachains/people/people-polkadot/src/people.rs +++ b/system-parachains/people/people-polkadot/src/people.rs @@ -28,6 +28,8 @@ use sp_runtime::{ RuntimeDebug, }; use sp_std::prelude::*; +use xcm::latest::prelude::BodyId; +use xcm_config::GovernanceLocation; parameter_types! { // 27 | Min encoded size of `Registration` @@ -39,8 +41,14 @@ parameter_types! { pub const SubAccountDeposit: Balance = system_para_deposit(1, 53); pub RelayTreasuryAccount: AccountId = parachains_common::TREASURY_PALLET_ID.into_account_truncating(); + pub const GeneralAdminBodyId: BodyId = BodyId::Administration; } +pub type IdentityAdminOrigin = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; + impl pallet_identity::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -52,10 +60,10 @@ impl pallet_identity::Config for Runtime { type MaxRegistrars = ConstU32<20>; type Slashed = ToParentTreasury; type ForceOrigin = EnsureRoot; - type RegistrarOrigin = EnsureRoot; + type RegistrarOrigin = IdentityAdminOrigin; type OffchainSignature = Signature; type SigningPublicKey = ::Signer; - type UsernameAuthorityOrigin = EnsureRoot; + type UsernameAuthorityOrigin = IdentityAdminOrigin; type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>; type MaxSuffixLength = ConstU32<7>; type MaxUsernameLength = ConstU32<32>;