Skip to content

Upgrade Moonbeam to Polkadot SDK stable2512#3633

Merged
librelois merged 94 commits intomasterfrom
artur/moonbeam-polkadot-stable2512
Apr 2, 2026
Merged

Upgrade Moonbeam to Polkadot SDK stable2512#3633
librelois merged 94 commits intomasterfrom
artur/moonbeam-polkadot-stable2512

Conversation

@arturgontijo
Copy link
Copy Markdown
Contributor

@arturgontijo arturgontijo commented Jan 16, 2026

Summary

Upgrades all Polkadot SDK dependencies from moonbeam-polkadot-stable2506 to moonbeam-polkadot-stable2512, along with the necessary adaptations across the node, runtime, precompiles, and tests.

Related PRs

Changes

Dependency Upgrades

  • All polkadot-sdk workspace dependencies updated from branch moonbeam-polkadot-stable2506moonbeam-polkadot-stable2512
  • Moonkit updated from moonbeam-polkadot-stable2506moonbeam-polkadot-stable2512
  • Frontier (EVM) updated from moonbeam-polkadot-stable2506moonbeam-polkadot-stable2512
  • Added pallet-author-slot-filter dependency to runtime/common
  • Added rocksdb feature to Frontier dependencies

Runtime API Changes

  • execute_block and check_inherents now use <Block as BlockT>::LazyBlock instead of Block
  • Removed GetCoreSelectorApi implementation (no longer required by the SDK)
  • XcmPaymentApi::query_delivery_fees now accepts an additional asset_id: VersionedAssetId parameter and uses AssetExchanger
  • Added new weigh_message() weight function to pallet_xcm weights (moonbase, moonbeam, moonriver)

Node Service Changes

  • Removed cumulus_primitives_core::GetCoreSelectorApi trait bound from runtime API requirements
  • Replaced Proposer wrapper with direct use of ProposerFactory
  • Added collator_peer_id: PeerId parameter to collator/consensus startup
  • Added ParachainTracingExecuteBlock support via new tracing_execute_block field in spawn_tasks
  • Renamed additional_relay_keysadditional_relay_state_keys in lookahead collator params

Parachain Inherent Data Refactor

  • ParachainInherentData split into BasicParachainInherentData + InboundMessagesData
  • set_validation_data call now takes separate data and inbound_messages_data parameters
  • Updated all runtime test helpers (moonbase, moonbeam, moonriver) accordingly

Precompile Updates

  • Removed SelectCore config from cumulus_pallet_parachain_system::Config in mock runtimes (crowdloan-rewards, relay-encoder)
  • Removed unnecessary dummy precompile code insertion in proxy precompile tests

Weight Updates

  • cumulus_pallet_xcmp_queue::take_first_concatenated_xcm now takes a n: u32 component parameter (all runtimes)

Test Fixes

  • Adjusted event indices in multiple Moonwall TypeScript tests to account for upstream event ordering changes (proxy, author-mapping, balance, sudo, randomness, XCM payment API, storage-growth tests)
  • Fixed XCM mock tests (statemint/statemine-like configurations)
  • Added using_fake_author() to initialize_pending_block()

Relevant Upstream PRs (polkadot-sdk)

PR Description
#9480 Lazy decode block extrinsics — introduces LazyBlock type used in execute_block and check_inherents
#8860 XCMP and DMP improvements — splits ParachainInherentData into BasicParachainInherentData + InboundMessagesData, adds offchain processing of inbound messages
#9002 Forward CoreInfo via a digest to the runtime — moves core selection to collator side, removes GetCoreSelectorApi / SelectCore
#8903 ParachainSystem: Do not emit the SelectCore digest — preparation for core selection rework
#9756 FRAME: Register on_initialize after each pallet — changes event ordering (explains shifted event indices in tests)
#10145 Send PeerId via UMP — adds collator_peer_id parameter to collator consensus
#9871 trace_block: Support overwriting execute_block — introduces ParachainTracingExecuteBlock
#9963 Query delivery fees v2 — reworks XCM delivery fee querying
#10243 pallet-xcm: API changes to use VersionedAssetId instead of u32 to specify asset for fees
#9539 take_first_concatenated_xcm() improvements — adds n parameter to weight function
#9869 Remove deprecated/unused consensus code — removes Proposer wrapper
#9732 Remove the deprecated CheckInherents logic
#9662 Remove deprecated collator-related code in cumulus
#9262 Adds support for additional relay state keys in parachain validation data inherent — renames additional_relay_keysadditional_relay_state_keys

Relevant Moonkit PRs

PR Description
#89 Update to polkadot-sdk stable2512
#92 [author-slot-filter] Add using_fake_author logic
#86 Add slot based collator

⚠️ Breaking Changes ⚠️

