Skip to content

Commit

Permalink
Disable state root validation in Merkle stage
Browse files Browse the repository at this point in the history
  • Loading branch information
aamirpashaa committed Feb 29, 2024
1 parent 3bf1c18 commit 84ac53a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ telos = [
"reth-primitives/telos",
"reth-provider/telos",
"reth-consensus-common/telos",
"reth-stages/telos",
]

[[bin]]
Expand Down
1 change: 1 addition & 0 deletions crates/stages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ serde_json.workspace = true

[features]
test-utils = ["reth-interfaces/test-utils", "reth-db/test-utils"]
telos = []

[[bench]]
name = "criterion"
Expand Down
2 changes: 2 additions & 0 deletions crates/stages/src/stages/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ impl<DB: Database> Stage<DB> 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 {
Expand Down Expand Up @@ -301,6 +302,7 @@ impl<DB: Database> Stage<DB> 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.
Expand Down

0 comments on commit 84ac53a

Please sign in to comment.