Skip to content

Upgrade Polkadot SDK and Frontier to stable2512 - #2

Draft
vedhavyas wants to merge 2 commits into
mainfrom
feature/substrate-upgrade-2506
Draft

Upgrade Polkadot SDK and Frontier to stable2512#2
vedhavyas wants to merge 2 commits into
mainfrom
feature/substrate-upgrade-2506

Conversation

@vedhavyas

@vedhavyas vedhavyas commented Mar 27, 2026

Copy link
Copy Markdown
Owner

Summary

Two-phase Substrate upgrade: stable2503 → stable2506 → stable2512.

Recommend reviewing commit-by-commit.

Commits

844a7dfbb — upgrade polkadot-sdk and frontier to stable2506

Polkadot SDK fork: subspace-v13 (9 commits on stable2506)

Breaking changes addressed:

  • sp-io ABI rework: custom #[runtime_interface] traits updated with explicit wrapper types (PassFatPointerAndDecode, PassPointerAndReadCopy, AllocateAndReturnByCodec)
  • EnsureInherentsAreFirstIsInherent in domain executive
  • RuntimeEvent moved from associated type to trait bound in all Subspace pallets
  • frame_system::initialize() strict sequential assertion: guarded check_extrinsics_and_do_pre_dispatch
  • Backend::state_at() gains TrieCacheContext
  • memory-db 0.32 → 0.34: MemoryDB requires explicit sp_trie::RandomState
  • API renames: try_sqrtchecked_sqrt, create_inherentcreate_bare
  • Workspace lints: substrate_runtime added to check-cfg

e90bda32b — upgrade polkadot-sdk and frontier to stable2512

Polkadot SDK fork: subspace-v14 (10 commits on stable2512)

Frontier: updated to commit 9d49e36e (compatible with stable2512)

Breaking changes addressed:

  • Windows CI: -C debuginfo=0 -C link-arg=/DEBUG:NONE for PDB size limits (wasmtime 35)
  • ForkAware txpool default (addressed in fix commit below)
  • Host function ABI change for Vec<u8> (addressed in fix commit below)

bd67ddc53 — fix host function ABI compat and default txpool to SingleState

Two fixes found during local dev network upgrade testing with XDM:

  1. ABI fix: The old sp-runtime-interface had a TypeId::of::<u8>() special case — Vec<u8> was passed as raw bytes without SCALE encoding. The new PassFatPointerAndDecode always SCALE-encodes, breaking ABI compatibility with old domain WASM calling verify_mmr_proof. Changed encoded_proof parameter to use PassFatPointerAndRead<Vec<u8>> which preserves the raw-bytes behavior. Only this one parameter was affected — all other host function types verified compatible.

  2. TxPool default: polkadot-sdk stable2512 changed the CLI default for --pool-type to ForkAware. The ForkAware pool crashes when domain subsystem is active (tokio::select! exits when any subtask completes). Reverted the default to SingleState in the fork.

Local dev network test results

Test Result
Baseline network with XDM channel + transfers Pass
EVM transactions (transfers + contract deploy) Pass
Upgrade domain full node sync (XDM blocks) Pass — domain hashes match
Consensus binary swap (baseline → upgrade) Pass
Consensus runtime upgrade All nodes survive
Domain runtime upgrade All nodes survive
Post-upgrade XDM + EVM transactions Pass

Code contributor checklist:

@vedhavyas vedhavyas left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

not sure why workspace lints are introduced. Unnecessary move of same code from one line to another

runtime-benchmarks = []

# @claude why is this required?
[lints]

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

why ?

Comment thread crates/sp-consensus-subspace/Cargo.toml Outdated

runtime-benchmarks = []

# @claude why is this required?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

remove comment

domain_runtime_code: Vec<u8>,
bundle_body: Vec<OpaqueExtrinsic>,
) -> Option<H256> {
domain_runtime_code: PassFatPointerAndDecode<Vec<u8>>,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

can you drop the PR that introduced this change upstream ?

Comment thread crates/subspace-service/src/config.rs
let state = alice.backend.state_at(best_hash).expect("Get state");
let state = alice
.backend
.state_at(best_hash, sc_client_api::TrieCacheContext::Trusted)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

ensure Trusted is waht we need for all the places we use the state_at

"Parent hash should be valid.",
);

