Skip to content

build: ⬆️ Upgrade polkadot-sdk deps to stable2506#709

Draft
snowmead wants to merge 24 commits intomainfrom
feat/upgrade-polkadot-sdk-2506
Draft

build: ⬆️ Upgrade polkadot-sdk deps to stable2506#709
snowmead wants to merge 24 commits intomainfrom
feat/upgrade-polkadot-sdk-2506

Conversation

@snowmead
Copy link
Copy Markdown
Contributor

@snowmead snowmead commented Mar 16, 2026

Upgrade all polkadot-sdk git dependencies from branch stable2503 to stable2506. Upgrade all Frontier EVM dependencies from branch stable2503 to tag frontier-stable2506. Frontier still points to polkadot-sdk branch dependencies, so we cannot use tags yet.

Upstream breaking changes addressed:

Future work:

⚠️ Breaking Changes ⚠️

  • Short description: Upgraded polkadot-sdk dependencies to branch stable2506 and the frontier dependencies to tag frontier-stable2506. The default transaction pool is now fatxpool (fork-aware), which changes reorg behavior.

  • Who is affected: Any runtimes and clients using the storage hub pallets and storage hub libraries respectively. Integration tests that depend on Retracted transaction status events or deterministic pool behavior after reorgs.

  • Suggested code changes: Update runtime and client dependencies. For reorg-related test logic, check on-chain state after reorgs instead of assuming the transaction returns to the pool — fatxpool may auto-re-include it in the fork block.

snowmead and others added 8 commits March 16, 2026 16:11
Upgrade all polkadot-sdk git dependencies from branch `stable2503` to
`stable2506`. Upgrade all Frontier EVM dependencies from branch
`stable2503` to tag `frontier-stable2506`.

Fix all compilation errors and test failures caused by upstream breaking
API changes in polkadot-sdk stable2506 (134 PRs) and 9 patch releases.