Runtime API

  • Core::execute_block signature changed (#9480): The execute_block runtime API now accepts <Block as BlockT>::LazyBlock instead of Block. Extrinsics are lazily decoded, deferring deserialization until needed. The same applies to check_inherents. Downstream tools that call these APIs directly must be updated.

  • GetCoreSelectorApi removed (#9002, #8903): The GetCoreSelectorApi runtime API and the SelectCore config type on cumulus_pallet_parachain_system::Config have 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 configuring SelectCore must remove it.

  • XcmPaymentApi bumped to v2 (#9963, #10243): query_delivery_fees now requires an additional asset_id: VersionedAssetId parameter, 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

  • Proposer wrapper removed (#9869): cumulus_client_consensus_proposer::Proposer has been removed. Use sc_basic_authorship::ProposerFactory directly.

  • collator_peer_id now required (#10145): Collator startup functions (start_consensus, lookahead params) now require a PeerId parameter. The peer ID is sent via UMP for protocol-level identification.

  • tracing_execute_block field added to SpawnTasksParams (#9871): sc_service::SpawnTasksParams now includes a tracing_execute_block field. Parachains should pass Some(Arc::new(ParachainTracingExecuteBlock::new(client))) to support trace_block RPC.

  • additional_relay_keys renamed (#9262): The lookahead collator parameter additional_relay_keys has been renamed to additional_relay_state_keys.

Parachain Inherent Data

  • ParachainInherentData split (#8860): The monolithic ParachainInherentData struct has been split into BasicParachainInherentData (validation data, relay chain state, collator peer ID, relay parent descendants) and InboundMessagesData (downward + horizontal messages). The set_validation_data inherent call now takes both as separate parameters. This enables offchain pre-processing of inbound messages before passing them to the runtime.

  • CheckInherents logic removed (#9732): The CheckInherents parameter in register_validate_block has been removed. Inherent validation is now handled via ConsensusHook and pallet logic. Runtimes no longer need to implement CheckInherents.

Event Ordering

  • Event indices shifted by +1 (#9756): FRAME now registers on_initialize weight 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_xcm signature changed (#9539): The weight function now takes a n: u32 component parameter instead of being a zero-argument function. Weight implementations must be updated to match the new trait signature.

  • pallet_xcm::WeightInfo::weigh_message added: A new required method on the pallet_xcm::WeightInfo trait. Custom weight implementations must add this function.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 16, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request upgrades the codebase from moonbeam-polkadot-stable2506 to stable2512, including dependency updates across Polkadot SDK, Frontier, and Cumulus crates. Key changes include runtime API modifications (LazyBlock parameter types, removal of GetCoreSelectorApi), restructuring of parachain inherent data, addition of balance-related events and XCM weight functions, bridge relay timeout updates, and TypeScript API augmentations reflecting new event signatures and storage queries.

Changes

Cohort / File(s) Summary
Dependency Version Upgrades
Cargo.toml, Makefile, test/package.json
Updated moonbeam-polkadot-stable2506 to stable2512 across FRAME, SP, Substrate, Cumulus, Polkadot, bridge, and Moonkit crates. Bumped jsonrpsee from 0.24.7 to 0.24.10. Updated Polkadot and Chopsticks versions in Makefile and test packages. Enhanced curl download reliability with -f flag.
Workflow and Build Configuration
.github/workflows/build.yml, .github/workflows/weight-diff-report.yml, .gitignore, package.json, scripts/verify-licenses.sh
Added libclang-dev to apt dependencies for cargo-udeps. Filtered CSV rows in weight-diff report by Change Percent validity. Added .pi/ directory to .gitignore. Added empty pnpm config object to package.json. Added BSD-3-Clause OR GPL-2.0 license expression.
Core Runtime API Changes
runtime/common/src/apis.rs
Updated execute_block, check_inherents, and TryRuntime::execute_block to accept LazyBlock instead of Block. Removed GetCoreSelectorApi implementation. Modified XcmPaymentApi::query_delivery_fees to accept new _asset_id parameter with version conversion logic.
Parachain System Configuration
runtime/moonbase/src/lib.rs, runtime/moonbeam/src/lib.rs, runtime/moonriver/src/lib.rs, precompiles/.../src/mock.rs
Removed explicit SelectCore type assignments from cumulus_pallet_parachain_system::Config across all runtimes, deferring to pallet defaults.
Parachain Inherent Data Restructuring
runtime/moonbase/tests/common/mod.rs, runtime/moonbeam/tests/common/mod.rs, runtime/moonriver/tests/common/mod.rs
Changed parachain inherent data construction from single ParachainInherentData to BasicParachainInherentData plus separate InboundMessagesData struct in test helpers.
Weight Function Updates
runtime/moonbase/src/weights/cumulus_pallet_xcmp_queue.rs, runtime/moonbase/src/weights/pallet_xcm.rs, runtime/moonbeam/src/weights/cumulus_pallet_xcmp_queue.rs, runtime/moonbeam/src/weights/pallet_xcm.rs, runtime/moonriver/src/weights/cumulus_pallet_xcmp_queue.rs, runtime/moonriver/src/weights/pallet_xcm.rs
Added parametric weight calculation (n: u32) to take_first_concatenated_xcm. Added new weigh_message() method returning fixed 8_668_000 weight across all runtimes.
Bridge Runtime Weights
runtime/moonbeam/src/weights/bridge.rs, runtime/moonriver/src/weights/bridge.rs
Updated proof overhead methods (submit_finality_proof, submit_parachain_heads, receive_messages_*) to return non-zero weights using from_parts(0, ...) instead of Weight::zero().
Runtime Mock Configurations
precompiles/crowdloan-rewards/src/mock.rs, precompiles/relay-encoder/src/mock.rs, precompiles/proxy/src/tests.rs
Removed SelectCore assignments and EVM bytecode injection. Updated pallet_assets BenchmarkHelper to support ReserveId parameter.
Asset Reserve Configuration
runtime/moonbase/tests/xcm_mock/statemint_like.rs, runtime/moonbeam/tests/xcm_mock/statemint_like.rs, runtime/moonriver/tests/xcm_mock/statemine_like.rs, runtime/common/Cargo.toml
Added ReserveId type alias and extended BenchmarkHelper implementations for asset reserves. Updated Cargo.toml with pallet-author-slot-filter dependency and feature flags.
Signature and Primitive Updates
primitives/account/src/lib.rs, node/cli/src/command.rs
Added Eth variant handling in MultiSignature to EthereumSignature conversion. Updated account derivation to use polkadot_primitives::v9::AccountId.
Node Service and RPC Integration
node/service/src/lib.rs, node/service/src/lazy_loading/mod.rs, node/service/src/rpc.rs
Wired ParachainTracingExecuteBlock into service task spawning. Passed collator_peer_id and network peer identity to consensus. Removed GetCoreSelectorApi bounds. Removed graph parameter from Eth RPC construction. Changed RPC request logger limit to 1024.
TypeScript API Augmentations (moonbase)
typescript-api/src/moonbase/interfaces/augment-api-*.ts, typescript-api/src/moonbase/interfaces/registry.ts
Added new balance events (BurnedDebt, BurnedHeld, Held, MintedCredit, Released, TransferAndHold, TransferOnHold, Unexpected). Updated convictionVoting and proxy event signatures with new parameters. Updated Polkadot V8 primitives to V9. Removed xcmPaymentApi calls. Added new parachain system storage queries.
TypeScript API Augmentations (moonbeam)
typescript-api/src/moonbeam/interfaces/augment-api-*.ts, typescript-api/src/moonbeam/interfaces/registry.ts
Same balance, conviction voting, proxy event updates and Polkadot V8→V9 migrations as moonbase. Updated setValidationData transaction signature. Added Eth variant to crowdloan rewards signatures.
TypeScript API Augmentations (moonriver)
typescript-api/src/moonriver/interfaces/augment-api-*.ts, typescript-api/src/moonriver/interfaces/registry.ts
Same event and type updates as other runtimes. Transitioned parachain inherent data types from primitives to pallet structures.
Test Event Index Adjustments
test/suites/dev/.../test-*.ts
Updated event array indices across 15+ test files to reflect new event ordering from integration changes, adjusting assertion indices by +1 for system events and updating gas estimations.
Gas Estimation Updates
test/suites/dev/moonbase/test-randomness/test-randomness-*.ts, test/suites/dev/moonbase/test-storage-growth/test-precompile-storage-growth.ts
Updated inline snapshot expectations for estimated contract gas values based on weight function changes.
XCM Payment API Test Updates
test/suites/dev/moonbase/test-xcm-v4/test-xcm-payment-api.ts, test/suites/dev/moonbase/test-xcm-v5/test-xcm-payment-api.ts
Added VersionedAssetId parameter to queryDeliveryFees calls. Updated assertion logic for empty fee asset arrays.
Bridge and Zombienet Configuration
zombienet/integration-tests/bridges/environments/moonbeam-moonriver/bridge.sh, zombienet/specs/README.md, Makefile
Updated bridge relayer transaction mortality from 4 to 32. Updated Polkadot version to stable2512. Enhanced README with chain-spec-generator sourcing information.
Documentation
docs/cherry-picks/polkadot-sdk-stable2506.md, docs/cherry-picks/polkadot-sdk-stable2512.md
Added detailed cherry-pick ledgers for stable2506 and stable2512 releases across multiple repositories (polkadot-sdk, ethereum, evm, frontier, moonkit).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

This PR introduces substantial changes across multiple systems: runtime API signatures (LazyBlock transition, core selector removal), parachain inherent data restructuring, new balance events and weight functions, TypeScript API augmentations for three runtimes, dependency upgrades affecting numerous crates, and 15+ coordinated test updates. While some changes (test indices, similar weight updates) follow repetitive patterns, the breadth of heterogeneous modifications—combining runtime changes, node service wiring, TypeScript type systems, and test coordination—requires careful verification of interactions between components.

Possibly related PRs

Suggested labels

D9-needsaudit👮, agent-review

Suggested reviewers

  • manuelmauro
  • arturgontijo
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch artur/moonbeam-polkadot-stable2512

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 16, 2026

Moonbase Weight Difference Report

File Extrinsic Old New Change Percent
runtime/moonbase/src/weights/cumulus_pallet_xcmp_queue.rs take_first_concatenated_xcm 5.44us 4.02us -26.08%

Moonriver Weight Difference Report

File Extrinsic Old New Change Percent
runtime/moonriver/src/weights/cumulus_pallet_xcmp_queue.rs take_first_concatenated_xcm 5.76us 4.02us -30.18%

Moonbeam Weight Difference Report

File Extrinsic Old New Change Percent
runtime/moonbeam/src/weights/cumulus_pallet_xcmp_queue.rs take_first_concatenated_xcm 5.76us 4.02us -30.18%

@RomarQ RomarQ added dependencies Pull requests that update a dependency file B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes labels Jan 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 16, 2026

WASM runtime size check:

Compared to target branch

Moonbase runtime: 2056 KB (-44 KB) ✅

Moonbeam runtime: 2184 KB (-28 KB) ✅

Moonriver runtime: 2184 KB (-28 KB) ✅

Compared to latest release (runtime-4202)

Moonbase runtime: 2056 KB (+120 KB compared to latest release) ⚠️

Moonbeam runtime: 2184 KB (+152 KB compared to latest release) ⚠️

Moonriver runtime: 2184 KB (+152 KB compared to latest release) ⚠️

@arturgontijo arturgontijo force-pushed the artur/moonbeam-polkadot-stable2512 branch from a13b535 to ebc8ddd Compare January 16, 2026 22:13
# 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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 12, 2026

Coverage Report

@@                          Coverage Diff                           @@
##           master   artur/moonbeam-polkadot-stable2512      +/-   ##
======================================================================
- Coverage   77.14%                               77.11%   -0.03%     
  Files         389                                  389              
+ Lines       77176                                77223      +47     
======================================================================
+ Hits        59537                                59547      +10     
+ Misses      17639                                17676      +37     
Files Changed Coverage
/node/service/src/lib.rs 56.71% (-0.02%) 🔽
/node/service/src/rpc.rs 82.31% (-0.06%) 🔽
/precompiles/proxy/src/tests.rs 96.87% (-0.01%) 🔽
/primitives/account/src/lib.rs 62.93% (-0.55%) 🔽
/runtime/common/src/apis.rs 52.27% (-0.60%) 🔽
/runtime/moonbase/src/weights/cumulus_pallet_xcmp_queue.rs 68.33% (-1.16%) 🔽
/runtime/moonbase/src/weights/pallet_parachain_staking.rs 25.53% (+0.21%) 🔼
/runtime/moonbase/src/weights/pallet_xcm.rs 4.95% (-0.15%) 🔽
/runtime/moonbase/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs 46.51% (-6.12%) 🔽
/runtime/moonbase/tests/common/mod.rs 94.46% (+0.05%) 🔼
/runtime/moonbeam/src/weights/cumulus_pallet_xcmp_queue.rs 68.33% (-1.16%) 🔽
/runtime/moonbeam/src/weights/pallet_parachain_staking.rs 25.53% (+0.21%) 🔼
/runtime/moonbeam/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs 53.49% (-7.04%) 🔽
/runtime/moonbeam/tests/common/mod.rs 92.58% (+0.07%) 🔼
/runtime/moonriver/src/weights/cumulus_pallet_xcmp_queue.rs 68.33% (-1.16%) 🔽
/runtime/moonriver/src/weights/pallet_parachain_staking.rs 25.64% (+0.32%) 🔼
/runtime/moonriver/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs 53.49% (-7.04%) 🔽
/runtime/moonriver/tests/common/mod.rs 93.87% (+0.06%) 🔼

Coverage generated Thu Apr 2 10:23:40 UTC 2026

# 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
@manuelmauro manuelmauro self-assigned this Mar 9, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
runtime/moonriver/src/weights/bridge.rs (1)

22-54: ⚠️ Potential issue | 🟠 Major

Unblock the weight-diff job for this custom weight file.

The report job is already failing on this file with Could not find a weight implementation in the passed file, so the PR will stay red unless that parser is taught to handle these WeightInfoExt impls or this path is excluded from the report.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@runtime/moonriver/src/weights/bridge.rs` around lines 22 - 54, The
weight-diff parser fails because it expects concrete WeightInfo implementations
in this file but only finds the *WeightInfoExt impls (GrandpaWeightInfoExt,
ParachainsWeightInfoExt, MessagesWeightInfoExt). Add minimal/stub
implementations of the actual pallet WeightInfo traits for Runtime that the
report expects (e.g. impl super::pallet_bridge_grandpa::WeightInfo for Runtime {
fn submit_finality_proof(...) -> Weight {
Self::submit_finality_proof_overhead_from_runtime() /* or mirror existing
Weight::from_parts(...) */ } } and analogous impls for
super::pallet_bridge_parachains::WeightInfo and
super::pallet_bridge_messages::WeightInfo delegating to
expected_extra_storage_proof_size, submit_parachain_heads_overhead_from_runtime,
receive_messages_proof_overhead_from_runtime,
receive_messages_delivery_proof_overhead_from_runtime). This provides the
concrete symbols the parser needs while reusing the existing ext methods.
♻️ Duplicate comments (1)
docs/cherry-picks/polkadot-sdk-stable2512.md (1)

11-11: ⚠️ Potential issue | 🟡 Minor

Keep Upstream PR column PR-only for table consistency.

Line 11 and Line 56 still use commit links in Upstream PR. Move those commit refs to Note (or Commit) and leave Upstream PR empty until an actual PR exists.

🛠️ Suggested doc fix
-| Yes | Add storage benchmark --keys-limit option | [moonbeam-foundation/polkadot-sdk@3e68f82](https://github.com/moonbeam-foundation/polkadot-sdk/commit/3e68f824efd7347b2deeae21d3d8705a5a437382) | Included | Temporary | [moonbeam-foundation/polkadot-sdk@ef91563](https://github.com/moonbeam-foundation/polkadot-sdk/commit/ef915632fbda727583b13813417664ecefc000b8) | We don't need this cherry-pick anymore since the following upstream PR introduced the same behavior change: [paritytech/polkadot-sdk#7835](https://github.com/paritytech/polkadot-sdk/pull/7835/changes#diff-29eba3163978b333d93a2e7b3d0f3d3bafe2cc99891ebd0cc38d499bb80bb7a9R318) |
+| Yes | Add storage benchmark --keys-limit option | [moonbeam-foundation/polkadot-sdk@3e68f82](https://github.com/moonbeam-foundation/polkadot-sdk/commit/3e68f824efd7347b2deeae21d3d8705a5a437382) | Included | Temporary |  | Upstream candidate commit: [moonbeam-foundation/polkadot-sdk@ef91563](https://github.com/moonbeam-foundation/polkadot-sdk/commit/ef915632fbda727583b13813417664ecefc000b8). We don't need this cherry-pick anymore since the following upstream PR introduced the same behavior change: [paritytech/polkadot-sdk#7835](https://github.com/paritytech/polkadot-sdk/pull/7835/changes#diff-29eba3163978b333d93a2e7b3d0f3d3bafe2cc99891ebd0cc38d499bb80bb7a9R318) |
@@
-| Yes | Address POV Underestimations | [moonbeam-foundation/frontier@ad9361c](https://github.com/moonbeam-foundation/frontier/commit/ad9361cc6d031be86908ca69dc98ecb5fb12dd5d) | Included | Needs PR upstream | [moonbeam-foundation/frontier@fdfdb95](https://github.com/moonbeam-foundation/frontier/commit/fdfdb95057402ff35f69869339262a108ffccf94) | [MOON-3292](https://opslayer.atlassian.net/browse/MOON-3292) |
+| Yes | Address POV Underestimations | [moonbeam-foundation/frontier@ad9361c](https://github.com/moonbeam-foundation/frontier/commit/ad9361cc6d031be86908ca69dc98ecb5fb12dd5d) | Included | Needs PR upstream |  | Upstream candidate commit: [moonbeam-foundation/frontier@fdfdb95](https://github.com/moonbeam-foundation/frontier/commit/fdfdb95057402ff35f69869339262a108ffccf94). [MOON-3292](https://opslayer.atlassian.net/browse/MOON-3292) |

Also applies to: 56-56

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/cherry-picks/polkadot-sdk-stable2512.md` at line 11, The "Upstream PR"
column contains commit links instead of PRs for the row with "Add storage
benchmark --keys-limit option" (and the similar row at the second occurrence),
so edit the table rows to clear the "Upstream PR" cell (leave it empty) and move
the existing commit reference (e.g., moonbeam-foundation/polkadot-sdk@3e68f82
and moonbeam-foundation/polkadot-sdk@ef91563) into the "Note" or "Commit" column
instead; ensure the table header ("Upstream PR") stays PR-only and both affected
rows now show an empty Upstream PR cell with the commit refs relocated to the
Note/Commit column.
🧹 Nitpick comments (3)
.github/workflows/weight-diff-report.yml (1)

80-80: Defensive filtering improves robustness, but regex only validates prefix.

The filter select((.[4] // "") | test("^-?[0-9]")) correctly prevents tonumber failures on empty or clearly non-numeric values. However, the regex only validates that the string starts with an optional minus and digit—values like "5abc" would pass but could fail tonumber.

In practice, subweight output should be well-formed, and jq's tonumber is permissive with trailing content it can parse. This is acceptable for robustness against edge cases like malformed rows.

♻️ Optional: stricter regex for full validation

If stricter validation is desired:

-                  jq -R 'split(",") | select((.[4] // "") | test("^-?[0-9]")) | {File: .[0], Extrinsic: .[1], Old: .[2], New: .[3], "Change Percent": (.[4] | tonumber)}' ${diffs_csv} | jq -s '.' > ${diffs_json}
+                  jq -R 'split(",") | select((.[4] // "") | test("^-?[0-9]+(\\.[0-9]+)?$")) | {File: .[0], Extrinsic: .[1], Old: .[2], New: .[3], "Change Percent": (.[4] | tonumber)}' ${diffs_csv} | jq -s '.' > ${diffs_json}

This ensures the entire value matches a numeric pattern (integer or decimal).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/weight-diff-report.yml at line 80, The jq filter currently
uses select((.[4] // "") | test("^-?[0-9]")) which only checks the prefix and
can let through values like "5abc"; update the regex in that select expression
(in the jq pipeline that reads ${diffs_csv} and writes ${diffs_json}) to fully
validate numeric strings, e.g. replace the test pattern with a full-match
numeric regex such as "^-?[0-9]+(\\.[0-9]+)?$" so the field passed to tonumber
is strictly an integer or decimal before conversion.
test/suites/dev/moonbase/test-xcm-v5/test-xcm-payment-api.ts (1)

150-162: This only validates the zero-fee fallback.

With the new asset_id parameter, queryDeliveryFees can still return Ok([]) here even if the third argument is ignored or decoded incorrectly, because this path short-circuits when no delivery-fee config exists. Please add one case where delivery fees are configured/non-zero, or otherwise vary asset_id and assert the result changes, so the new API wiring is actually exercised.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/suites/dev/moonbase/test-xcm-v5/test-xcm-payment-api.ts` around lines
150 - 162, Current test only checks the zero-fee fallback and doesn't exercise
the new asset_id handling in polkadotJs.call.xcmPaymentApi.queryDeliveryFees;
add an additional test case that sets up a destination with a non-zero
delivery-fee configuration (or vary the asset_id argument passed to
queryDeliveryFees) and assert that deliveryFees.isOk is true and the returned
fee assets array is non-empty or changes based on the asset_id. Specifically,
locate the call to queryDeliveryFees (variables dest and xcmMessage) and add a
case where the third argument encodes a valid asset_id or the chain is
configured with delivery fees so the result is non-zero, then assert
feeAssets.length > 0 (or that feeAssets differs between asset_id values) to
ensure the new API wiring is exercised.
node/service/src/lib.rs (1)

1015-1035: Consider collapsing start_consensus inputs into a local params struct.

The new collator_peer_id pushes an already long positional argument list even further. A small local struct would make future SDK bumps safer and reduce call-site miswiring.

Also applies to: 1041-1063

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@node/service/src/lib.rs` around lines 1015 - 1035, The call to
start_consensus::<RuntimeApi, _>(...) has grown a long positional argument list
(now including the collator peer id) and is error-prone; extract those
parameters into a small local struct (e.g., StartConsensusParams or
StartConsensusConfig) that contains fields for backend, client, block_import,
prometheus_registry, telemetry handle, task_manager, relay_chain_interface,
transaction_pool, keystore, para_id, collator_peer_id (from
collator_key.expect(...) / network.local_peer_id()), overseer_handle,
announce_block, force_authoring, relay_chain_slot_duration,
block_authoring_duration, sync_service, node_extra_args, etc., populate that
struct at the call site, and pass the struct (or its reference) into
start_consensus::<RuntimeApi, _>(...) instead of the long positional list; apply
the same refactor for the other call site around 1041-1063 to keep both sites
consistent and reduce miswiring risk.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@runtime/common/src/apis.rs`:
- Around line 787-800: The zero-fee branch in query_delivery_fees currently
validates destination and message but ignores the asset_id parameter; add the
same versioned-to-latest conversion/validation for the VersionedAssetId
parameter (the _asset_id passed into query_delivery_fees) and map conversion
failures to XcmPaymentApiError::VersionedConversionFailed so the function
returns an error if asset_id cannot be converted, keeping the zero-fee semantics
only after all three versioned inputs are validated.

In `@runtime/moonbase/src/weights/cumulus_pallet_xcmp_queue.rs`:
- Around line 192-202: The take_first_concatenated_xcm(n: u32) Weight
implementation is marked TODO and currently uses a provisional per-item
multiplier that may undercharge; replace the approximate formula with a
conservative upper-bound calculation (use the documented max component n = 92)
by computing the weight using saturating_mul(92) (or otherwise multiply the
per-item term by 92) and add a safety margin to the base Weight, update the
comment to remove the TODO and note that this is a conservative worst-case bound
until proper benchmarking is available, and keep references to the same function
name (take_first_concatenated_xcm) and the per-item term (the
saturating_add(Weight::from_parts(17_448, 0).saturating_mul(...))) so reviewers
can easily find the change.

In `@runtime/moonbeam/src/weights/cumulus_pallet_xcmp_queue.rs`:
- Around line 192-202: The weight function take_first_concatenated_xcm currently
contains a TODO and an approximate linear formula
(saturating_add(...saturating_mul(n.into()))) which may undercharge XCMP queue;
replace this provisional formula with a conservative upper-bound weight—e.g.,
compute the worst-case by multiplying the per-component cost by the documented
maximum component count (92) or return a fixed upper-bound Weight that covers
all expected inputs, and remove the TODO; update the Weight::from_parts
expressions in take_first_concatenated_xcm to use that conservative value so the
runtime never underestimates the cost.

In `@runtime/moonriver/src/weights/cumulus_pallet_xcmp_queue.rs`:
- Around line 192-202: The weight implementation for take_first_concatenated_xcm
is marked as a TODO and currently uses an approximate per-item multiplier;
replace this provisional formula with a conservative upper-bound calculation:
treat n as its maximum allowed value (92) and compute the weight using that
worst-case n so the runtime never undercharges (update the saturating_mul use to
multiply by 92), remove the TODO comment, and add a short comment explaining
this is a conservative temporary upper bound until proper benchmarks produce the
exact formula.

In `@typescript-api/src/moonbase/interfaces/augment-api-events.ts`:
- Around line 388-395: The JSDoc for the conviction-voting events is stale:
update the comments for Delegated and Undelegated to match their actual payload
shapes (Delegated now carries [who, target, u16]—add the conviction/u16 to the
Delegated doc; Undelegated carries [account, u16]—mention the conviction/u16 in
that doc), and make this change in the upstream event documentation/source that
generates this file (so the regenerated augment-api-events.ts contains the
corrected JSDoc for Delegated and Undelegated).

In `@typescript-api/src/moonbeam/interfaces/augment-api-runtime.ts`:
- Line 9: The auto-generated augment-api-runtime.ts is missing the xcmPaymentApi
namespace (used by queryAcceptablePaymentAssets, queryWeightToAssetFee,
queryXcmWeight, queryDeliveryFees), so update the type generation or add a
manual augmentation: re-run or adjust yarn polkadot-types-from-chain to capture
stable2512 xcmPaymentApi signatures, or, if the generator cannot, add a typed
namespace declaration for xcmPaymentApi in augment-api-runtime.ts matching the
runtime API signatures (declare namespace xcmPaymentApi with the four query
methods and correct parameter/return types) so tests no longer need as any
assertions; ensure the change targets the functions
queryAcceptablePaymentAssets, queryWeightToAssetFee, queryXcmWeight, and
queryDeliveryFees.

---

Outside diff comments:
In `@runtime/moonriver/src/weights/bridge.rs`:
- Around line 22-54: The weight-diff parser fails because it expects concrete
WeightInfo implementations in this file but only finds the *WeightInfoExt impls
(GrandpaWeightInfoExt, ParachainsWeightInfoExt, MessagesWeightInfoExt). Add
minimal/stub implementations of the actual pallet WeightInfo traits for Runtime
that the report expects (e.g. impl super::pallet_bridge_grandpa::WeightInfo for
Runtime { fn submit_finality_proof(...) -> Weight {
Self::submit_finality_proof_overhead_from_runtime() /* or mirror existing
Weight::from_parts(...) */ } } and analogous impls for
super::pallet_bridge_parachains::WeightInfo and
super::pallet_bridge_messages::WeightInfo delegating to
expected_extra_storage_proof_size, submit_parachain_heads_overhead_from_runtime,
receive_messages_proof_overhead_from_runtime,
receive_messages_delivery_proof_overhead_from_runtime). This provides the
concrete symbols the parser needs while reusing the existing ext methods.

---

Duplicate comments:
In `@docs/cherry-picks/polkadot-sdk-stable2512.md`:
- Line 11: The "Upstream PR" column contains commit links instead of PRs for the
row with "Add storage benchmark --keys-limit option" (and the similar row at the
second occurrence), so edit the table rows to clear the "Upstream PR" cell
(leave it empty) and move the existing commit reference (e.g.,
moonbeam-foundation/polkadot-sdk@3e68f82 and
moonbeam-foundation/polkadot-sdk@ef91563) into the "Note" or "Commit" column
instead; ensure the table header ("Upstream PR") stays PR-only and both affected
rows now show an empty Upstream PR cell with the commit refs relocated to the
Note/Commit column.

---

Nitpick comments:
In @.github/workflows/weight-diff-report.yml:
- Line 80: The jq filter currently uses select((.[4] // "") | test("^-?[0-9]"))
which only checks the prefix and can let through values like "5abc"; update the
regex in that select expression (in the jq pipeline that reads ${diffs_csv} and
writes ${diffs_json}) to fully validate numeric strings, e.g. replace the test
pattern with a full-match numeric regex such as "^-?[0-9]+(\\.[0-9]+)?$" so the
field passed to tonumber is strictly an integer or decimal before conversion.

In `@node/service/src/lib.rs`:
- Around line 1015-1035: The call to start_consensus::<RuntimeApi, _>(...) has
grown a long positional argument list (now including the collator peer id) and
is error-prone; extract those parameters into a small local struct (e.g.,
StartConsensusParams or StartConsensusConfig) that contains fields for backend,
client, block_import, prometheus_registry, telemetry handle, task_manager,
relay_chain_interface, transaction_pool, keystore, para_id, collator_peer_id
(from collator_key.expect(...) / network.local_peer_id()), overseer_handle,
announce_block, force_authoring, relay_chain_slot_duration,
block_authoring_duration, sync_service, node_extra_args, etc., populate that
struct at the call site, and pass the struct (or its reference) into
start_consensus::<RuntimeApi, _>(...) instead of the long positional list; apply
the same refactor for the other call site around 1041-1063 to keep both sites
consistent and reduce miswiring risk.

In `@test/suites/dev/moonbase/test-xcm-v5/test-xcm-payment-api.ts`:
- Around line 150-162: Current test only checks the zero-fee fallback and
doesn't exercise the new asset_id handling in
polkadotJs.call.xcmPaymentApi.queryDeliveryFees; add an additional test case
that sets up a destination with a non-zero delivery-fee configuration (or vary
the asset_id argument passed to queryDeliveryFees) and assert that
deliveryFees.isOk is true and the returned fee assets array is non-empty or
changes based on the asset_id. Specifically, locate the call to
queryDeliveryFees (variables dest and xcmMessage) and add a case where the third
argument encodes a valid asset_id or the chain is configured with delivery fees
so the result is non-zero, then assert feeAssets.length > 0 (or that feeAssets
differs between asset_id values) to ensure the new API wiring is exercised.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 51d66b67-884b-40a6-a728-eb18f5219dc3

📥 Commits

Reviewing files that changed from the base of the PR and between 3410bb0 and 9219dd6.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (80)
  • .github/workflows/build.yml
  • .github/workflows/weight-diff-report.yml
  • .gitignore
  • Cargo.toml
  • Makefile
  • docs/cherry-picks/polkadot-sdk-stable2506.md
  • docs/cherry-picks/polkadot-sdk-stable2512.md
  • node/cli/src/command.rs
  • node/service/src/lazy_loading/mod.rs
  • node/service/src/lib.rs
  • node/service/src/rpc.rs
  • package.json
  • precompiles/crowdloan-rewards/src/mock.rs
  • precompiles/proxy/src/tests.rs
  • precompiles/relay-encoder/src/mock.rs
  • primitives/account/src/lib.rs
  • runtime/common/Cargo.toml
  • runtime/common/src/apis.rs
  • runtime/moonbase/src/lib.rs
  • runtime/moonbase/src/weights/cumulus_pallet_xcmp_queue.rs
  • runtime/moonbase/src/weights/pallet_xcm.rs
  • runtime/moonbase/tests/common/mod.rs
  • runtime/moonbase/tests/xcm_mock/statemint_like.rs
  • runtime/moonbeam/src/lib.rs
  • runtime/moonbeam/src/weights/bridge.rs
  • runtime/moonbeam/src/weights/cumulus_pallet_xcmp_queue.rs
  • runtime/moonbeam/src/weights/pallet_xcm.rs
  • runtime/moonbeam/tests/common/mod.rs
  • runtime/moonbeam/tests/xcm_mock/statemint_like.rs
  • runtime/moonriver/src/lib.rs
  • runtime/moonriver/src/weights/bridge.rs
  • runtime/moonriver/src/weights/cumulus_pallet_xcmp_queue.rs
  • runtime/moonriver/src/weights/pallet_xcm.rs
  • runtime/moonriver/tests/common/mod.rs
  • runtime/moonriver/tests/xcm_mock/statemine_like.rs
  • scripts/verify-licenses.sh
  • test/package.json
  • test/suites/dev/common/test-proxy/test-proxy-author-mapping.ts
  • test/suites/dev/common/test-proxy/test-proxy-balance.ts
  • test/suites/dev/moonbase/test-author/test-author-failed-association.ts
  • test/suites/dev/moonbase/test-author/test-author-missing-deposit-fail.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-balance/test-balance-extrinsics.ts
  • test/suites/dev/moonbase/test-polkadot-js/test-polkadot-api.ts
  • test/suites/dev/moonbase/test-randomness/test-randomness-babe-lottery2.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-randomness/test-randomness-vrf-lottery5.ts
  • test/suites/dev/moonbase/test-storage-growth/test-precompile-storage-growth.ts
  • test/suites/dev/moonbase/test-sudo/test-sudo.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
  • typescript-api/src/moonbase/interfaces/augment-api-events.ts
  • typescript-api/src/moonbase/interfaces/augment-api-query.ts
  • typescript-api/src/moonbase/interfaces/augment-api-runtime.ts
  • typescript-api/src/moonbase/interfaces/augment-api-tx.ts
  • typescript-api/src/moonbase/interfaces/lookup.ts
  • typescript-api/src/moonbase/interfaces/registry.ts
  • typescript-api/src/moonbase/interfaces/types-lookup.ts
  • typescript-api/src/moonbeam/interfaces/augment-api-events.ts
  • typescript-api/src/moonbeam/interfaces/augment-api-query.ts
  • typescript-api/src/moonbeam/interfaces/augment-api-runtime.ts
  • typescript-api/src/moonbeam/interfaces/augment-api-tx.ts
  • typescript-api/src/moonbeam/interfaces/lookup.ts
  • typescript-api/src/moonbeam/interfaces/registry.ts
  • typescript-api/src/moonbeam/interfaces/types-lookup.ts
  • typescript-api/src/moonriver/interfaces/augment-api-events.ts
  • typescript-api/src/moonriver/interfaces/augment-api-query.ts
  • typescript-api/src/moonriver/interfaces/augment-api-runtime.ts
  • typescript-api/src/moonriver/interfaces/augment-api-tx.ts
  • typescript-api/src/moonriver/interfaces/lookup.ts
  • typescript-api/src/moonriver/interfaces/registry.ts
  • typescript-api/src/moonriver/interfaces/types-lookup.ts
  • zombienet/integration-tests/bridges/environments/moonbeam-moonriver/bridge.sh
  • zombienet/specs/README.md
  • zombienet/specs/kusama-local.json
  • zombienet/specs/polkadot-local.json
💤 Files with no reviewable changes (7)
  • node/service/src/rpc.rs
  • precompiles/proxy/src/tests.rs
  • precompiles/relay-encoder/src/mock.rs
  • precompiles/crowdloan-rewards/src/mock.rs
  • runtime/moonriver/src/lib.rs
  • runtime/moonbeam/src/lib.rs
  • runtime/moonbase/src/lib.rs

Comment thread runtime/common/src/apis.rs
Comment thread runtime/moonbase/src/weights/cumulus_pallet_xcmp_queue.rs Outdated
Comment thread runtime/moonbeam/src/weights/cumulus_pallet_xcmp_queue.rs Outdated
Comment thread runtime/moonriver/src/weights/cumulus_pallet_xcmp_queue.rs Outdated
Comment thread typescript-api/src/moonbase/interfaces/augment-api-events.ts
Comment thread typescript-api/src/moonbeam/interfaces/augment-api-runtime.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Mar 31, 2026
librelois
librelois previously approved these changes Mar 31, 2026
Comment thread Makefile Outdated
manuelmauro
manuelmauro previously approved these changes Mar 31, 2026
@librelois librelois dismissed stale reviews from manuelmauro, coderabbitai[bot], and themself via e173c13 April 1, 2026 09:20
librelois
librelois previously approved these changes Apr 1, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 1, 2026
@librelois librelois merged commit 046f282 into master Apr 2, 2026
73 of 76 checks passed
@librelois librelois deleted the artur/moonbeam-polkadot-stable2512 branch April 2, 2026 10:55
@arturgontijo arturgontijo mentioned this pull request Apr 6, 2026
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants