Skip to content

Commit

Permalink
omni-node: Tolerate failing metadata check (#6923)
Browse files Browse the repository at this point in the history
#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

---------

Co-authored-by: command-bot <>
  • Loading branch information
skunert authored Dec 17, 2024
1 parent 0558973 commit e6ddd39
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion cumulus/polkadot-omni-node/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
6 changes: 5 additions & 1 deletion cumulus/polkadot-omni-node/lib/src/common/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ pub struct DefaultRuntimeResolver;

impl RuntimeResolver for DefaultRuntimeResolver {
fn runtime(&self, chain_spec: &dyn ChainSpec) -> sc_cli::Result<Runtime> {
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 => {
Expand Down
12 changes: 12 additions & 0 deletions prdoc/pr_6923.prdoc
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e6ddd39

Please sign in to comment.