Upstream breaking changes addressed:
- Remove local `AccountIdFor` alias, now provided by
  `frame_system::pallet_prelude` (paritytech/polkadot-sdk#7229)
- Add `RelayParentOffset = ConstU32<0>` to parachain system config
  (paritytech/polkadot-sdk#8299)
- Fix `Outcome` enum pattern matching: `Error` is now tuple variant
  wrapping `InstructionError` (paritytech/polkadot-sdk#8535)
- Remove `RuntimeEvent` from `pallet_evm::Config` and
  `pallet_ethereum::Config` (frontier stable2506)
- Add `RuntimeEvent` to `pallet_session::historical::Config`
- Remove `PassByInner` import, use `.0` for `H256` inner access
  (paritytech/polkadot-sdk#7375)
- Destructure 4 return values from `build_relay_chain_interface`
  (paritytech/polkadot-sdk#8072)
- Add `metrics` field to `BuildNetworkParams`
  (paritytech/polkadot-sdk#8332)
- Add `prometheus_registry` to `StartRelayChainTasksParams`
  (paritytech/polkadot-sdk#8332)

Release: https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-stable2506

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
FRAME now auto-derives the RuntimeEvent conversion using associated
type bounds on frame_system::Config when a #[pallet::event] block is
present, making the explicit `type RuntimeEvent` in pallet Config
traits redundant.

Removed from 7 StorageHub pallets (bucket-nfts, file-system,
payment-streams, proofs-dealer, providers, randomness,
provider-randomness), the mock_message_queue pallet, and all
corresponding mock/runtime/xcm-simulator Config implementations.

Events themselves are unchanged — only the redundant associated type
declaration was removed.

Ref: paritytech/polkadot-sdk#7229

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Regenerate api-augment metadata and TypeScript type definitions from
fresh stable2506 runtime binaries built via cargo build --release,
crossbuild:mac, and docker:build.

Reflects all runtime API and pallet changes from the polkadot-sdk
stable2506 upgrade including V16 metadata stabilization
(paritytech/polkadot-sdk#8443) and RuntimeEvent removal from pallet
Config traits (paritytech/polkadot-sdk#7229).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused `pallet_prelude::*` import in pallet-bucket-nfts
  (leftover from RuntimeEvent removal in paritytech/polkadot-sdk#7229)
- Prefix unused `relay_network_service` and `relay_req_receiver`
  variables with underscore (new return values from
  build_relay_chain_interface in paritytech/polkadot-sdk#8072)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace `<T as pallet::Config>::RuntimeEvent` with
  `<T as frame_system::Config>::RuntimeEvent` in all benchmark files,
  since RuntimeEvent was removed from pallet Config traits
  (paritytech/polkadot-sdk#7229)
- Add missing 5th argument (SharedTrieCache) to storage benchmark
  `cmd.run()` calls in node/src/command.rs
  (paritytech/polkadot-sdk#7556)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@snowmead snowmead added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes breaking Needs to be mentioned in breaking changes D3-trivial👶 PR contains trivial changes that do not require an audit labels Mar 17, 2026
@snowmead snowmead force-pushed the feat/upgrade-polkadot-sdk-2506 branch 6 times, most recently from 06497f4 to 86546c3 Compare March 25, 2026 12:25
…stable2506)

The fork-aware transaction pool (fatxpool), now default in stable2506,
has behavioral differences from the old single-state pool that broke
integration tests. All changes are validated against the actual fatxpool
source code in polkadot-sdk.

Rust change (utils.rs):
  Detect implicit retraction by fatxpool (polkadot-sdk#5479). When a
  second InBlock arrives for a different block hash, log it as an
  implicit retraction. fatxpool intentionally suppresses Retracted
  events — watchers receive InBlock→InBlock instead.

Test changes:
  - transaction-manager: Handle both fatxpool outcomes after reorg
    (tx re-included in fork OR returned to pool). Fix skipTo boundary
    condition. Handle async cascading invalidation (polkadot-sdk#5496).
  - reorg-proof: Dual-path reorg handling for proof and bspConfirmStoring
    re-inclusion. Flush seals after reorgs to clear stale InBlock txs.
  - reorg-accept-storage-request: Handle MSP accept auto-re-inclusion.
  - sync-deletion-catchup: Verify provider root matches on-chain
    regardless of whether deletion was reverted or re-included.
  - batch-file-deletion-catchup: Force P2P reconnection via
    system_addReservedPeer after Docker pause/resume (long pauses kill
    gossip connections). Force fatxpool view creation by sealing a post-
    sync block via normal gossip (bulk sync notifications are unreliable
    per polkadot-sdk README, leaving fatxpool with stale views).
@snowmead snowmead force-pushed the feat/upgrade-polkadot-sdk-2506 branch from 86546c3 to ce223ae Compare March 25, 2026 12:44
…-sdk-2506

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	api-augment/dist/parachain/interfaces/lookup.js
#	api-augment/dist/parachain/interfaces/lookup.js.map
#	api-augment/dist/solochain-evm/interfaces/lookup.js
#	api-augment/dist/solochain-evm/interfaces/lookup.js.map
#	api-augment/dist/types/parachain/interfaces/lookup.d.ts
#	api-augment/dist/types/parachain/interfaces/registry.d.ts
#	api-augment/dist/types/parachain/interfaces/types-lookup.d.ts
#	api-augment/dist/types/solochain-evm/interfaces/lookup.d.ts
#	api-augment/dist/types/solochain-evm/interfaces/registry.d.ts
#	api-augment/dist/types/solochain-evm/interfaces/types-lookup.d.ts
#	api-augment/metadata-sh-parachain.json
#	api-augment/metadata-sh-solochain-evm.json
#	api-augment/package.json
#	api-augment/src/parachain/interfaces/lookup.ts
#	api-augment/src/parachain/interfaces/types-lookup.ts
#	api-augment/src/solochain-evm/interfaces/lookup.ts
#	api-augment/src/solochain-evm/interfaces/types-lookup.ts
#	bun.lock
#	types-bundle/package.json
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 6 additional findings.

Open in Devin Review

snowmead and others added 4 commits March 25, 2026 12:55
P2P gossip reconnects naturally after Docker pause/resume — the
addReservedPeer + peer polling was unnecessary. The post-sync seal
for fatxpool view creation is sufficient.
- Replace template literal without interpolation with string literal
  (biome lint error in reorg-proof.test.ts)
- Remove unused onChainBspForestRootBefore variable (TS6133)
- Replace nonexistent isFileInFileSystem call with
  pendingStorageRequestsByMsp check (TS2339)
- Bump api-augment version to 0.5.1
@snowmead snowmead force-pushed the feat/upgrade-polkadot-sdk-2506 branch 2 times, most recently from c1db7c9 to bb228f4 Compare March 26, 2026 11:39
The Polkadot SDK stable2506 upgrade introduced the fatxpool (Fork-Aware
Transaction Pool) which has different timing characteristics during rapid
block production. This causes BSP/MSP nodes to fall behind on P2P gossip
when tests use skipTo/advanceToBlock to rapidly seal blocks.

Root causes identified and fixed:
1. After skipTo, BSPs lag behind the chain tip due to P2P gossip delay.
   Their forest-write lock queue (proof submissions → confirm-storing →
   stop-storing-insolvent → confirm-stop-storing) blocks lower-priority
   actions until the BSP catches up.
2. The fatxpool's maintain() needs block production to process gossiped
   transactions. Without continuous block sealing, BSPs cannot progress
   through their internal queues.
3. Reactive extrinsics (MSP stop-storing) can arrive at different times
   and get spread across multiple blocks, so assertions that check for
   all events in a single block's system.events() may miss them.

New test utilities (test/util/bspNet/waits.ts):
- drainBspBacklog: Drains accumulated proof/charge backlog by sealing
  blocks, using runtime API (getNextTickToSubmitProofFor) for
  deterministic proof detection. Supports stopOnMethod to avoid
  consuming target extrinsics.
- waitForExtrinsicAndSeal: Continuously seals blocks while polling for
  a target extrinsic, keeping the BSP's block-import handler active.

Test fixes applied:
- storage-delete, multiple-delete: skipTo → nodeCatchUpToChainTip →
  waitForExtrinsicAndSeal for bspConfirmStopStoring
- debt-collection: Sync all 3 BSPs to chain tip before proof assertions
- stop-storing-bucket-insolvent-user: Iterative block sealing to
  accumulate MspStopStoringBucketInsolventUser events across blocks
- fisherman/indexer-fishing: BSP sync + drain after skipTo(cooldown)
  and skipTo(+100)
- sync-deletion-catchup: Extra seal after MSP response for BSP gossip
- batchStorageRequests helper: Increased volunteer timeout to 30s
- multi-volunteer-3: Increased timeout to 60s for 9-volunteer assertion
- bsp-thresholds, reorg-proof: Extra seals after skipTo for BSP sync
@snowmead snowmead force-pushed the feat/upgrade-polkadot-sdk-2506 branch from d490dd1 to b05e4e7 Compare March 26, 2026 11:48
Reverted all fatxpool-related test changes to determine which CI
failures are genuine regressions vs pre-existing flakes. All tests
pass locally with zero test modifications — CI will reveal which
tests need hardening for slower hardware.
The polkadot-sdk stable2506 CLI defaults --pool-type to fork-aware
(ForkAwareTxPool). This pool maintains per-block "views" and processes
them via async maintain() calls. During rapid manual-seal block
production in tests, maintain() can't keep up — it skips 60-77% of
NewBestBlock events. The block proposer queries ready_at_with_timeout()
which finds no view for the current block and returns an empty
transaction set, building empty blocks even when transactions exist in
the mempool.

This is a known upstream issue (paritytech/polkadot-sdk#10104), fixed
in stable2512 via PR #10106 which auto-enforces SingleState pool for
instant-seal nodes.

Fix: add --pool-type=single-state to the test node container startup.
The SingleState pool (BasicPool) uses a single transaction graph with
no per-block views, so ready() always returns available transactions
immediately regardless of block production speed.

Also reverts the fatxpool-specific test adaptations (transaction watcher
changes, extra seals, etc.) that are no longer needed with the correct
pool type, restoring tests to their main branch versions.
The previous commit incorrectly reverted 5 test files to main's version.
These files had necessary stable2506 upgrade adaptations (transaction
watcher event changes, retraction behavior, etc.) from commit ce223ae.
Restore them to the pre-fatxpool-fix state (ebf9450).
All 5 adapted test files explicitly reference fatxpool behavior
(polkadot-sdk#5479). With --pool-type=single-state (BasicPool),
these adaptations are unnecessary — BasicPool doesn't have the
view-based architecture or suppressed Retracted events.
…nerator

The previous commit added the flag only to docker.ts (programmatic API),
but test nodes are started via docker-compose templates and the dynamic
service generator — not docker.ts. Add the flag everywhere
--sealing=manual appears.
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 D3-trivial👶 PR contains trivial changes that do not require an audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant