Skip to content

Commit

Permalink
chore: resume state root assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Aug 27, 2024
1 parent a43182d commit 4616281
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A minimal implementation of generating zero-knowledge proofs of EVM block execut

> [!CAUTION]
>
> This repository is still an active work-in-progress and is not audited or meant for production usage. In particular, there are some edge cases in Ethereum state root computation due to complications with the Merkle Patricia Trie (MPT) that result in the state root computation being slightly incorrect (we're actively working on fixing this). However, the prover time should still be an accurate estimate of proving costs in practice.
> This repository is still an active work-in-progress and is not audited or meant for production usage.
## Getting Started

Expand Down Expand Up @@ -135,10 +135,6 @@ cd ./bin/client-op
cargo prove build
```

**Why does the program say "The state root doesn't match"?**

As mentioned in the introduction, this repository is still a work in progress and some edge cases in the Ethereum MPT result in the state root computation being slightly incorrect for certain blocks. We're actively working on fixing this, but running these client programs on Ethereum and Optimism blocks still provides a very good estimate of realistic cycle count and proving workloads.

**What are good testing blocks**

A good small block to test on for Ethereum mainnet is: `20526624`.
5 changes: 1 addition & 4 deletions crates/executor/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,7 @@ impl ClientExecutor {
rsp_mpt::compute_state_root(&executor_outcome, &input.dirty_storage_proofs, &witness_db)
})?;
if state_root != input.current_block.state_root {
// TODO: comment this check back in, but leaving it out for now so that we can
// get rough cycle counts.
println!("The state root doesn't match.");
// eyre::bail!("mismatched state root");
eyre::bail!("mismatched state root");
}

// Derive the block header.
Expand Down
5 changes: 1 addition & 4 deletions crates/executor/host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ impl<T: Transport + Clone, P: Provider<T> + Clone> HostExecutor<T, P> {
let state_root =
rsp_mpt::compute_state_root(&executor_outcome, &dirty_storage_proofs, &rpc_db)?;
if state_root != current_block.state_root {
// TODO: comment this check back in, but leaving it out for now so that we can
// get rough cycle counts.
println!("The state root doesn't match.");
// eyre::bail!("mismatched state root");
eyre::bail!("mismatched state root");
}

// Derive the block header.
Expand Down

0 comments on commit 4616281

Please sign in to comment.