From e398e42be81c2d780db2192c99a352ce0031838d Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Tue, 17 Dec 2024 10:16:22 +0100 Subject: [PATCH 1/2] Tolerate failing metadata check --- Cargo.lock | 1 - cumulus/polkadot-omni-node/lib/Cargo.toml | 1 - cumulus/polkadot-omni-node/lib/src/common/runtime.rs | 6 +++++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13ba03af5065..0810086f42be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18152,7 +18152,6 @@ dependencies = [ "sp-crypto-hashing 0.1.0", "sp-genesis-builder 0.8.0", "sp-inherents 26.0.0", - "sp-io 30.0.0", "sp-keystore 0.34.0", "sp-runtime 31.0.1", "sp-session 27.0.0", diff --git a/cumulus/polkadot-omni-node/lib/Cargo.toml b/cumulus/polkadot-omni-node/lib/Cargo.toml index 43478b41a119..b1937427be66 100644 --- a/cumulus/polkadot-omni-node/lib/Cargo.toml +++ b/cumulus/polkadot-omni-node/lib/Cargo.toml @@ -69,7 +69,6 @@ sp-inherents = { workspace = true, default-features = true } sp-api = { workspace = true, default-features = true } sp-consensus = { workspace = true, default-features = true } sp-consensus-aura = { workspace = true, default-features = true } -sp-io = { workspace = true, default-features = true } sc-consensus-manual-seal = { workspace = true, default-features = true } sc-sysinfo = { workspace = true, default-features = true } prometheus-endpoint = { workspace = true, default-features = true } diff --git a/cumulus/polkadot-omni-node/lib/src/common/runtime.rs b/cumulus/polkadot-omni-node/lib/src/common/runtime.rs index 2a95f41495a6..fcc1d7f0643e 100644 --- a/cumulus/polkadot-omni-node/lib/src/common/runtime.rs +++ b/cumulus/polkadot-omni-node/lib/src/common/runtime.rs @@ -103,7 +103,11 @@ pub struct DefaultRuntimeResolver; impl RuntimeResolver for DefaultRuntimeResolver { fn runtime(&self, chain_spec: &dyn ChainSpec) -> sc_cli::Result { - let metadata_inspector = MetadataInspector::new(chain_spec)?; + let Ok(metadata_inspector) = MetadataInspector::new(chain_spec) else { + log::info!("Unable to check metadata. Skipping metadata checks. Metadata checks are supported for metadata versions v14 and higher."); + return Ok(Runtime::Omni(BlockNumber::U32, Consensus::Aura(AuraConsensusId::Sr25519))) + }; + let block_number = match metadata_inspector.block_number() { Some(inner) => inner, None => { From 8007fa718d039923e8a6036ce5ca510d8be0c44f Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Tue, 17 Dec 2024 11:53:25 +0000 Subject: [PATCH 2/2] Update from skunert running command 'prdoc --bump patch --audience node_operator' --- prdoc/pr_6923.prdoc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 prdoc/pr_6923.prdoc diff --git a/prdoc/pr_6923.prdoc b/prdoc/pr_6923.prdoc new file mode 100644 index 000000000000..5d88d7158e7f --- /dev/null +++ b/prdoc/pr_6923.prdoc @@ -0,0 +1,12 @@ +title: 'omni-node: Tolerate failing metadata check' +doc: +- audience: Node Operator + description: |- + #6450 introduced metadata checks. Supported are metadata v14 and higher. + + However, of course old chain-specs have a genesis code blob that might be on older version. This needs to be tolerated. We should just skip the checks in that case. + + Fixes #6921 +crates: +- name: polkadot-omni-node-lib + bump: patch