From 84ac53a5102f7726e0b035ba1bd74c99fac34821 Mon Sep 17 00:00:00 2001 From: Amir Pasha Motamed Date: Wed, 7 Feb 2024 17:12:59 +0330 Subject: [PATCH] Disable state root validation in Merkle stage --- bin/reth/Cargo.toml | 1 + crates/stages/Cargo.toml | 1 + crates/stages/src/stages/merkle.rs | 2 ++ 3 files changed, 4 insertions(+) diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index 1aa49c2caf0e..c1a3f0224796 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -185,6 +185,7 @@ telos = [ "reth-primitives/telos", "reth-provider/telos", "reth-consensus-common/telos", + "reth-stages/telos", ] [[bin]] diff --git a/crates/stages/Cargo.toml b/crates/stages/Cargo.toml index 337d582e22d7..616e4dbe0a95 100644 --- a/crates/stages/Cargo.toml +++ b/crates/stages/Cargo.toml @@ -83,6 +83,7 @@ serde_json.workspace = true [features] test-utils = ["reth-interfaces/test-utils", "reth-db/test-utils"] +telos = [] [[bench]] name = "criterion" diff --git a/crates/stages/src/stages/merkle.rs b/crates/stages/src/stages/merkle.rs index b56b6ea7e0c8..bf694fd00c81 100644 --- a/crates/stages/src/stages/merkle.rs +++ b/crates/stages/src/stages/merkle.rs @@ -251,6 +251,7 @@ impl Stage for MerkleStage { // Reset the checkpoint self.save_execution_checkpoint(provider, None)?; + #[cfg(not(feature = "telos"))] validate_state_root(trie_root, target_block.seal_slow(), to_block)?; Ok(ExecOutput { @@ -301,6 +302,7 @@ impl Stage for MerkleStage { let target = provider .header_by_number(input.unwind_to)? .ok_or_else(|| ProviderError::HeaderNotFound(input.unwind_to.into()))?; + #[cfg(not(feature = "telos"))] validate_state_root(block_root, target.seal_slow(), input.unwind_to)?; // Validation passed, apply unwind changes to the database.