Skip to content

Chore update polkadot-sdk to stable2603 - #3746

Merged
manuelmauro merged 70 commits into
masterfrom
chore-update-polkadot-sdk-stable2603
Jul 9, 2026
Merged

manuelmauro merged 70 commits into
masterfrom
chore-update-polkadot-sdk-stable2603

Conversation

@manuelmauro

@manuelmauro manuelmauro commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

What does it do?

Upgrades polkadot-sdk — and the frontier / evm / ethereum / moonkit forks — from stable2512 to stable2603 (upstream tag polkadot-stable2603-1, released 2026-05-01).

Concretely:

  • Dependency pins + lockfile. Cargo.toml swaps moonbeam-polkadot-stable2512 → moonbeam-polkadot-stable2603 across all five forks (~180 occurrences); Cargo.lock re-resolved.
  • XCM credit-based holding migration — the substantive piece. stable2603 reworked xcm_executor::AssetsInHolding to carry real fungible::Credit imbalances instead of plain Asset descriptors. The TransactAsset, WeightTrader, and FeeManager::handle_fee impls were migrated accordingly:
    • erc20-xcm-bridge and moonbeam-foreign-assets gain a notional.rs notional-credit type (erc20 is an EVM-side balance, not a Substrate fungible, so it has no real Credit; the token movement still happens via EVM calls in withdraw_asset/deposit_asset, and the notional credit only threads the asset through holding).
    • xcm-weight-trader reworks buy_weight / refund_weight / Drop for the credit model; mint_asset is now implemented in moonbeam-foreign-assets.
  • API drift fixes to compile green across the realistic feature matrix (default / runtime-benchmarks / try-runtime): RuntimeDebug → Debug (51 sites / 14 files, upstream #10582); proof-recording refactor and removal of cumulus-client-consensus-proposer in the lazy-loading manual-seal (upstream #9947); node/service client-side drift; new cumulus_pallet_parachain_system::WeightInfo methods added to weight files; runtime-API and XCM-config signature changes (see Breaking Changes).
  • Regenerated TypeScript API types and updated the dev / XCM TS test fixtures for the new relay and credit-model XCM events.
  • Docs: adds the cherry-pick tracker polkadot-sdk-stable2603.md and the working upgrade plan UPGRADE-stable2603.md.

What important points should reviewers know?

  • Fork branches. Each fork has a fresh moonbeam-polkadot-stable2603 branch with the moonbeam-only cherry-picks re-applied. Bases: polkadot-sdk from the polkadot-stable2603-1 tag (rebased onto upstream/stable2603 head to absorb 4 backports); frontier from the official upstream/stable2603 (cut after our DIY base-bump landed upstream as polkadot-evm/frontier#1892); evm stays on the 0.43.x line; ethereum off upstream/master.
  • moonkit base-bump merged + reconciled. Moonsong-Labs/moonkit#95 merged to main on 2026-06-18 (squash). The moonbeam-polkadot-stable2603 release branch was rebased onto main — now main + a single dep-redirect commit (head 9d71129) — and Cargo.lock re-pinned to it; the resulting tree is identical to the pre-merge interim branch.
  • No [patch.crates-io] — the fork branches resolve directly from the moonbeam-foundation (and Moonsong-Labs for moonkit) remotes.
  • --all-features is NOT a valid check for moonbeam. It forces the mutually-exclusive disable-genesis-builder feature on, which strips genesis_config_preset (needed by the node's chain_spec). Verification uses the realistic feature matrix (default / runtime-benchmarks / try-runtime).
  • Scope of this PR. It gets the workspace compiling green, the dev/integration fixtures updated, and includes the one required storage migration (xcmp-queue v6, below). No spec_version bump and no weight regeneration are included — those are deliberately deferred (see follow-ups). Reviewers should treat this as the dependency/API-drift layer plus that single required migration.
  • One required StorageVersion migration is included: cumulus-pallet-xcmp-queue v5 → v6. Surfaced by an upstream-repo STORAGE_VERSION audit — easy to miss (the pallet declares the version in src/migration/mod.rs, not lib.rs) and a lazy-loading dry-run masked it (it set XcmpQueue to v6 as a "new pallet" rather than migrating). It corresponds to upstream polkadot-sdk#11263 (ConcatenatedOpaqueVersionedXcm negotiation), which adds a per-channel flags field to OutboundChannelDetails. MigrateV5ToV6 is a standalone VersionedMigration the pallet does not auto-run — every upstream parachain runtime (asset-hub, bridge-hub) wires it explicitly — and moonbeam's migration lists were empty, so without it on-chain v5 OutboundXcmpStatus would fail to decode against the v6 layout and silently drop outbound-channel state. Wired as cumulus_pallet_xcmp_queue::migration::v6::MigrateV5ToV6<Runtime> in UnreleasedSingleBlockMigrations (runtime/common/src/migrations.rs), made Runtime-generic so one definition covers all three runtimes. It is self-guarding (VersionedMigration<5,6>: no-op unless on-chain is exactly v5), the xcmp_queue::Config trait is unchanged (no new runtime support needed), and the new format negotiation is backward-compatible (flags default empty). A test (xcmp_queue_v5_to_v6_migration_is_wired_and_runs) runs the runtime's actual wired migration set and asserts v5→v6 on moonbase/moonriver/moonbeam; the migration's own pre/post try_state is covered by the deferred CI run. Reviewers: this is the one runtime-behavior-affecting change here — please confirm the wiring and that UnreleasedSingleBlockMigrations (reached via frame_system::Config::SingleBlockMigrations) is the right home.
  • Audit-recovered cherry-picks — please verify equivalence. A source-of-truth audit against the moonbeam-polkadot-stable2512 fork branches surfaced cherry-picks present on 2512 but missing from this 2603 cycle; they are applied here. Three are moonbeam-authored polkadot-sdk node patches re-applied with manual conflict resolution, so reviewers should confirm each is equivalent to its original stable2512 commit: DNS multiaddr filtering (09e2fee3c → f35e2dd), txpool hard-timeout during block authorship (997cc6b → a668034), and the --force-empty-blocks emergency flag (4a9db14 → 11a87af). The latter two are semantic re-ports onto the stable2603 proposer refactor (BuildBlockAndImportParams call API, removed PR proof-recording generic), so they are the most important to check; cargo check on the affected crates passes and the upstreamed --force-empty-blocks unit test passes. The original→re-applied mapping is documented in docs/cherry-picks/polkadot-sdk-stable2512.md and polkadot-sdk-stable2603.md.
  • EVM-asset XCM holding uses a shared notional credit. stable2603's AssetsInHolding stores real fungible::Credit imbalances instead of Asset descriptors, so the TransactAsset signatures changed (withdraw_asset/deposit_asset/mint_asset/internal_transfer_asset). EVM-contract assets have no Substrate fungible and therefore no real Credit, so both erc20-xcm-bridge and moonbeam-foreign-assets represent the amount in holding with the shared, side-effect-free xcm_primitives::NotionalImbalance (an exact mirror of the executor's own MockCredit; consolidated into xcm-primitives in this PR so the two pallets share one definition). The real token movement still happens via EVM, not the credit: erc20-xcm-bridge traces the origin in XcmHoldingErc20sOrigins and defers a single transfer to deposit_asset; moonbeam-foreign-assets burns in withdraw_asset and mints in deposit_asset. Reviewers: the notional credit is pure executor-side bookkeeping (no balance/issuance effects) — correct precisely because these assets have no Substrate issuance to resolve. For erc20-xcm-bridge, erc20 is also filtered out of the asset trap on drop_assets, so claim_assets delegates unchanged.

Is there something left for follow-up PRs?

Yes — the remaining release-time / CI phases:

  • Runtime weights (Phase 4): re-run pallet benchmarks on reference hardware and regenerate weights for the release. Analysis here found no functional weight-signature changes — the only weight-file diff is three Weight::zero() stubs that cumulus_pallet_parachain_system::WeightInfo gained for the DynamicMaxBlockWeight tx-extension, which moonbeam does not wire in — so this is release hygiene, not a correctness blocker. (spec_version is bumped by the separate release process, not this upgrade.)
  • Bridge maintenance (Phase 5): rebuild substrate-relay against stable2603, regenerate zombienet relay chain specs, and run the bridge integration tests.
  • CI verification (Phase 6): full try-runtime --checks all (try_state) against production state for moonbase / moonriver / moonbeam, smoke tests, and zombienet XCM cross-chain scenarios — these need CI/archive infra (a local public-RPC state scrape is impractical). Already verified locally: the cargo check matrix (default / runtime-benchmarks / try-runtime), cargo test --workspace (1347 pass), the upgrade-touched dev TS fixtures, and a lazy-loading runtime-upgrade dry-run against live moonbeam mainnet state.

Resolved since this PR opened (no longer follow-ups):

  • Storage migrations ✅ — an upstream-repo StorageVersion audit found the one required migration (cumulus-pallet-xcmp-queue v5→v6); it is wired and tested in this PR (see What important points should reviewers know?).
  • moonkit reconciliation ✅ — moonkit#95 merged to main; the release branch was rebased onto it and Cargo.lock re-pinned.
  • Cherry-pick tracker verification (Phase 2) ✅ — frontier + polkadot-sdk rows verified against upstream/stable2603 (all prior Verify/TBD rows confirmed; one missing polkadot-sdk row added, one cited SHA corrected) in polkadot-sdk-stable2603.md.

What alternative implementations were considered?

  • frontier base — wait vs. DIY. polkadot-evm/frontier had not cut stable2603 when this started. Rather than block, we did the base-bump ourselves; it was then opened upstream (#1892) and squash-merged, after which upstream cut stable2603. We rebased onto the official branch and dropped the DIY one.
  • moonkit base — wait vs. author + interim branch. No upstream base-bump existed, so we authored #95 and cut an interim release branch off its head to unblock moonbeam Phase 3, rather than waiting for the PR to merge first.
  • evm — stay on 0.43.x vs. move to v1.0. rust-ethereum/evm upstream has moved to v1.0; we stay on the 0.43.x fork (the stable2603 branch is effectively a rename of stable2512). Moving to v1.0 was rejected as out of scope — any new upstream EIP/gas work must be backported onto 0.43.x instead.
  • erc20 in the credit model — real Credit vs. notional credit. erc20 tokens are EVM-side balances with no Substrate fungible::Credit to hold. Mirroring the executor's own MockCredit, a notional amount-only credit threads the asset through holding while the real token movement stays in the EVM withdraw_asset/deposit_asset calls.

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

Upstream changes that drove this work:

  • polkadot-sdk: #9947 (proof-recording refactor; removed cumulus-client-consensus-proposer), #10582 (RuntimeDebug removal). Backports absorbed via rebase: #11964, #11856, #11987, #12017.
  • frontier: #1892 (the base-bump we authored, merged upstream → stable2603 cut). Numerous prior moonbeam cherry-picks are now inherited from upstream/stable2603 (EIP-7939/7883/7823/7825, several eth_* RPC correctness fixes, etc.) — full reconciliation in the tracker.
  • moonkit: #95 (base-bump, open), with #92 and #94 already inherited from main.
  • evm: rust-ethereum/evm#400 (EIP-7939 CLZ, inherited from the 0.43.x base), plus #405 (stale delegation.rs test fix, upstreamed).
  • ethereum: rust-ethereum/ethereum#77 (encoded-length methods, still carried as a cherry-pick).

Per-fork branch + cherry-pick detail lives in docs/cherry-picks/polkadot-sdk-stable2603.md.

What value does it bring to the blockchain users?

Keeping Moonbeam current with the latest polkadot-sdk stable line is what lets users benefit from upstream security fixes, performance improvements, and new protocol features, and keeps the maintenance gap to upstream small. The frontier upgrade also folds in a batch of EVM-RPC correctness fixes (block-resolution, receipt-race, and eth_* consistency fixes now inherited from upstream) and additional Osaka-era EIP support. The user-facing runtime impact is realized once the follow-up Phase 4 work (version bump + weights + migrations) ships; this PR is the dependency/API-drift foundation that work builds on.

⚠️ Breaking Changes ⚠️

This upgrades polkadot-sdk (and the frontier/evm/ethereum/moonkit forks) from stable2512 to stable2603. Besides the internal API churn, the following are externally-visible breaking changes:

  • SessionKeys runtime API → V2. generate_session_keys now takes an owner argument and returns OpaqueGeneratedSessionKeys instead of Vec<u8>. Tooling that calls the runtime API directly to rotate/generate session keys must be updated.
  • EthereumRuntimeRPCApi::call signature change. It gained a Geth-style state_override parameter (API version bump). Code calling the Ethereum runtime API directly (custom eth_call/tracing tooling) must pass the new argument.
  • EVM pallet_evm::Runner::call gained a state_override argument (frontier). Any integration building EVM calls against the Runner trait must update.
  • XCM AssetsInHolding redesign. The XCM executor now tracks real fungible::Credit imbalances instead of Asset descriptors. The TransactAsset (deposit_asset/withdraw_asset/internal_transfer_asset), WeightTrader (buy_weight/refund_weight), and FeeManager::handle_fee signatures changed; custom XCM asset transactors / weight traders must migrate.
  • RuntimeDebug removed from sp_core/sp_runtime/frame_support (use Debug). Downstream crates depending on moonbeam/runtime types must adjust.
  • Proof-recording refactor. sp_consensus::Proposer lost its Proof associated type and cumulus-client-consensus-proposer was removed; manual-seal / dev-service tooling relying on these must update.

One required storage migration is introduced — cumulus-pallet-xcmp-queue v5 → v6 (see "What important points should reviewers know?"). No spec_version bump or weight regeneration is included; those remain follow-up (Phase 4) work.

Draft tracker carries forward Included rows from stable2512 with TBD
commit hashes; rows whose upstream PR is expected to be in stable2603
are pre-marked Dropped pending merge-base verification. UPGRADE doc is
a temporary checklist covering forks, moonbeam Cargo.toml swap,
benchmarks, bridge regen, migrations, and verification.
Resolved upstream bases for polkadot-sdk, evm, ethereum. Two new
blockers: polkadot-evm/frontier has not branched stable2603 yet, and
Moonsong-Labs/moonkit has no stable2603 base-bump PR. Also noted
frontier #1856 is now in upstream/master (tracker said "PR not
merged"); needs correction during verification.
We will author the upstream base-bump PRs ourselves rather than wait
on polkadot-evm/frontier and Moonsong-Labs/moonkit. Adds Phase 1.4a
(moonkit) and Phase 1.5a (frontier) covering the upstream branches we
own, and notes the rebase plan once polkadot-evm cuts an official
frontier stable2603.
Branch moonbeam-polkadot-stable2603 pushed with 4 cherry-picks on top
of polkadot-stable2603-1. Three previously-Included rows were verified
to be in stable2603 upstream and are now Dropped in the tracker:
charge_transaction_payment benchmark fix (#10444), storage benchmark
--keys-limit, and pallet-revive removal from pallet-xcm.

PrecompileWasmCmd needed an adaptation for stable2603's
BackendRuntimeCode::new(state, TryPendingCode) signature change.
@manuelmauro manuelmauro self-assigned this May 8, 2026
@manuelmauro manuelmauro added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited breaking Needs to be mentioned in breaking changes XCM Run option xcm-emulator tests labels May 8, 2026
@coderabbitai

coderabbitai Bot commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

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

Bumps workspace git pins to moonbeam-polkadot-stable2603; migrates XCM TransactAsset APIs to AssetsInHolding with NotionalImbalance; updates runtime/EVM call signatures, node lazy-loading/manual-seal wiring, XCM executor configs, mocks, derives, and tests.

Changes

Stable2603 Upgrade & XCM Asset Holding Migration

Layer / File(s) Summary
Dependency upgrade and upgrade docs
Cargo.toml, docs/cherry-picks/*
Workspace git pins moved from moonbeam-polkadot-stable2512 → moonbeam-polkadot-stable2603; upgrade planning and cherry-pick tracker docs added/updated.
NotionalImbalance foundation
pallets/erc20-xcm-bridge/src/notional.rs, pallets/moonbeam-foreign-assets/src/notional.rs
New NotionalImbalance(u128) structs implementing fungible imbalance accounting traits for representing ERC20 amounts in XCM holding without real credit backing.
TransactAsset and ERC20 bridge migration
pallets/erc20-xcm-bridge/src/lib.rs, pallets/erc20-xcm-bridge/src/erc20_trap.rs, pallets/moonbeam-foreign-assets/src/lib.rs, tests
TransactAsset impls now accept AssetsInHolding and return Result<(), (AssetsInHolding, XcmError)>; withdraw/deposit/mint internals use notional credits and storage transactions; ERC20 trap/claim delegation added.
Runtime API & EVM call signature updates
runtime/common/src/apis.rs, runtime/common/src/impl_xcm_evm_runner.rs, pallets/moonbeam-foreign-assets/src/evm.rs, runtime test files
Session key generation takes owner and returns opaque session keys; Ethereum RPC call and EVM runner add state_override parameter; benchmark wiring adjusted.
Node service lazy-loading and manual sealing
node/service/src/lazy_loading/*, node/service/src/lib.rs, node/service/Cargo.toml
CallExecutor::runtime_version gains CallContext; manual sealer removes proof generic and uses ProofRecorder with ProposeArgs; network building passes spawn_essential_handle; set_block_data signature extended.
XCM weight trader and mock ecosystem
pallets/xcm-weight-trader/*, pallets/xcm-transactor/src/mock.rs, precompiles/*/src/mock.rs, tests
Trader stores withheld fees as AssetsInHolding; buy_weight/refund_weight/Drop handle new holding types; all mock TransactAsset/WeightTrader signatures and test helpers refactored.
XCM executor configuration rewiring
runtime/*/src/xcm_config.rs, runtime/*/tests/xcm_mock/*
Removed AssetClaims associated type; explicitly wired Trader, ResponseHandler, and AssetTrap across moonbase/moonbeam/moonriver and test mocks.
Debug derives and runtime limits
various pallets/*, primitives/*, runtime/*
Replaced RuntimeDebug with standard Debug derives across public types; BlockLength config updated to builder API in runtimes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

dependencies

Suggested reviewers

  • librelois
  • arturgontijo
  • stiiifff
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: upgrading polkadot-sdk from stable2512 to stable2603. It is concise, clear, and directly reflects the primary objective of this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description comprehensively explains the upgrade from stable2512 to stable2603, including specific technical changes, migration details, and follow-up work.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore-update-polkadot-sdk-stable2603

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The tracker `polkadot-sdk-stable2603.md` was assembled from the prior
cycle's tracker plus known deltas — it is not guaranteed to capture
every cherry-pick that has actually landed on each fork's
`moonbeam-polkadot-stable2512` branch.

Insert a pre-Phase-1 audit that enumerates every commit unique to
`origin/moonbeam-polkadot-stable2512` for each fork (polkadot-sdk,
frontier, evm, ethereum, moonkit) and reconciles it against the
tracker, so undocumented cherry-picks surface and get rows added
before re-application starts. Parallelizable via one sub-agent per
fork.
Run the Phase 0.5 audit against `origin/moonbeam-polkadot-stable2512`
on each fork using PR-number set-difference — raw SHA-diff is
misleading because both we and upstream apply the same backport PRs
under different SHAs.

Findings per fork:

* polkadot-sdk — 106 of 108 PR refs on our fork are also on
  upstream/stable2512 (they will inherit on rebase). Three new rows
  for the genuinely moonbeam-only commits: weight reclaim log
  improvements, an xcm-emulator BlockProducer trait override for
  Nimbus, and a bridges GRANDPA-justification experiment plus its
  revert.

* frontier — upstream/stable2512 has been frozen since 2026-01-13,
  so all 35 fork-only commits are moonbeam-authored. Six new rows
  (#1881 logs journal memory bound, #247 CI triggers, canonical
  hash mapping repair, Saturate U256, configurable tx gas-limit cap,
  MBF ethereum fork pin) and three tracker corrections: row #1820
  flipped from `Applied: No` to `Yes` (commit IS on the branch);
  rows previously listing PRs #1794 and #1787 corrected to #1824
  and #1862 (the PR numbers were typos for what is actually on the
  branch).

* evm — one moonbeam-authored commit (MBF ethereum fork dependency
  pin) added as a row.

* moonkit — one row for upstream PR #94 (relay offset dynamic);
  revisit during Phase 1.4 once the moonkit base-bump lands.

UPGRADE-stable2603.md gets the methodology note explaining why we
use PR-number set-difference, a per-fork results table, and a Phase
2 follow-up list for rows still TBD on Included vs Dropped.
Sixteen rows in the stable2603 and stable2512 trackers carried no
commit SHA and described upstream PRs that landed on our fork via
merging upstream/stable2512, not via moonbeam cherry-picks. The
Phase 0.5 PR-number set-difference confirmed every one of them is
also on upstream/stable2512 — they do not belong in a cherry-pick
tracker.

stable2506 keeps its rows for the same PR numbers because there
every row carries a real moonbeam-foundation commit SHA and
`Cherry pick: Included` — those were genuine cherry-picks of that
release cycle, not upstream content carried over.
Operational changes on the polkadot-sdk fork branch:

1. Rebase `moonbeam-polkadot-stable2603` from the
   `polkadot-stable2603-1` tag onto `upstream/stable2603` head
   (`afb51b7a8c6`), absorbing four upstream backports past the tag
   (#11964, #11856, #11987, #12017).

2. Cherry-pick the two Phase 0.5 finds that were missing from the
   branch:
   - `improve weight reclaim logs (call metadata, warn level)` →
     `161cd252773`.
   - `xcm-emulator: make slot/digest producer overridable for
     non-Aura parachains` → `beaf6b6c50a`. Trivial additive conflict
     with stable2603's `native_total_supply_tracker` macro arm,
     resolved by keeping both arms.

Doc updates:

- Refresh the six polkadot-sdk row commit hashes in
  `polkadot-sdk-stable2603.md` to match the post-rebase SHAs.
- Extend the Phase 1.1 checklist in `UPGRADE-stable2603.md` with the
  two new cherry-picks plus an explicit `Drop` for the bridges
  GRANDPA retry experiment that was reverted on stable2512.
@manuelmauro
manuelmauro force-pushed the chore-update-polkadot-sdk-stable2603 branch from 4e7949e to 87c1d45 Compare May 8, 2026 10:49
…write

Rewrote the commit messages of all six cherry-picks on
`moonbeam-foundation/polkadot-sdk:moonbeam-polkadot-stable2603` to
explain *why* each cherry-pick exists, not just *what* it does. In
particular, the auto-generated "Merge pull request #8" subject was
replaced with a real description of the pallet-parameters benchmark
fix. Each rewritten message now mirrors the context that lived only
in the moonbeam tracker, so the polkadot-sdk fork is self-explanatory
to anyone reading `git log` without the tracker open.

The rewrite changed all six SHAs. Update the tracker's commit links
and the Phase 1.1 checklist in `UPGRADE-stable2603.md` to point at
the new SHAs.
@manuelmauro
manuelmauro force-pushed the chore-update-polkadot-sdk-stable2603 branch from 5353713 to 27487be Compare May 8, 2026 10:58
…2603

The row in `polkadot-sdk-stable2603.md` claimed `Applied: Yes` and
`Dropped but needs refactoring` against `paritytech/polkadot-sdk#9214`,
but that PR was never cherry-picked — the stable2506 tracker noted
"Not found on the branch — may not have been carried over". The
relevant code (`ParachainTracingExecuteBlock`) reaches stable2603 via
upstream's own backport of `#9871`, which superseded `#9214` (the
prdoc shipping at `prdoc/stable2509-2/pr_9871.prdoc` is upstream's
own metadata). It is pure upstream content, not a moonbeam
cherry-pick, so it does not belong in the active-cycle cherry-pick
tracker.

The moonbeam-side follow-up — wiring
`Some(Arc::new(ParachainTracingExecuteBlock::new(...)))` into the
parachain service — is already captured in the Phase 3 checklist of
UPGRADE-stable2603.md, so no information is lost.

The matching row in `polkadot-sdk-stable2512.md` is preserved for
historical reasons: it documents `moonbeam-foundation/polkadot-sdk#20`,
the attempted cherry-pick of `#9214` that was eventually superseded
by upstream's `#9871`. Same policy as the named cherry-pick rows in
`polkadot-sdk-stable2506.md`.
@manuelmauro
manuelmauro force-pushed the chore-update-polkadot-sdk-stable2603 branch from 8a0042f to 402ca09 Compare May 8, 2026 11:16
manuelmauro added 11 commits May 8, 2026 14:21
Created `moonbeam-polkadot-stable2603` on
`moonbeam-foundation/ethereum`. Since `rust-ethereum/ethereum`'s
master has not advanced past the merge-base with our
`moonbeam-polkadot-stable2512` branch (`d7bdf2888253a30f160d434688e378636e253870`,
which is also master's head), the new branch shares the same tip SHA
as stable2512 (`58a5a8a`) — the only commit ahead of upstream is the
unmerged rust-ethereum/ethereum#77 cherry-pick, which is preserved
as-is.

Tick Phase 1.3 boxes in UPGRADE-stable2603.md and replace the `TBD`
placeholder in the ethereum row of `polkadot-sdk-stable2603.md` with
the actual commit link.
Created `moonbeam-polkadot-stable2603` on `moonbeam-foundation/evm`.
Upstream `rust-ethereum/evm` has moved to v1.0; the moonbeam fork
stays on the 0.43.x line and there is no new upstream commit to
pull. The new branch shares the same tip SHA as stable2512
(`bb9cdde4`) so both moonbeam-only commits — `a656db90` (the
EIP-7939 CLZ-opcode cherry-pick of rust-ethereum/evm#400, which was
merged upstream only on v1.0) and `bb9cdde4` (the MBF ethereum fork
dep pin discovered in Phase 0.5) — are inherited as-is.

Tick Phase 1.2 boxes in UPGRADE-stable2603.md and replace the `TBD`
placeholder in the EIP-7939 row of `polkadot-sdk-stable2603.md` with
the actual commit link.
…3 and stable2512

The "Refactor transaction signature validation" row referenced
rust-ethereum/ethereum#75, which is merged into upstream master at
`d7bdf28` — exactly the merge-base for our `moonbeam-polkadot-stable2603`
and `moonbeam-polkadot-stable2512` branches. The change is therefore
on our branches via upstream, not via cherry-pick.

The row carried no commit SHA and no moonbeam-side PR link, and the
`Applied` field disagreed across cycles (`No` in stable2603, `Yes` in
stable2512). It was not documenting a moonbeam cherry-pick action, so
it does not belong in either active or recent cherry-pick tracker —
same policy as the bulk of the upstream-only Backport PR rows we
removed earlier.

stable2506 keeps its version of the row because there it carries a
real `[moonbeam-foundation/ethereum@933ccae]` commit reference: that
documents the actual moonbeam-side work — a fork commit was
prepared, never applied (Applied: No, Cherry pick: Included), and
the PR was eventually merged upstream, making the cherry-pick moot.
That is the historically meaningful record; the 2512/2603 copies had
lost the SHA and only kept a now-redundant pointer to the upstream
PR.
Created `moonbeam-foundation/frontier:moonbeam-polkadot-stable2603`
on top of `upstream/stable2603` (`baf505d8f`) with 12 cherry-picks
and one manual `Cargo.toml` dep-redirect commit:

- Cherry-picks (#247 CI triggers, #1546 withdraw-ability, #1547
  ethereum execution info, #203 dispatch-error decoding,
  #1564+#224 squashed tx-size, #244 POV underestimations,
  #1568 lru_cache, #252 parity-db migration, frame-metadata,
  #254 validate tx size, Saturate U256, canonical hash mapping
  repair).
- One conflict on POV Underestimations (resolved by keeping
  stable2603's `match` block while adding `mut`); one trivial
  conflict on parity-db migration (kept upstream's deref form).
- Manual dep-redirect commit replaces the prior cycle's two
  cherry-picks (CI branch ref + MBF ethereum fork pin), pointing
  polkadot-sdk, ethereum, and evm at moonbeam-foundation forks on
  the `moonbeam-polkadot-stable2603` branch.

Phase 0.5 follow-ups resolved:
- 17 frontier PRs were inherited from `upstream/stable2603` (it
  was cut from the same master commit that absorbed our
  Phase 1.5a base-bump as PR#1892); their tracker rows are now
  confirmed `Dropped, PR Upstream Merged`.
- Three Phase 0.5–added rows flipped from TBD/TBD to Dropped:
  #1881 logs journal memory, #1856 latest-on-pruned, and the
  no-PR "Make tx gas limit cap configurable" (upstreamed as
  `b2088f29b`).

Side effect: `moonbeam-foundation/evm:moonbeam-polkadot-stable2603`
bumped to `7dd6ecc6` so its `ethereum` dep points at the stable2603
branch (was stable2512). Without this, cargo pulls in two distinct
versions of the `ethereum` crate when frontier consumes both.

Phase 1.5a is also marked complete because upstream merged our DIY
base-bump as polkadot-evm/frontier#1892 and cut `stable2603` from
the resulting master commit; our local `mb/polkadot-sdk-stable2603`
branch was redundant and has been dropped.

`cargo check --workspace` on the new frontier branch is clean (one
harmless unused-const warning from the dispatch-error cherry-pick).
- Add an evm row for the `delegation.rs` test-module fix
  (moonbeam-foundation/evm@a122857), upstreamed as rust-ethereum/evm#405.
- Correct the EIP-7939 row: PR #400 merged into `rust-ethereum/evm:v0.x`,
  so it is inherited from the upstream base, not a moonbeam cherry-pick
  (`Included` -> `Dropped`). Fix the matching "v1.0 only" claim in the
  Phase 1.2 plan.
Create moonbeam-polkadot-stable2603 off the open base-bump PR head
(mb/polkadot-sdk-stable2603, PR #95) to unblock moonbeam Phase 3 while
the upstream review is pending. PR #95 is linearly main + base-bump, so
the release branch already equals what it would be cut from the merge
commit; reconcile once #95 lands in main.

Verified the moonkit cherry-pick table: #92 (using_fake_author) and #94
(make relay offset dynamic) are both inherited from main, so no extra
cherry-picks are needed. Flip the #94 TBD row to Dropped/PR Merged and
add the #95 link to the base-bump row.
…al drift

Phase 3 of the polkadot-sdk stable2512 -> stable2603 upgrade.

- Cargo.toml: repoint all 180 fork deps to the moonbeam-polkadot-stable2603
  branches (polkadot-sdk, frontier, evm, ethereum, moonkit).
- Cargo.lock: re-resolved to stable2603. moonkit bumped to ba06fb0 (which
  redirects its polkadot-sdk/frontier deps to the moonbeam-foundation forks),
  unifying the tree on a single SDK source and eliminating a duplicate
  polkadot-sdk (canonical paritytech alongside the fork) that caused E0221/
  E0308 ambiguous-associated-type errors.
- Drop removed crate cumulus-client-consensus-proposer (upstream PR #9947 folded
  it into sp-consensus/sc-basic-authorship); it was an unused dependency.
- Bump num_enum to 0.7.6 to satisfy frontier fp-evm's new ^0.7.6 requirement.
- RuntimeDebug -> Debug across 51 sites / 14 files (upstream PR #10582 removed
  RuntimeDebug from sp_core/sp_runtime/frame_support; it is now plain Debug).
- pallet_evm Runner::call: add the new state_override argument (8 call sites).

Known remaining: erc20-xcm-bridge and moonbeam-foreign-assets need migrating to
the credit-based AssetsInHolding model (stable2603 XCM redesign); tracked
separately.
Scope-mapping checkpoint. stable2603 reworked AssetsInHolding to hold
fungible::Credit imbalances instead of Asset descriptors; the WeightTrader,
TransactAsset and FeeManager trait surfaces moved with it.

Mechanical fixes applied:
- TransactAsset::internal_transfer_asset now returns Result<Asset> (was
  Result<AssetsInHolding>); drop the .into().
- FeeManager::handle_fee now takes AssetsInHolding (was Assets).

todo!()-stubbed pending the real credit-based migration (tracked):
- erc20-xcm-bridge / moonbeam-foreign-assets: deposit_asset, withdraw_asset.
- xcm-weight-trader: buy_weight, refund_weight, and the Drop fee re-deposit.

These stubs let the compile-fix loop proceed past the XCM pallets to reveal
the runtime-layer drift. DO NOT SHIP without completing the migration.
Runtime-integration fixes that get all three runtimes compiling.

B — signature drift in the shared runtime macros (runtime/common):
- pallet_evm Runner::call gained a state_override (Geth-style) argument; thread
  it through apis.rs (API call + tracing call) and impl_xcm_evm_runner.rs.
- fp_rpc EthereumRuntimeRPCApi::call gained a state_override parameter.
- SessionKeys::generate_session_keys now takes an owner and returns
  OpaqueGeneratedSessionKeys (V2).

C — cumulus_pallet_parachain_system::WeightInfo gained three methods
  (block_weight_tx_extension_{max_weight,stays_fraction_of_core,full_core});
  add them (Weight::zero, matching upstream) to all three runtime weight files.

XCM Config — stable2603 merged asset claiming into the trap config: AssetClaims
  was removed from xcm_executor::Config and AssetTrap must now also implement
  ClaimAssets. Implement ClaimAssets for AssetTrapWrapper (delegates to the inner
  claimer; erc20 assets are filtered on drop so plain delegation is correct) and
  drop the now-invalid type AssetClaims from each runtime's xcm_config.
Gets moonbeam-service compiling; with this, cargo check --workspace passes
on default features.

- sc_service/cumulus BuildNetworkParams gained spawn_essential_handle.
- new_full_parts_record_import gained a pruning_filters argument.
- sc_client_api::CallExecutor::runtime_version gained a call_context param;
  Backend::set_block_data gained a register_as_leaf param (lazy-loading impls).
- moonkit: NimbusManualSealConsensusDataProvider dropped its _phantom field;
  MockValidationDataInherentDataProvider gained relay_parent_offset.
- Proof-recording refactor (upstream #9947): sp_consensus::Proposer lost its
  Proof associated type and Proposal lost its proof field. Rewrite the
  lazy-loading manual-seal (run_manual_seal/seal_block) to mirror upstream:
  drop the P generic, record the storage proof via a ProofRecorder wired into
  the proposal extensions, and drain it after proposing.
moonkit PR #95 (polkadot-sdk stable2603 base bump) merged into main; the
moonbeam-polkadot-stable2603 branch was rebased onto main and is now
main + the dep-redirect commit. Re-pin Cargo.lock ba06fb0 -> 9d71129
(content-identical tree, branch ref unchanged).
The polkadot-sdk base bump is the rebase-onto-upstream act, not a
cherry-pick, and it is not tracked for the other forks (polkadot-sdk,
frontier, evm, ethereum). Remove the moonkit base-bump rows from the
stable2603 (#95) and stable2512 (#89) trackers for consistency.
moonkit #95 merged to main 2026-06-18 (squash 4088d76); the
moonbeam-polkadot-stable2603 release branch was rebased onto main and
moonbeam re-pinned to it. Tick Phase 1.4/1.4a, resolve the moonkit
risk, and refresh the stale 'awaiting merge' / 'reconcile when' notes.
Verified frontier + polkadot-sdk cherry-picks against upstream/stable2603
via parallel sub-agents.

- frontier: all 13 Included SHAs confirmed present + moonbeam-only; all 18
  Dropped/PR-Upstream-Merged 'Verify' rows confirmed in upstream/stable2603;
  **Verify** flags replaced with confirmation notes.
- polkadot-sdk: all 9 Included SHAs confirmed; added the missing ddba2453 row
  (completes the weight-reclaim-logs cherry-pick b0b4fd52a9e by adding the
  GetCallMetadata bound to the benchmark where-clause).
- Fixed frontier #1856 note: cited 54396433 (the stable2512 cherry-pick) instead
  of the upstream/stable2603 commit 46cf7a43e.
- Ticked Phase 0.5 deferrals and Phase 2 checkboxes in the upgrade plan; header
  updated to reflect verification complete.
The runtime spec_version bump is a separate release step, not part of the
polkadot-sdk upgrade process. Remove it from the Phase 4 checklist and retitle
the phase (Runtime, weights, migrations).
Local verification after the moonkit re-pin (2026-06-18):
- cargo check matrix (default / runtime-benchmarks / try-runtime): all clean.
- cargo test --workspace --no-fail-fast: 1347 passed / 0 failed across 134 suites
  (incl. moonbase/moonbeam/moonriver integration_test + xcm_tests).
- TS dev fixtures touched by the upgrade (D010105, D010701, D022749): pass.
- PrecompileWasmCmd subcommand present in the built binary.
Smoke (live endpoints) and full zombienet XCM are flagged CI-only.
Remove now-stale claims after Phases 1-3 and Phase 6 completed:
- Context: starting pin migrated (Phase 3); moonkit #95 merged; all five forks
  now have a moonbeam-polkadot-stable2603 branch.
- Phase 3: drop the 'TS fixtures pending' qualifier; fixtures ran in Phase 6.
- Risks: verification-cost item resolved by Phase 2.
Weights: only cumulus_pallet_parachain_system gained 3 WeightInfo methods,
added as Weight::zero() stubs; their sole consumer (DynamicMaxBlockWeight
tx-extension) is not wired into moonbeam, so the stubs are safe and no
benchmark run is required. No weight regressions.
Migrations: none added; migrations.rs unchanged, lists empty. SDK-pallet
storage-version validation deferred to the try-runtime step.
…innet)

Lazy-loading is moonbeam-only, so it can't target moonbase. Ran it forking
moonbeam mainnet #16090736 with the new runtime override (4500 vs live 4303):
on_runtime_upgrade executed and 15 blocks imported cleanly, no panics. Caveat:
lazy state under-fetch treated many pallets as fresh-init ('new pallet detected')
rather than migrated, so per-pallet migrations weren't fully exercised. The
earlier try-runtime (moonbase) attempt was stopped mid-scrape. Authoritative
migration validation (full try_state) still open.
create-snapshot vs moonbase was still enumerating keys after a full 10 min
(phase 1 of 2, never completed) — public-RPC scrape is impractical locally.
Decision: skip the local full try_state, defer to CI. Residual risk low
(weights clean, migration lists empty, lazy-loading upgrade green on live
mainnet state). Phase 4 closed locally.
stable2603 bumps cumulus-pallet-xcmp-queue STORAGE_VERSION 5 -> 6
(OutboundChannelDetails in OutboundXcmpStatus gains a `flags` field).
MigrateV5ToV6 is a standalone VersionedMigration that the pallet does NOT
auto-run in its hooks; upstream parachain runtimes wire it explicitly.
Moonbeam's migration lists were empty, so on-chain XcmpQueue (v5) would not
migrate and OutboundXcmpStatus would fail to decode against the v6 layout,
breaking outbound XCMP.

Add MigrateV5ToV6 to UnreleasedSingleBlockMigrations (made Runtime-generic so
the single common definition covers moonbeam/moonriver/moonbase). Pulls
cumulus-pallet-xcmp-queue into runtime-common (std/runtime-benchmarks/try-runtime
wired). Self-guarding VersionedMigration<5,6>: no-ops if on-chain isn't v5.
Compiles across default / try-runtime / runtime-benchmarks.
…m audit + wired)

Upstream-repo STORAGE_VERSION audit found cumulus-pallet-xcmp-queue bumped
5->6 and its VersionedMigration was not wired in moonbeam. Recorded the finding
and the fix (commit 39d47d1) in Phase 4; corrected the stale 'migration
lists empty' conclusion.
Guards against the migration silently being dropped from the runtime's
single-block migration set: sets XcmpQueue on-chain StorageVersion to 5,
runs the runtime's wired SingleBlockMigrations, and asserts it ends at 6.
Generated for all three runtimes via generate_common_xcm_tests!. Verified
passing on moonbase.
…ot-sdk-stable2603

# Conflicts:
#	test/suites/dev/common/test-xcm/test-transactional-outcomes.ts
Under the stable2603 holding/credit model, assets used by the XCM benchmarks
must be mintable by the executor's AssetTransactor and present in the
worst-case holding. Three sites in the shared benchmark config still
referenced the relay token, which is neither registered nor in the generated
holding, so pallet_xcm_benchmarks::{fungible,generic} failed (AssetNotFound,
AssetUnderflow, claim_asset panic):

- worst_case_for_trader: relay token -> native `Here`, the abundant MockCredit
  asset in generate_holding_assets (priced by worst_case_holding).
- claimable_asset: relay token -> native `SelfReserve`, mintable by the real
  AssetTransactor that assets_to_holding uses.
- TrustedReserve: relay token from AssetHub -> native `SelfReserve` from origin
  `Here`, trusted via MultiNativeAsset.

Verified: both XCM benchmark pallets now run on moonbase, moonbeam, moonriver.
cumulus-pallet-parachain-system gained block_weight_tx_extension_{max_weight,
stays_fraction_of_core,full_core} in stable2603; they were committed as
Weight::zero() placeholders. Replace with benchmarked weights on moonbase,
moonbeam and moonriver.

Note: generated on non-reference hardware; to be regenerated on the reference
machine before release.
The previous fix used the native token for reserve_asset_deposited, whose mint
takes the cheaper Balances path and under-counts the realistic cost of a
reserve deposit (which always involves foreign assets). Register DOT
(RelayLocation) as a foreign asset in the TrustedReserve getter so the
instruction is measured through the EvmForeignAssets mint path, trusted from
Asset Hub via the RelayChainNativeAssetFromAssetHub reserve filter.

On moonbase this raises the measurement from a notional path (proof size 0,
0 reads) to real storage (proof size 3586, 1 read). Verified on moonbase,
moonbeam and moonriver.
…ot-sdk-stable2603

# Conflicts:
#	test/suites/dev/common/test-xcm/test-transactional-outcomes.ts
@arturgontijo

Copy link
Copy Markdown
Contributor

LGTM!
I was able to run the runtime upgrade locally using zombienet (4401 -> 4500).

@manuelmauro
manuelmauro merged commit e991ea1 into master Jul 9, 2026
108 of 111 checks passed
@manuelmauro
manuelmauro deleted the chore-update-polkadot-sdk-stable2603 branch July 9, 2026 06:42
manuelmauro added a commit that referenced this pull request Jul 9, 2026
Master brings the polkadot-sdk stable2603 upgrade (#3746).

Conflict resolutions:
- runtime/*/tests/xcm_mock/*: kept this branch's deletion; these were
  replaced by the xcm-emulator-tests crates.
- Cargo.toml: took master's stable2603 branch pins, re-applied this
  branch's additions (xcm-emulator-tests workspace members,
  pallet-delegated-staking, asset-hub-westend-runtime, and
  xcm-simulator -> xcm-emulator).
- Cargo.lock: regenerated on master's stable2603 resolution. Pinned
  alloy-* to 1.6.3, alloy-eip7928 to 0.3.3 and ruint to 1.17.2, since
  the latest versions require rustc 1.90/1.91 and rust-toolchain.toml
  pins 1.88.0. These crates enter only via asset-hub-westend-runtime.
- docs/cherry-picks/polkadot-sdk-stable2512.md: kept both master's
  pruning plus new rows and this branch's xcm-emulator row.

Integration fix: Westend's ParachainHost moved to api_version 16 in
stable2603, so decl_test_relay_chains! could no longer resolve
dmq_contents via ParachainHostV15. Bumped api_version to 16 in all
three xcm-emulator-tests network.rs, matching upstream's own emulated
Westend declaration.
manuelmauro added a commit that referenced this pull request Jul 9, 2026
The polkadot-sdk stable2603 upgrade shipped in #3746, so the temporary
working doc it introduced has served its purpose. The cherry-pick tracker
polkadot-sdk-stable2603.md stays, alongside the stable2512 and stable2506
trackers kept for historical reference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D9-needsaudit👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited XCM Run option xcm-emulator tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants