Skip to content

Bump polkadot-sdk to stable2603#95

Open
manuelmauro wants to merge 11 commits into
mainfrom
mb/polkadot-sdk-stable2603
Open

Bump polkadot-sdk to stable2603#95
manuelmauro wants to merge 11 commits into
mainfrom
mb/polkadot-sdk-stable2603

Conversation

@manuelmauro
Copy link
Copy Markdown
Contributor

@manuelmauro manuelmauro commented May 7, 2026

Summary

Updates moonkit's polkadot-sdk dependency from stable2512 to stable2603 (polkadot-stable2603-1). Required for downstream consumers (Moonbeam) to track the latest stable cycle.

Migrations driven by upstream API drift

  • RuntimeDebug is no longer re-exported from sp_core / sp_runtime. Switched derives and imports to core::fmt::Debug.
  • ExecuteBlock trait split into verify_and_remove_seal + execute_verified_block. pallet-author-inherent's BlockExecutor now implements both and delegates seal-stripping appropriately.
  • ConsensusDataProvider lost its Proof associated type and now takes a concrete StorageProof. Dropped the now-unused P generic from NimbusManualSealConsensusDataProvider.
  • cumulus-client-consensus-proposer removed upstream (paritytech/polkadot-sdk#9947). Vendored a moonkit-local ProposerInterface inside nimbus-consensus that wraps the new sp_consensus::ProposeArgs API. The collator now owns the ProofRecorder, registers ProofSizeExt, and drains the proof after proposing — preserves prior proof-recording semantics.
  • ProposerFactory dropped its EnableProofRecording generic.
  • Parent search refactor: find_potential_parents / PotentialParent removed; switched to find_parent_for_building / ParentSearchResult. ParentSearchParams lost max_depth and ignore_alternative_branches; "depth" now derived from header numbers via Saturating.
  • ParachainInherentDataProvider::create_at takes RelayProofRequest instead of Vec<Vec<u8>>. Raw additional keys wrapped as RelayStorageKey::Top.
  • SubmitCollationParams.scheduling_parent added; passing None preserves V2 candidate-descriptor semantics (set to Some(hash) to opt into V3).
  • XCM Config::AssetClaims removed; the new TrapAndClaimAssets bound on AssetTrap covers both.
  • AssetsInHolding now tracks ImbalanceAccounting credits, no longer From<Vec<Asset>>. The xcm-utils precompile uses xcm_executor::test_helpers::mock_asset_to_holding for its fee-estimation read path and unwraps credit values via .amount().
  • sp_session::SessionKeys runtime API v2: generate_session_keys(seed) -> Vec<u8> became generate_session_keys(owner, seed) -> OpaqueGeneratedSessionKeys.
  • sc_service::BuildNetworkParams gained spawn_essential_handle; new_full_parts / new_full_parts_record_import gained a pruning_filters parameter. Threaded through the template node.
  • MockValidationDataInherentDataProvider gained relay_parent_offset (template defaults to 0).

Frontier

fp-evm, pallet-evm, and precompile-utils point at the official polkadot-evm/frontier:stable2603 branch — polkadot-evm/frontier#1892 (the stable2603 base bump) has merged and upstream cut stable2603 from it. evm continues to track rust-ethereum/evm:v0.x.

Test plan

  • cargo check --workspace --all-features is clean (a handful of BlockLength::max_with_normal_ratio and RuntimeString deprecation warnings, scheduled for removal after July 2026).
  • cargo test --workspace in CI.
  • Smoke test the template node: instant-seal --dev boot, parachain block production via slot-based collator.
  • Spot-check proof-recording correctness end-to-end (vendored proposer, new caller-owned ProofRecorder flow).

Updates moonkit's polkadot-sdk dependency from stable2512 to stable2603.

Source-level migrations driven by upstream API drift:

- RuntimeDebug is no longer re-exported from sp_core / sp_runtime;
  switched derives to core::fmt::Debug.
- ExecuteBlock trait split into verify_and_remove_seal +
  execute_verified_block; pallet-author-inherent's BlockExecutor
  delegates accordingly.
- ConsensusDataProvider lost its Proof associated type and now takes
  a concrete StorageProof in append_block_import. Dropped the now
  unused P generic from NimbusManualSealConsensusDataProvider.
- cumulus-client-consensus-proposer was removed upstream
  (paritytech/polkadot-sdk#9947). Vendored a moonkit-local
  ProposerInterface inside nimbus-consensus that wraps the new
  sp_consensus::ProposeArgs API. The collator now owns the
  ProofRecorder, registers ProofSizeExt, and drains the proof after
  proposing — same proof-recording semantics as before.
- ProposerFactory dropped its EnableProofRecording generic.
- find_potential_parents / PotentialParent are gone; switched to
  find_parent_for_building / ParentSearchResult. ParentSearchParams
  no longer takes max_depth or ignore_alternative_branches; depth is
  now derived from header numbers via Saturating.
- ParachainInherentDataProvider::create_at takes RelayProofRequest
  instead of Vec<Vec<u8>>; we wrap raw keys as RelayStorageKey::Top.
- SubmitCollationParams gained scheduling_parent (Some -> V3, None
  preserves V2 semantics).
- AssetClaims removed from xcm Config; the new TrapAndClaimAssets
  bound on AssetTrap covers both.
- AssetsInHolding now tracks ImbalanceAccounting credits, no longer
  From<Vec<Asset>>. xcm-utils precompile uses
  xcm_executor::test_helpers::mock_asset_to_holding for its
  fee-estimation read path and unwraps credits via .amount().
- sp_session::SessionKeys runtime API moved to v2:
  generate_session_keys(seed) -> Vec<u8> became
  generate_session_keys(owner, seed) -> OpaqueGeneratedSessionKeys.
- sc_service::BuildNetworkParams gained spawn_essential_handle and
  new_full_parts gained pruning_filters; threaded through.
- MockValidationDataInherentDataProvider gained relay_parent_offset
  (defaulted to 0 in the template).

frontier deps temporarily point to moonbeam-foundation/frontier
mb/polkadot-sdk-stable2603 since polkadot-evm/frontier#1892 is still
open. Once that lands, we can flip back to upstream stable2603.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

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

This PR upgrades workspace dependencies to stable2603, adds a local ProposerInterface/Error, refactors collator parent-finding and proof-recording (including ProofRecorder usage), simplifies manual-seal generics, updates derives and mock XCM/EVM holdings, and syncs template runtime/service APIs with the new SDK.

Changes

Substrate SDK Upgrade and ProposerInterface Abstraction

Layer / File(s) Summary
Workspace Dependencies
Cargo.toml
Adds anyhow and thiserror; updates Substrate/Cumulus/Polkadot/Frontier git dependency branches from stable2512stable2603.
Nimbus Consensus Dependencies
client/consensus/nimbus-consensus/Cargo.toml, template/node/Cargo.toml
Adds sp-externalities, sc-basic-authorship, sc-transaction-pool-api, anyhow, thiserror to nimbus-consensus and removes cumulus-client-consensus-proposer from nimbus-consensus and template node.
Local ProposerInterface Module
client/consensus/nimbus-consensus/src/proposer.rs, client/consensus/nimbus-consensus/src/lib.rs
Adds Error wrapper, ProposerInterface async trait, ProposerFactory impl, and re-exports proposer symbols.
Collator Core - Parent Finding & Proof Recording
client/consensus/nimbus-consensus/src/collator.rs, client/consensus/nimbus-consensus/src/collators.rs
Translate raw additional_relay_state keys to typed RelayProofRequest; call find_parent_for_building; construct ProofRecorder and sp_externalities::Extensions, pass to proposer, and drain storage proof into ParachainCandidate.
Collator Import & Param Updates
client/consensus/nimbus-consensus/src/collators/basic.rs, .../slot_based/mod.rs, .../slot_based/collation_task.rs
Switch ProposerInterface imports to crate::ProposerInterface and set scheduling_parent: None when submitting collations.
Lookahead Collator
client/consensus/nimbus-consensus/src/collators/lookahead.rs
Use find_parent_for_building to get included and best parent headers; compute unincluded-segment lengths via saturating arithmetic; set scheduling_parent: None on submission.
Slot-Based Collator
client/consensus/nimbus-consensus/src/collators/slot_based/block_builder_task.rs, .../collation_task.rs
Destructure find_parent result to included_header/parent_header, compute parent_hash and unincluded_segment_len from header numbers, update logging, and set scheduling_parent: None.
Manual Seal Type Simplification
client/consensus/nimbus-consensus/src/manual_seal.rs
Remove generic Proof parameter from NimbusManualSealConsensusDataProvider; replace PhantomData<P> with PhantomData<()>; accept StorageProof in append_block_import.
Author Inherent Executor
pallets/author-inherent/src/exec.rs
Split execute_block into verify_and_remove_seal (strip+verify seal) and execute_verified_block (delegate to inner executor).
Type Derives
pallets/author-mapping/src/mock.rs, pallets/randomness/src/types.rs, primitives/session-keys/src/digest.rs
Replace RuntimeDebug derives with standard Debug for listed types.
Precompiles, XCM, and Mocks
precompiles/xcm-utils/src/lib.rs, precompiles/*/src/mock.rs, precompiles/assets-erc20/src/tests.rs
Add local HoldingCredit and asset_to_holding; change precompile fee-trader usage to AssetsInHolding; adapt mock TransactAsset and WeightTrader APIs to AssetsInHolding and tuple-error returns; add TransactionGasLimit = () to many EVM mock configs; adjust fp_evm imports; and increase expected gas/costs in ERC20 precompile tests.
Template service & runtime
template/node/src/service.rs, template/runtime/src/lib.rs
Pass extra Vec::new() into new_full_parts, supply spawn_essential_handle to build_network, set mock relay_parent_offset: 0, use BlockLength::builder() for RuntimeBlockLength, change generate_session_keys signature to accept owner and return OpaqueGeneratedSessionKeys, and update benchmark error string type.

🎯 4 (Complex) | ⏱️ ~50 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Bump polkadot-sdk to stable2603' is concise, clear, and directly summarizes the main change: upgrading the polkadot-sdk dependency version.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing all major API migrations, code changes, and test plans driven by the polkadot-sdk upgrade.
Docstring Coverage ✅ Passed Docstring coverage is 95.24% which is sufficient. The required threshold is 80.00%.
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.

✏️ 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 mb/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 and usage tips.

@manuelmauro manuelmauro changed the title chore: bump polkadot-sdk to stable2603 Bump polkadot-sdk to stable2603 May 7, 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: 1

Caution

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

⚠️ Outside diff range comments (2)
template/runtime/src/lib.rs (1)

861-865: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

relay_parent_offset() returns 2 but ParachainSystem::RelayParentOffset is ConstU32<0>.

These two values are semantically tied: the collator uses the runtime API to derive how far back to anchor the relay parent, while the parachain-system pallet enforces the on-chain offset. Returning 2 here while configuring ConstU32<0> at line 423 will cause the collator and pallet to disagree, which can lead to inherent/validation mismatches when block-building. The PR description also states the template default should be 0. Please align them (likely return 0, or expose a single parameter_types! constant used in both places).

🔧 Suggested fix
 	impl cumulus_primitives_core::RelayParentOffsetApi<Block> for Runtime {
 		fn relay_parent_offset() -> u32 {
-			2
+			0
 		}
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@template/runtime/src/lib.rs` around lines 861 - 865, The runtime API impl for
cumulus_primitives_core::RelayParentOffsetApi currently returns 2 while the
parachain-system pallet sets ParachainSystem::RelayParentOffset = ConstU32<0>,
causing a mismatch; update the impl for Runtime::relay_parent_offset() to return
0 (or refactor both to read the same parameter by introducing a shared parameter
type/constant) so the value used by the collator (relay_parent_offset) and the
on-chain ParachainSystem::RelayParentOffset are identical.
client/consensus/nimbus-consensus/src/collators/slot_based/mod.rs (1)

30-32: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale doc link to removed find_potential_parents.

Per the stable2603 API rename (find_potential_parentsfind_parent_for_building, PotentialParentParentSearchResult), this intra-doc link is now stale and will fail rustdoc resolution. Update to point to the new symbol.

📝 Suggested fix
-//! 2. Retrieves the current best relay chain block and identifies a valid parent block (see
-//!    [find_potential_parents][cumulus_client_consensus_common::find_potential_parents] for parent
-//!    selection criteria)
+//! 2. Retrieves the current best relay chain block and identifies a valid parent block (see
+//!    [find_parent_for_building][cumulus_client_consensus_common::find_parent_for_building] for
+//!    parent selection criteria)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/consensus/nimbus-consensus/src/collators/slot_based/mod.rs` around
lines 30 - 32, Update the stale intra-doc link that references
cumul_us_client_consensus_common::find_potential_parents to the new API names:
replace references to find_potential_parents with find_parent_for_building and
any mention of PotentialParent with ParentSearchResult in the doc comment block
(e.g., the comment in slot_based::mod.rs that links to the parent-selection
helper), ensuring the intra-doc link target is
cumul_us_client_consensus_common::find_parent_for_building (and update the
bracketed link text if needed) so rustdoc resolves correctly.
🧹 Nitpick comments (6)
client/consensus/nimbus-consensus/src/collators.rs (2)

254-289: 💤 Low value

find_parent migration LGTM, but consider distinguishing transient from terminal failures in logs.

The Ok(None) branch logs a warn! saying "Could not find parent to build upon". This can fire frequently and benignly during startup or when the relay chain hasn't progressed enough yet, which makes warn-level noisy. Consider downgrading to debug! or qualifying the message; keep error! only for the Err(_) case which already represents a real fetch failure.

📝 Suggested fix
-		Ok(None) => {
-			tracing::warn!(
-				target: crate::LOG_TARGET,
-				?relay_parent,
-				"Could not find parent to build upon.",
-			);
-			None
-		}
+		Ok(None) => {
+			tracing::debug!(
+				target: crate::LOG_TARGET,
+				?relay_parent,
+				"No suitable parent to build upon at this relay parent.",
+			);
+			None
+		}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/consensus/nimbus-consensus/src/collators.rs` around lines 254 - 289,
The warning log in the Ok(None) branch of the find_parent flow (around the call
to cumulus_client_consensus_common::find_parent_for_building::<Block>) should be
downgraded to a lower-severity log because missing a parent can be transient;
change the tracing::warn! that logs "Could not find parent to build upon." to
tracing::debug! (or add a qualifier like "transient/no parents yet") so only
real failures remain at error level (the Err(e) branch remains unchanged);
update the log target and captured ?relay_parent usage exactly where the
Ok(None) branch returns None.

54-61: 💤 Low value

PARENT_SEARCH_DEPTH is unused and should be removed.

The constant at line 61 is not referenced anywhere in the codebase. The ParentSearchParams struct now derives depth via ancestry_lookback (calculated from scheduling_lookahead().saturating_sub(1)), eliminating the need for this hardcoded limit. Remove the constant and its explanatory comment to clean up the code.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/consensus/nimbus-consensus/src/collators.rs` around lines 54 - 61,
Remove the unused constant and its comment: delete the PARENT_SEARCH_DEPTH
constant declaration and its explanatory comment block since ParentSearchParams
now derives depth via ancestry_lookback (from
scheduling_lookahead().saturating_sub(1)); ensure no other code references
PARENT_SEARCH_DEPTH and leave ParentSearchParams/ancestry_lookback logic intact.
Cargo.toml (1)

221-223: ⚡ Quick win

Pin the Frontier fork to a rev and track migration back to upstream.

These three deps now point to moonbeam-foundation/frontier on a feature branch (mb/polkadot-sdk-stable2603). Branch-only git refs are reproducibility hazards: the branch can be force-pushed, deleted, or rebased, which silently changes consumer builds and undermines Cargo.lock guarantees for downstream consumers. Please pin a rev = "<commit-sha>" for each of these three crates until upstream polkadot-evm/frontier lands stable2603 and you can revert. Consider tracking the revert with a TODO/issue link next to these entries.

🔧 Suggested change
-fp-evm = { git = "https://github.com/moonbeam-foundation/frontier", branch = "mb/polkadot-sdk-stable2603", default-features = false }
-pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", branch = "mb/polkadot-sdk-stable2603", default-features = false }
-precompile-utils = { git = "https://github.com/moonbeam-foundation/frontier", branch = "mb/polkadot-sdk-stable2603", default-features = false }
+# TODO: revert to polkadot-evm/frontier once stable2603 lands upstream.
+fp-evm = { git = "https://github.com/moonbeam-foundation/frontier", branch = "mb/polkadot-sdk-stable2603", rev = "<pin-sha>", default-features = false }
+pallet-evm = { git = "https://github.com/moonbeam-foundation/frontier", branch = "mb/polkadot-sdk-stable2603", rev = "<pin-sha>", default-features = false }
+precompile-utils = { git = "https://github.com/moonbeam-foundation/frontier", branch = "mb/polkadot-sdk-stable2603", rev = "<pin-sha>", default-features = false }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Cargo.toml` around lines 221 - 223, The three git dependencies fp-evm,
pallet-evm, and precompile-utils are using a branch ref which is a
reproducibility risk; replace the branch-only refs with pinned commit SHAs by
adding rev = "<commit-sha>" (e.g. fp-evm = { git = "...", rev = "<sha>",
default-features = false }) for each crate, optionally keep branch for human
context, then run cargo update to refresh Cargo.lock; also add a short TODO
comment next to each entry indicating this is a temporary pin and include an
issue/link to revert when upstream polkadot-evm/frontier lands stable2603.
precompiles/xcm-utils/src/lib.rs (1)

22-22: 💤 Low value

Remove the unused ImbalanceAccounting import.

The import on line 22 is not used in any actual code. The .amount() method called on line 185 is inherent to the Credit type and does not require the trait to be in scope. The import only appears in comments documenting the change in stable2603.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@precompiles/xcm-utils/src/lib.rs` at line 22, Remove the unused import
ImbalanceAccounting from the precompiles xcm-utils lib (it's not referenced by
code and only appears in comments); delete the use
frame_support::traits::tokens::imbalance::ImbalanceAccounting; line so the
compiler no longer warns, and leave the Credit type and its .amount() usage
intact (no trait in-scope change needed).
client/consensus/nimbus-consensus/src/proposer.rs (1)

38-58: ⚡ Quick win

Add #[source] to inner to guarantee correct Error::source() delegation.

#[error(transparent)] on a struct is shown in thiserror's canonical example as a tuple struct pub struct PublicError(#[from] ErrorRepr) — the #[from] (or #[source]) annotation explicitly marks the transparent field. For a named-field struct without either annotation, thiserror may not wire Error::source() to delegate through inner. Without this, error-chain reporters that traverse source() will stop at Error and drop the full anyhow context chain.

🔧 Proposed fix
 #[derive(thiserror::Error, Debug)]
 #[error(transparent)]
 pub struct Error {
-	inner: anyhow::Error,
+	#[source]
+	inner: anyhow::Error,
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/consensus/nimbus-consensus/src/proposer.rs` around lines 38 - 58, The
Error struct's inner anyhow::Error field lacks the #[source] annotation so
thiserror may not delegate Error::source() through inner; update the struct
declaration for Error to annotate the inner field with #[source] (i.e., mark the
inner field as the source) so that source() and error-chain traversal correctly
delegate through inner; keep the existing deriving and the proposer_creation and
proposing constructors unchanged aside from this annotation.
client/consensus/nimbus-consensus/src/collators/lookahead.rs (1)

24-24: 💤 Low value

Redundant import — ProposerInterface is already in scope via the use crate::* glob on line 17.

This explicit re-import at Line 24 is a no-op but may produce an unused_import warning under stricter lint settings.

🔧 Suggested fix
-use crate::ProposerInterface;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/consensus/nimbus-consensus/src/collators/lookahead.rs` at line 24,
Remove the redundant explicit import of ProposerInterface (the `use
crate::ProposerInterface;` line) because it is already brought into scope by the
existing `use crate::*;` glob; delete that single import to avoid unused_import
warnings and keep the module imports consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pallets/author-inherent/src/exec.rs`:
- Around line 98-100: Remove the redundant call to
I::verify_and_remove_seal(block) inside the BlockExecutor flow: BlockExecutor
already performs Nimbus seal verification/removal, so delete the delegation to
I::verify_and_remove_seal before calling execute_verified_block; ensure the code
only relies on the single seal removal performed by BlockExecutor (and does not
assume frame_executive::Executive::verify_and_remove_seal is a no-op) so any
ExecuteBlock implementation will receive an already-unsealed block when
execute_verified_block is invoked.

---

Outside diff comments:
In `@client/consensus/nimbus-consensus/src/collators/slot_based/mod.rs`:
- Around line 30-32: Update the stale intra-doc link that references
cumul_us_client_consensus_common::find_potential_parents to the new API names:
replace references to find_potential_parents with find_parent_for_building and
any mention of PotentialParent with ParentSearchResult in the doc comment block
(e.g., the comment in slot_based::mod.rs that links to the parent-selection
helper), ensuring the intra-doc link target is
cumul_us_client_consensus_common::find_parent_for_building (and update the
bracketed link text if needed) so rustdoc resolves correctly.

In `@template/runtime/src/lib.rs`:
- Around line 861-865: The runtime API impl for
cumulus_primitives_core::RelayParentOffsetApi currently returns 2 while the
parachain-system pallet sets ParachainSystem::RelayParentOffset = ConstU32<0>,
causing a mismatch; update the impl for Runtime::relay_parent_offset() to return
0 (or refactor both to read the same parameter by introducing a shared parameter
type/constant) so the value used by the collator (relay_parent_offset) and the
on-chain ParachainSystem::RelayParentOffset are identical.

---

Nitpick comments:
In `@Cargo.toml`:
- Around line 221-223: The three git dependencies fp-evm, pallet-evm, and
precompile-utils are using a branch ref which is a reproducibility risk; replace
the branch-only refs with pinned commit SHAs by adding rev = "<commit-sha>"
(e.g. fp-evm = { git = "...", rev = "<sha>", default-features = false }) for
each crate, optionally keep branch for human context, then run cargo update to
refresh Cargo.lock; also add a short TODO comment next to each entry indicating
this is a temporary pin and include an issue/link to revert when upstream
polkadot-evm/frontier lands stable2603.

In `@client/consensus/nimbus-consensus/src/collators.rs`:
- Around line 254-289: The warning log in the Ok(None) branch of the find_parent
flow (around the call to
cumulus_client_consensus_common::find_parent_for_building::<Block>) should be
downgraded to a lower-severity log because missing a parent can be transient;
change the tracing::warn! that logs "Could not find parent to build upon." to
tracing::debug! (or add a qualifier like "transient/no parents yet") so only
real failures remain at error level (the Err(e) branch remains unchanged);
update the log target and captured ?relay_parent usage exactly where the
Ok(None) branch returns None.
- Around line 54-61: Remove the unused constant and its comment: delete the
PARENT_SEARCH_DEPTH constant declaration and its explanatory comment block since
ParentSearchParams now derives depth via ancestry_lookback (from
scheduling_lookahead().saturating_sub(1)); ensure no other code references
PARENT_SEARCH_DEPTH and leave ParentSearchParams/ancestry_lookback logic intact.

In `@client/consensus/nimbus-consensus/src/collators/lookahead.rs`:
- Line 24: Remove the redundant explicit import of ProposerInterface (the `use
crate::ProposerInterface;` line) because it is already brought into scope by the
existing `use crate::*;` glob; delete that single import to avoid unused_import
warnings and keep the module imports consistent.

In `@client/consensus/nimbus-consensus/src/proposer.rs`:
- Around line 38-58: The Error struct's inner anyhow::Error field lacks the
#[source] annotation so thiserror may not delegate Error::source() through
inner; update the struct declaration for Error to annotate the inner field with
#[source] (i.e., mark the inner field as the source) so that source() and
error-chain traversal correctly delegate through inner; keep the existing
deriving and the proposer_creation and proposing constructors unchanged aside
from this annotation.

In `@precompiles/xcm-utils/src/lib.rs`:
- Line 22: Remove the unused import ImbalanceAccounting from the precompiles
xcm-utils lib (it's not referenced by code and only appears in comments); delete
the use frame_support::traits::tokens::imbalance::ImbalanceAccounting; line so
the compiler no longer warns, and leave the Credit type and its .amount() usage
intact (no trait in-scope change needed).
🪄 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: b3137481-78ea-4e9f-b352-644ac177cc65

📥 Commits

Reviewing files that changed from the base of the PR and between c0cf857 and 2d34f85.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • Cargo.toml
  • client/consensus/nimbus-consensus/Cargo.toml
  • client/consensus/nimbus-consensus/src/collator.rs
  • client/consensus/nimbus-consensus/src/collators.rs
  • client/consensus/nimbus-consensus/src/collators/basic.rs
  • client/consensus/nimbus-consensus/src/collators/lookahead.rs
  • client/consensus/nimbus-consensus/src/collators/slot_based/block_builder_task.rs
  • client/consensus/nimbus-consensus/src/collators/slot_based/collation_task.rs
  • client/consensus/nimbus-consensus/src/collators/slot_based/mod.rs
  • client/consensus/nimbus-consensus/src/lib.rs
  • client/consensus/nimbus-consensus/src/manual_seal.rs
  • client/consensus/nimbus-consensus/src/proposer.rs
  • pallets/author-inherent/src/exec.rs
  • pallets/author-mapping/src/mock.rs
  • pallets/randomness/src/types.rs
  • precompiles/xcm-utils/src/lib.rs
  • primitives/session-keys/src/digest.rs
  • template/node/Cargo.toml
  • template/node/src/service.rs
  • template/runtime/src/lib.rs
💤 Files with no reviewable changes (1)
  • template/node/Cargo.toml

Comment thread pallets/author-inherent/src/exec.rs Outdated
Fix the rustfmt drift and the dead-code error on PARENT_SEARCH_DEPTH that
was blocking build, build-features, and rust-test (the latter at compile
time, masking several dormant blockers in the workspace). With the lint
unblocked, address the now-surfaced issues:

- Switch to the new BlockLength builder, scale_info String for the
  benchmark API, and ProposerFactory::new (deprecation removals).
- Add TransactionGasLimit to all pallet_evm mocks (new stable2603 item).
- Update xcm-utils and pallet-xcm mocks for the new TransactAsset and
  WeightTrader signatures, AssetsInHolding API, and removed AssetClaims.
- Recalibrate assets-erc20 expect_cost values for the new pallet-assets
  weights.
- Drop pre-existing unused imports (fp_evm::ExitError, sp_std::vec)
  surfaced by the unblocked build.

Review feedback:
- Drop the redundant I::verify_and_remove_seal call in author-inherent;
  BlockExecutor already strips the seal before delegating.
- Align template runtime relay_parent_offset() with ConstU32<0> to match
  the parachain-system config.
- Update stale find_potential_parents intra-doc link to
  find_parent_for_building.
- Remove redundant `use crate::ProposerInterface` re-imports already
  brought in via `use crate::*`.
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@precompiles/xcm-utils/src/lib.rs`:
- Around line 161-183: The call to
xcm_executor::test_helpers::mock_asset_to_holding in the trader.buy_weight path
is gated behind the xcm-executor "runtime-benchmarks" feature and is unavailable
with the current dependency features; either enable that feature in the crate's
Cargo.toml for xcm-executor (add features = ["runtime-benchmarks"]) so
mock_asset_to_holding can be used, or replace the helper by constructing an
AssetsInHolding equivalent directly (build an AssetsInHolding/holding that maps
multiasset.id to an ImbalanceAccounting-like value or a holding type whose
.amount() yields the u128 balance) and pass that into trader.buy_weight (the
variables to change are the mock_asset_to_holding call, the unused binding
returned by trader.buy_weight, and subsequent use of
unused.fungible.get(&multiasset.id).map(|credit| credit.amount())).
🪄 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: ceb144c0-cd90-4997-b126-87c1a8d668e8

📥 Commits

Reviewing files that changed from the base of the PR and between 2d34f85 and 0df632f.

📒 Files selected for processing (20)
  • client/consensus/nimbus-consensus/src/collator.rs
  • client/consensus/nimbus-consensus/src/collators.rs
  • client/consensus/nimbus-consensus/src/collators/basic.rs
  • client/consensus/nimbus-consensus/src/collators/lookahead.rs
  • client/consensus/nimbus-consensus/src/collators/slot_based/block_builder_task.rs
  • client/consensus/nimbus-consensus/src/collators/slot_based/mod.rs
  • pallets/author-inherent/src/exec.rs
  • pallets/author-mapping/src/mock.rs
  • precompiles/assets-erc20/src/lib.rs
  • precompiles/assets-erc20/src/mock.rs
  • precompiles/assets-erc20/src/tests.rs
  • precompiles/balances-erc20/src/mock.rs
  • precompiles/batch/src/mock.rs
  • precompiles/call-permit/src/mock.rs
  • precompiles/pallet-xcm/src/mock.rs
  • precompiles/proxy/src/mock.rs
  • precompiles/xcm-utils/src/lib.rs
  • precompiles/xcm-utils/src/mock.rs
  • template/node/src/service.rs
  • template/runtime/src/lib.rs
💤 Files with no reviewable changes (1)
  • client/consensus/nimbus-consensus/src/collators/basic.rs
✅ Files skipped from review due to trivial changes (3)
  • precompiles/assets-erc20/src/mock.rs
  • client/consensus/nimbus-consensus/src/collators/slot_based/mod.rs
  • precompiles/assets-erc20/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (5)
  • pallets/author-mapping/src/mock.rs
  • template/runtime/src/lib.rs
  • client/consensus/nimbus-consensus/src/collators/slot_based/block_builder_task.rs
  • client/consensus/nimbus-consensus/src/collators/lookahead.rs
  • client/consensus/nimbus-consensus/src/collators.rs

Comment thread precompiles/xcm-utils/src/lib.rs
Make `RelayParentOffsetApi::relay_parent_offset()` defer to
`<Runtime as cumulus_pallet_parachain_system::Config>::RelayParentOffset::get()`
so the off-chain advertised offset and the on-chain enforced offset
share a single source of truth. Previously the two values had to be
kept in sync by convention, which is what allowed the `2` vs
`ConstU32<0>` mismatch that 0df632f had to correct.
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.

🧹 Nitpick comments (1)
template/runtime/src/lib.rs (1)

425-426: ⚡ Quick win

Confirm intentional behavioral change: template relay_parent_offset() now returns 0 (was hardcoded 2).

With type RelayParentOffset = ConstU32<0>; at Line 425, the RelayParentOffsetApi::relay_parent_offset() runtime API now returns 0 rather than the previously hardcoded 2. This is consistent with the PR commit message (single source of truth) and the template node update to relay_parent_offset: 0 in MockValidationDataInherentDataProvider.

Worth calling out explicitly in release/migration notes since downstream users copying this template (or relying on the previous offset of 2) will see different async-backing behavior. Downstream runtimes (e.g., Moonbeam) should set RelayParentOffset to whatever value they actually want advertised by the runtime API.

Also applies to: 863-867

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@template/runtime/src/lib.rs` around lines 425 - 426, The runtime now sets
RelayParentOffset = ConstU32<0>, so RelayParentOffsetApi::relay_parent_offset()
returns 0 instead of the previous hardcoded 2; either revert the type alias to
ConstU32<2> in the runtime (change type RelayParentOffset = ConstU32<0> back to
ConstU32<2> if you want the old behavior) or, if 0 is intended, add an explicit
migration/release note and update MockValidationDataInherentDataProvider’s
relay_parent_offset value and any downstream docs/examples to call out this
breaking behavioral change so integrators (e.g., Moonbeam) can choose their
desired RelayParentOffset.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@template/runtime/src/lib.rs`:
- Around line 425-426: The runtime now sets RelayParentOffset = ConstU32<0>, so
RelayParentOffsetApi::relay_parent_offset() returns 0 instead of the previous
hardcoded 2; either revert the type alias to ConstU32<2> in the runtime (change
type RelayParentOffset = ConstU32<0> back to ConstU32<2> if you want the old
behavior) or, if 0 is intended, add an explicit migration/release note and
update MockValidationDataInherentDataProvider’s relay_parent_offset value and
any downstream docs/examples to call out this breaking behavioral change so
integrators (e.g., Moonbeam) can choose their desired RelayParentOffset.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c075ed8a-9167-41f4-bb22-77c0811a4ae9

📥 Commits

Reviewing files that changed from the base of the PR and between 0df632f and 39580d8.

📒 Files selected for processing (1)
  • template/runtime/src/lib.rs

`polkadot-evm/frontier#1892` merged, cutting `stable2603` from the
canonical upstream. Drop the temporary `moonbeam-foundation/frontier:
mb/polkadot-sdk-stable2603` fork in favour of `polkadot-evm/frontier:
stable2603` for `fp-evm`, `pallet-evm`, and `precompile-utils`.
- ProposerInterface::propose: drop the always-`Some` Option from the
  return type. The impl never yields `Ok(None)`, so the caller's
  `match` arm was dead code; collator.rs simplified accordingly.
- lookahead collator: log at debug level when `find_parent_for_building`
  returns no parent, instead of silently skipping the slot.
- xcm-utils precompile: note that `xcm_executor::test_helpers` is a
  test-only upstream module and should be replaced with a stable API
  before relying on it long-term.
npmjs.com returns HTTP 403 to the link-checker bot, which failed the
check-links job on otherwise-valid links in template/README.md.
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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@precompiles/xcm-utils/src/lib.rs`:
- Around line 168-176: The code is calling the internal test helper
xcm_executor::test_helpers::mock_asset_to_holding from trader.buy_weight, which
is unstable for production; replace that call with a local stable adapter (e.g.,
a new function in this crate) that converts the MultiAsset (multiasset) into the
required Holding type and use that adapter when calling trader.buy_weight with
the same Weight and &ctx arguments; implement the adapter to mirror the minimal
behavior needed by trader.buy_weight so the precompile no longer depends on
xcm_executor::test_helpers::mock_asset_to_holding.
🪄 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: 79b14d7d-6560-4496-96a6-a8980461c486

📥 Commits

Reviewing files that changed from the base of the PR and between 39580d8 and 56e4a92.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .linkspector.yml
  • Cargo.toml
  • client/consensus/nimbus-consensus/src/collator.rs
  • client/consensus/nimbus-consensus/src/collators/lookahead.rs
  • client/consensus/nimbus-consensus/src/proposer.rs
  • precompiles/xcm-utils/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • client/consensus/nimbus-consensus/src/collator.rs
  • client/consensus/nimbus-consensus/src/collators/lookahead.rs

Comment thread precompiles/xcm-utils/src/lib.rs Outdated
… adapter

Stop depending on xcm_executor::test_helpers::mock_asset_to_holding in the
get_units_per_second precompile. The upstream test_helpers module is internal-
only and may change or be removed without a deprecation cycle. Add a moonkit-
local HoldingCredit + asset_to_holding adapter that builds the AssetsInHolding
needed by WeightTrader::buy_weight using only stable public traits.
…lSealConsensusDataProvider

The `_phantom: PhantomData<P>` field existed to carry the `P` generic. `P`
was removed during the stable2603 manual-seal type simplification and the
field became `PhantomData<()>` — a no-op zero-sized field with no variance,
drop, or lifetime info to carry. Drop the field and its template construction
site.
…odule

The trait-glue needed to feed WeightTrader::buy_weight in the fee-estimation
precompile is mostly type-system boilerplate, not precompile logic. Pull it
out into `holding.rs` so lib.rs stays focused on the precompile surface.
Replace the npmjs.com package link in the template README with the Zombienet
docs install page anchored at the "Using NPM" section, which documents the
same install command. Revert the linkspector ignorePatterns hack — the
remaining links resolve cleanly.
The file only set `dirs: - .`, which is linkspector's default. The CI step
invokes the action without a `config_file:` parameter, so removing the file
falls back to the same default scan.
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