match ExecutiveConfig::ensure_inherents_are_first(block) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

ensure_inherents_are_first

is this removed upstream ?

Comment thread domains/test/runtime/evm/src/lib.rs Outdated
impl frame_system::Config for Runtime {
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous event type.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

dont understand this change

}

impl pallet_balances::Config for Runtime {
type RuntimeEvent = RuntimeEvent;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

dont understand this one too

Polkadot SDK fork: subspace-v13 (8 custom commits on stable2506)
Frontier: upstream stable2506 (b70f725a8)

Breaking changes addressed:
- sp-io ABI: replace PassBy/Codec with explicit wrapper types
  (PassFatPointerAndDecode, PassPointerAndReadCopy, AllocateAndReturnByCodec)
- EnsureInherentsAreFirst removed: domain executive aligned with upstream
  frame_executive structure (inline inherent check in apply_extrinsics)
- RuntimeEvent removed from pallet configs (moved to trait bound)
- frame_system::initialize() strict sequential block numbers: guard
  check_extrinsics_and_do_pre_dispatch, fix test and benchmark helpers
- Backend::state_at() gains TrieCacheContext parameter
- memory-db 0.32 -> 0.34 with explicit sp_trie::RandomState for WASM
- NetworkConfiguration gains min_peers_to_start_warp_sync
- sc_service::Configuration gains warm_up_trie_cache
- StorageCmd::run gains trie_cache parameter
- try_sqrt -> checked_sqrt, create_inherent -> create_bare
- workspace lints for substrate_runtime cfg (set by wasm-builder)
- skip frame-storage-access-test-runtime wasm build in benchmarks
  (upstream bug: with_current_project() fails outside polkadot-sdk workspace)
@vedhavyas
vedhavyas force-pushed the feature/substrate-upgrade-2506 branch 3 times, most recently from 2eb73fb to 58f8400 Compare March 27, 2026 14:19
let storage = backend.expose_storage();

cmd.run(config, client, db, storage)
cmd.run(config, client, db, storage, None)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

whats is NONE here ?

Comment thread Cargo.lock Outdated

[[package]]
name = "darling_macro"
version = "0.21.3"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

two versions of darling_macro ?

pub struct OnChargeTransaction;

impl pallet_transaction_payment::TxCreditHold<Runtime> for OnChargeTransaction {
type Credit = ();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

whats this ?

telemetry: telemetry.as_mut(),
tx_handler_controller,
sync_service: sync_service.clone(),
tracing_execute_block: None,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

whats this >

Comment thread domains/client/eth-service/src/rpc.rs Outdated
filter_pool,
500_usize, // max stored filters
max_past_logs,
10_000_u32, // max block range for eth_getLogs

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

whats this ?

PrecompileAt<AddressU64<5>, Modexp, EthereumPrecompilesChecks>,
// Non-Frontier specific nor Ethereum precompiles :
PrecompileAt<AddressU64<1024>, Sha3FIPS256, (CallableByContract, CallableByPrecompile)>,
PrecompileAt<AddressU64<1024>, Sha3FIPS256<R, ()>, (CallableByContract, CallableByPrecompile)>,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

whats this ?

&block_hash,
&Default::default(),
);
// Only initialize if not already at the expected block number,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

can you point me where in the Executive change happened that broke this change

Comment thread test/subspace-test-runtime/src/lib.rs Outdated
_prev_block_number: BlockNumber,
_best_known_block_number: Option<BlockNumber>,
) -> Result<mmr::AncestryProof<mmr::Hash>, mmr::Error> {
Err(mmr::Error::GenerateProof)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

why is this not implemented?

@vedhavyas
vedhavyas force-pushed the feature/substrate-upgrade-2506 branch 7 times, most recently from 578cfc6 to 89d297e Compare March 28, 2026 22:10
@vedhavyas
vedhavyas force-pushed the feature/substrate-upgrade-2506 branch from 89d297e to 10db821 Compare March 28, 2026 23:09
@vedhavyas vedhavyas changed the title Upgrade Polkadot SDK to stable2506 Upgrade Polkadot SDK and Frontier to stable2512 Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant