Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: Remove checking of the extrinsics root #5686

Merged
merged 8 commits into from
Oct 18, 2024
18 changes: 0 additions & 18 deletions substrate/client/network/sync/src/strategy/chain_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2285,24 +2285,6 @@ pub fn validate_blocks<Block: BlockT>(
return Err(BadPeer(*peer_id, rep::BAD_BLOCK));
}
}
if let (Some(header), Some(body)) = (&b.header, &b.body) {
let expected = *header.extrinsics_root();
let got = HashingFor::<Block>::ordered_trie_root(
body.iter().map(Encode::encode).collect(),
sp_runtime::StateVersion::V0,
);
if expected != got {
debug!(
target: LOG_TARGET,
"Bad extrinsic root for a block {} received from {}. Expected {:?}, got {:?}",
b.hash,
peer_id,
expected,
got,
);
return Err(BadPeer(*peer_id, rep::BAD_BLOCK));
}
}
}

Ok(blocks.first().and_then(|b| b.header.as_ref()).map(|h| *h.number()))
Expand Down
Loading