Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3b0bc90
fix(cumulus): add ah-westend-local parachain info genesis patch
iulianbarbu Jul 14, 2025
507d9a0
ah-westend: impl GetParachainInfo
iulianbarbu Jul 14, 2025
c0bc83f
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Jul 14, 2025
dcb077d
Update from github-actions[bot] running command 'prdoc'
github-actions[bot] Jul 14, 2025
a715b82
update prdoc
iulianbarbu Jul 15, 2025
18d7acf
Merge branch 'master' of github.com:paritytech/polkadot-sdk into fix-…
iulianbarbu Jul 15, 2025
ed6758b
Apply suggestions from code review
iulianbarbu Jul 15, 2025
0eba8c1
Update prdoc/pr_9201.prdoc
iulianbarbu Jul 15, 2025
f79eae8
Update prdoc/pr_9201.prdoc
iulianbarbu Jul 16, 2025
f3a286c
Update prdoc/pr_9201.prdoc
iulianbarbu Jul 16, 2025
cc19091
Update pr_9201.prdoc
iulianbarbu Jul 18, 2025
22354df
remove para_id deprecation from logs/docs/code
iulianbarbu Jul 22, 2025
bc8b8f2
chain-spec-builder: update docs
iulianbarbu Aug 1, 2025
8604bc8
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 1, 2025
09297cb
Apply suggestions from code review
iulianbarbu Aug 1, 2025
b41cd14
chain-spec-builder: update README
iulianbarbu Aug 1, 2025
507b83b
fix/prdoc: remvoe paranthesis audience
iulianbarbu Aug 1, 2025
0b2aff5
polkadot-omni-node-lib: add extensions relay chain getter
iulianbarbu Aug 1, 2025
9d2ccdd
polkadot-parachain: fix clippy
iulianbarbu Aug 1, 2025
8141807
polkadot-omni-node-lib: ensure GetParachainInfo is implemented before…
iulianbarbu Aug 7, 2025
2ffdafb
Update prdoc/pr_9201.prdoc
iulianbarbu Aug 7, 2025
1caf869
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 8, 2025
2e347ca
update prdoc
iulianbarbu Aug 12, 2025
17b8e3b
experiment check-semver
iulianbarbu Aug 12, 2025
b31f3f3
install parity-publish with locked
iulianbarbu Aug 12, 2025
782da88
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 12, 2025
e01266b
Update cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs
iulianbarbu Aug 13, 2025
3ebdfeb
Revert "install parity-publish with locked"
iulianbarbu Aug 12, 2025
c352e00
Revert "experiment check-semver"
iulianbarbu Aug 12, 2025
f92533b
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 13, 2025
fc3e651
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 18, 2025
5e572b8
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 18, 2025
324a32a
Merge branch 'master' into fix-ah-westend-local-starting
sandreim Aug 19, 2025
f650be3
simplify para_id genesis patching
iulianbarbu Aug 20, 2025
10c7a31
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 20, 2025
6d3949c
remove extra para_id params
iulianbarbu Aug 20, 2025
63d3097
fix clippy
iulianbarbu Aug 20, 2025
a380e04
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 20, 2025
165494a
Merge branch 'master' into fix-ah-westend-local-starting
iulianbarbu Aug 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions cumulus/polkadot-omni-node/lib/src/common/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,24 @@ pub(crate) trait BaseNodeSpec {
parachain_config: &Configuration,
) -> Option<ParaId> {
let best_hash = client.chain_info().best_hash;
let para_id = if let Ok(para_id) = client.runtime_api().parachain_id(best_hash) {
para_id
} else {
// TODO: remove this once `para_id` extension is removed: https://github.com/paritytech/polkadot-sdk/issues/8740
#[allow(deprecated)]
let id = ParaId::from(
DeprecatedExtensions::try_get(&*parachain_config.chain_spec)
.and_then(|ext| ext.para_id)?,
);
// TODO: https://github.com/paritytech/polkadot-sdk/issues/8747
// TODO: https://github.com/paritytech/polkadot-sdk/issues/8740
log::info!("Deprecation notice: the parachain id was provided via the chain spec. This way of providing the parachain id to the node is not recommended. The alternative is to implement the `cumulus_primitives_core::GetParachainInfo` runtime API in the runtime, and upgrade it on-chain. Starting with `stable2512` providing the parachain id via the chain spec will not be supported anymore.");
id
let para_id = match client.runtime_api().parachain_id(best_hash) {
Ok(para_id) => para_id,
Err(err) => {
log::info!(
Comment thread
iulianbarbu marked this conversation as resolved.
Outdated
"`cumulus_primitives_core::GetParachainInfo` runtime API call errored with {}",
err
);
// TODO: remove this once `para_id` extension is removed: https://github.com/paritytech/polkadot-sdk/issues/8740
#[allow(deprecated)]
let id = ParaId::from(
DeprecatedExtensions::try_get(&*parachain_config.chain_spec)
.and_then(|ext| ext.para_id)?,
);
// TODO: https://github.com/paritytech/polkadot-sdk/issues/8747
// TODO: https://github.com/paritytech/polkadot-sdk/issues/8740
log::info!("Deprecation notice: the parachain id was provided via the chain spec. This way of providing the parachain id to the node is not recommended. The alternative is to implement the `cumulus_primitives_core::GetParachainInfo` runtime API in the runtime, and upgrade it on-chain. Starting with `stable2512` providing the parachain id via the chain spec will not be supported anymore.");
Comment thread
iulianbarbu marked this conversation as resolved.
Outdated
id
},
};

let parachain_account =
Expand Down
10 changes: 10 additions & 0 deletions cumulus/polkadot-parachain/src/chain_spec/asset_hubs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ pub fn asset_hub_westend_development_config() -> GenericChainSpec {
.with_id("asset-hub-westend-dev")
.with_chain_type(ChainType::Local)
.with_genesis_config_preset_name(sp_genesis_builder::DEV_RUNTIME_PRESET)
.with_genesis_config_patch(serde_json::json!({
"parachainInfo": {
"parachainId": 1000u32,

@skunert skunert Aug 12, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I admit that I forgot if we discussed it before, but is this patch actually necessary? To me it looks like the genesis patch for asset hub westend already contains parachainId 1000:

WND * 1_000_000,
dev_stakers,
1000.into(),
vec![],
vec![],

@iulianbarbu iulianbarbu Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I addressed this, but after an assessment of the need to patch other chain specs, I realized using genesis config isn't needed for asset-hub-rococo and for a few more too. Those functions that patch parachain id with same one from genesis config aren't used in other places, so we can simplify them by removing the para_id parameter.

Changes here: f650be3 + 6d3949c

},
}))
.with_properties(properties)
.build()
}
Expand All @@ -49,6 +54,11 @@ pub fn asset_hub_westend_local_config() -> GenericChainSpec {
.with_id("asset-hub-westend-local")
.with_chain_type(ChainType::Local)
.with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET)
.with_genesis_config_patch(serde_json::json!({
"parachainInfo": {
"parachainId": 1000u32,
},
}))
.with_properties(properties)
.build()
}
Expand Down
11 changes: 11 additions & 0 deletions prdoc/pr_9201.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: '`polkadot-parachain`: added asset-hub-westend-local paracahinInfo genesis patch'
Comment thread
iulianbarbu marked this conversation as resolved.
Outdated
doc:
- audience: [ Runtime Dev, Node Dev, Node Operator ]
Comment thread
iulianbarbu marked this conversation as resolved.
Outdated
description: |-
- Provides some updated to the asset-hub-westend-local chain specification, by adding appropriate gensis patch for parachainInfo.
Comment thread
iulianbarbu marked this conversation as resolved.
Outdated
- refactors the logic related to fetching `para_id` with the node, so that when failing to use `GetParachainInfo::parachain_id` we also get a log with the error (before defaulting to `para_id` extracted from chain spec).
Comment thread
iulianbarbu marked this conversation as resolved.
crates:
- name: polkadot-parachain-bin
bump: minor
- name: polkadot-omni-node-lib
bump: minor
Loading