Upgrade Moonbeam to Polkadot SDK stable2512#3633
Upgrade Moonbeam to Polkadot SDK stable2512#3633arturgontijo wants to merge 71 commits intomasterfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughWorkspace-wide migration to Polkadot/Substrate stable2512, API and weight signature updates (LazyBlock, parametric XCM weights), removal of explicit SelectCore/GetCoreSelectorApi usages, node service changes to pass collator_peer_id and wire tracing, JS/frontend patch, test expectation updates, and small CI/package tweaks. Changes
Sequence Diagram(s)mermaid Node->>Consensus: start_consensus(collator_peer_id) Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Moonbase Weight Difference Report
Moonriver Weight Difference Report
Moonbeam Weight Difference Report
|
WASM runtime size check:Compared to target branchMoonbase runtime: 2056 KB (-44 KB) ✅ Moonbeam runtime: 2188 KB (-24 KB) ✅ Moonriver runtime: 2188 KB (-24 KB) ✅ Compared to latest release (runtime-4202)Moonbase runtime: 2056 KB (+120 KB compared to latest release) Moonbeam runtime: 2188 KB (+156 KB compared to latest release) Moonriver runtime: 2188 KB (+156 KB compared to latest release) |
a13b535 to
ebc8ddd
Compare
# Conflicts: # Cargo.lock # test/suites/dev/moonbase/test-pov/test-precompile-over-pov2.ts
# Conflicts: # runtime/moonbase/src/weights/cumulus_pallet_xcmp_queue.rs # runtime/moonbeam/src/weights/cumulus_pallet_xcmp_queue.rs # runtime/moonriver/src/weights/cumulus_pallet_xcmp_queue.rs # test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery2.ts
Coverage Report@@ Coverage Diff @@
## master artur/moonbeam-polkadot-stable2512 +/- ##
======================================================================
- Coverage 77.14% 77.12% -0.02%
Files 389 389
+ Lines 77176 77207 +31
======================================================================
+ Hits 59537 59544 +7
+ Misses 17639 17663 +24
|
# Conflicts: # Cargo.lock # Cargo.toml # test/suites/dev/moonbase/test-author/test-author-failed-association.ts # test/suites/dev/moonbase/test-author/test-author-non-author-clearing.ts # test/suites/dev/moonbase/test-author/test-author-registered-clear.ts # test/suites/dev/moonbase/test-author/test-author-simple-association.ts # test/suites/dev/moonbase/test-author/test-author-unregistered-clear.ts # test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery3.ts # test/suites/dev/moonbase/test-randomness/test-randomness-vrf-lottery4.ts # test/suites/dev/moonbase/test-xcm-v4/test-xcm-payment-api.ts # test/suites/dev/moonbase/test-xcm-v5/test-xcm-payment-api.ts
1f54a45 to
16b16d7
Compare
Change expect(result!.events.length === 7).to.be.true to expect(result!.events.length).to.equal(7) for consistent assertion pattern and better error messages on failure.
librelois
left a comment
There was a problem hiding this comment.
1. Make query_delivery_fees return zero instead of failing
Update the runtime API implementation in runtime/common/src/apis.rs so Moonbeam returns a successful zero-fee result when no delivery fees are configured, instead of propagating an error from the generic AssetExchanger path.
Update the corresponding tests in:
test/suites/dev/moonbase/test-xcm-v4/test-xcm-payment-api.tstest/suites/dev/moonbase/test-xcm-v5/test-xcm-payment-api.ts
They should assert a successful response representing zero delivery fees, not Err.
Moonbeam’s intended behavior is “delivery fees are zero,” not “the API cannot answer.” Returning Err changes the meaning of the API:
Errimplies unsupported or misconfigured behavior- a successful zero result correctly expresses policy
- clients can treat Moonbeam like a normal chain without special-casing an error path
2. Revisit zombienet bridge relay-chain config substitution
Review the switch in:
zombienet/configs/moonbeam-polkadot.tomlzombienet/configs/moonriver-kusama.toml
If these scenarios are meant to validate Polkadot/Kusama-specific bridge behavior, restore generated polkadot-local / kusama-local specs. Otherwise, rename or clearly scope the scenarios/documentation to reflect that they now run against rococo-local.
Moonbeam does not charge delivery fees. Previously, query_delivery_fees propagated an error from the generic AssetExchanger path, which implies unsupported or misconfigured behavior. Now it returns a successful zero-fee result so clients can treat Moonbeam like any other chain without special-casing an error path. Update the corresponding TypeScript tests to assert a successful response with an empty fee list.
044c83e to
55ab7f8
Compare
Addressed in 55ab7f8 |
Replace dangerous rococo-local fallback with proper chain specs generated from polkadot-fellows/runtimes at 422623dbf (SDK 2512-2). Restore chain_spec_path in zombienet bridge configs to match master.
Update BRIDGE_RELAY_VERSION to match the new substrate-relay built from parity-bridges-common branch moonbeam-polkadot-stable2512. Requires publishing a release at: moonbeam-foundation/parity-bridges-common @ moonbeam-polkadot-stable2512
Upgrade upload-artifact from v7 to v8 to match download-artifact v8 used within the same workflow run. Keep cross-run downloads (Twiggy target branch artifacts) at v7 to remain compatible with artifacts uploaded by the target branch's existing builds.
This reverts commit 53964b4.
- @polkadot/api, api-base, api-derive, rpc-provider, types, types-codec: 16.4.8 -> 16.5.4 - @polkadot/keyring, util, util-crypto: 13.5.6 -> 14.0.2 - @polkadot/apps-config: 0.165.1 -> 0.170.1
until reference-machine benchmarks are rerun
Summary
Upgrades all Polkadot SDK dependencies from
moonbeam-polkadot-stable2506tomoonbeam-polkadot-stable2512, along with the necessary adaptations across the node, runtime, precompiles, and tests.Related PRs
Changes
Dependency Upgrades
polkadot-sdkworkspace dependencies updated from branchmoonbeam-polkadot-stable2506→moonbeam-polkadot-stable2512moonbeam-polkadot-stable2506→moonbeam-polkadot-stable2512moonbeam-polkadot-stable2506→moonbeam-polkadot-stable2512pallet-author-slot-filterdependency toruntime/commonrocksdbfeature to Frontier dependenciesRuntime API Changes
execute_blockandcheck_inherentsnow use<Block as BlockT>::LazyBlockinstead ofBlockGetCoreSelectorApiimplementation (no longer required by the SDK)XcmPaymentApi::query_delivery_feesnow accepts an additionalasset_id: VersionedAssetIdparameter and usesAssetExchangerweigh_message()weight function topallet_xcmweights (moonbase, moonbeam, moonriver)Node Service Changes
cumulus_primitives_core::GetCoreSelectorApitrait bound from runtime API requirementsProposerwrapper with direct use ofProposerFactorycollator_peer_id: PeerIdparameter to collator/consensus startupParachainTracingExecuteBlocksupport via newtracing_execute_blockfield inspawn_tasksadditional_relay_keys→additional_relay_state_keysin lookahead collator paramsParachain Inherent Data Refactor
ParachainInherentDatasplit intoBasicParachainInherentData+InboundMessagesDataset_validation_datacall now takes separatedataandinbound_messages_dataparametersPrecompile Updates
SelectCoreconfig fromcumulus_pallet_parachain_system::Configin mock runtimes (crowdloan-rewards, relay-encoder)Weight Updates
cumulus_pallet_xcmp_queue::take_first_concatenated_xcmnow takes an: u32component parameter (all runtimes)Test Fixes
using_fake_author()toinitialize_pending_block()Relevant Upstream PRs (polkadot-sdk)
LazyBlocktype used inexecute_blockandcheck_inherentsParachainInherentDataintoBasicParachainInherentData+InboundMessagesData, adds offchain processing of inbound messagesCoreInfovia a digest to the runtime — moves core selection to collator side, removesGetCoreSelectorApi/SelectCoreSelectCoredigest — preparation for core selection reworkon_initializeafter each pallet — changes event ordering (explains shifted event indices in tests)collator_peer_idparameter to collator consensustrace_block: Support overwritingexecute_block— introducesParachainTracingExecuteBlockVersionedAssetIdinstead ofu32to specify asset for feestake_first_concatenated_xcm()improvements — addsnparameter to weight functionProposerwrapperCheckInherentslogicadditional_relay_keys→additional_relay_state_keysRelevant Moonkit PRs
[author-slot-filter]Addusing_fake_authorlogicRuntime API
Core::execute_blocksignature changed (#9480): Theexecute_blockruntime API now accepts<Block as BlockT>::LazyBlockinstead ofBlock. Extrinsics are lazily decoded, deferring deserialization until needed. The same applies tocheck_inherents. Downstream tools that call these APIs directly must be updated.GetCoreSelectorApiremoved (#9002, #8903): TheGetCoreSelectorApiruntime API and theSelectCoreconfig type oncumulus_pallet_parachain_system::Confighave been fully removed. Core selection is now handled on the collator side and forwarded to the runtime via a digest. Any runtime implementing this API or configuringSelectCoremust remove it.XcmPaymentApibumped to v2 (#9963, #10243):query_delivery_feesnow requires an additionalasset_id: VersionedAssetIdparameter, allowing fee estimation in non-native assets. The v1 signature is retained as#[changed_in(2)]. Clients querying delivery fees must pass the new parameter.Node / Collator
Proposerwrapper removed (#9869):cumulus_client_consensus_proposer::Proposerhas been removed. Usesc_basic_authorship::ProposerFactorydirectly.collator_peer_idnow required (#10145): Collator startup functions (start_consensus, lookahead params) now require aPeerIdparameter. The peer ID is sent via UMP for protocol-level identification.tracing_execute_blockfield added toSpawnTasksParams(#9871):sc_service::SpawnTasksParamsnow includes atracing_execute_blockfield. Parachains should passSome(Arc::new(ParachainTracingExecuteBlock::new(client)))to supporttrace_blockRPC.additional_relay_keysrenamed (#9262): The lookahead collator parameteradditional_relay_keyshas been renamed toadditional_relay_state_keys.Parachain Inherent Data
ParachainInherentDatasplit (#8860): The monolithicParachainInherentDatastruct has been split intoBasicParachainInherentData(validation data, relay chain state, collator peer ID, relay parent descendants) andInboundMessagesData(downward + horizontal messages). Theset_validation_datainherent call now takes both as separate parameters. This enables offchain pre-processing of inbound messages before passing them to the runtime.CheckInherentslogic removed (#9732): TheCheckInherentsparameter inregister_validate_blockhas been removed. Inherent validation is now handled viaConsensusHookand pallet logic. Runtimes no longer need to implementCheckInherents.Event Ordering
on_initializeweight after each pallet's execution rather than batching them. This emits an additional weight-related event early in the block, shifting all subsequent event indices by one. Any off-chain code or tests that reference events by index must be updated.Weights
take_first_concatenated_xcmsignature changed (#9539): The weight function now takes an: u32component parameter instead of being a zero-argument function. Weight implementations must be updated to match the new trait signature.pallet_xcm::WeightInfo::weigh_messageadded: A new required method on thepallet_xcm::WeightInfotrait. Custom weight implementations must add this function.