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

chore: resume state root assertion #33

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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