Skip to content

Feat: Upgrade Prover to SP1 v5, Integrate Morph-Reth as STF, and Replace zkTrie with MPT#886

Merged
anylots merged 63 commits intomainfrom
prover-morph-reth
Feb 27, 2026
Merged

Feat: Upgrade Prover to SP1 v5, Integrate Morph-Reth as STF, and Replace zkTrie with MPT#886
anylots merged 63 commits intomainfrom
prover-morph-reth

Conversation

@anylots
Copy link
Contributor

@anylots anylots commented Feb 26, 2026

This PR introduces the following key updates to enhance system performance and scalability:

  • Upgrade Prover to SP1 v5: Leverages the latest version of the SP1 Prover to improve proof generation performance and compatibility.
  • Integrate Morph-Reth as the STF: Replaces the previous state transition function implementation with Morph-Reth for increased efficiency and maintainability.
  • Replace zkTrie with MPT: Swaps the existing zkTrie structure with a Merkle Patricia Trie (MPT) to improve data storage flexibility and enhance Ethereum compatibility.

@anylots anylots requested a review from a team as a code owner February 26, 2026 03:41
@anylots anylots linked an issue Feb 26, 2026 that may be closed by this pull request
@anylots anylots requested review from panos-xyz and removed request for a team February 26, 2026 03:41
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

Important

Review skipped

Too many files!

This PR contains 181 files, which is 31 over the limit of 150.

📥 Commits

Reviewing files that changed from the base of the PR and between 3a6022f and 8e7c620.

⛔ Files ignored due to path filters (4)
  • prover/Cargo.lock is excluded by !**/*.lock
  • prover/bin/shadow-prove/Cargo.lock is excluded by !**/*.lock
  • prover/crates/primitives/src/data/v1_l1_oracle_bytecode.bin is excluded by !**/*.bin
  • prover/crates/primitives/src/data/v2_l1_oracle_bytecode.bin is excluded by !**/*.bin
📒 Files selected for processing (181)
  • contracts/contracts/libraries/verifier/ISP1Verifier.sol
  • contracts/contracts/libraries/verifier/PlonkVerifier.sol
  • contracts/contracts/libraries/verifier/SP1VerifierPlonk.sol
  • contracts/contracts/test/ZkEvmVerifierV1.t.sol
  • contracts/contracts/test/testdata/plonk-fixture.json
  • contracts/src/deploy-config/holesky.ts
  • contracts/src/deploy-config/hoodi.ts
  • contracts/src/deploy-config/l1.ts
  • contracts/src/deploy-config/qanetl1.ts
  • contracts/src/deploy-config/sepolia.ts
  • contracts/src/deploy-config/testnetl1.ts
  • prover/Cargo.toml
  • prover/Dockerfile.sp1-compiler
  • prover/Dockerfile.sp1-plonk
  • prover/Makefile
  • prover/README.md
  • prover/bin/client/Cargo.toml
  • prover/bin/client/elf/riscv32im-succinct-zkvm-elf
  • prover/bin/client/elf/verifier-client
  • prover/bin/client/src/main.rs
  • prover/bin/host/Cargo.toml
  • prover/bin/host/src/evm.rs
  • prover/bin/host/src/execute.rs
  • prover/bin/host/src/lib.rs
  • prover/bin/host/src/main.rs
  • prover/bin/host/src/utils.rs
  • prover/bin/host/src/vkey.rs
  • prover/bin/server/Cargo.toml
  • prover/bin/server/src/execute.rs
  • prover/bin/server/src/lib.rs
  • prover/bin/server/src/main.rs
  • prover/bin/server/src/queue.rs
  • prover/bin/server/src/server.rs
  • prover/bin/shadow-prove/.gitignore
  • prover/bin/shadow-prove/Cargo.toml
  • prover/bin/shadow-prove/contracts/README.md
  • prover/bin/shadow-prove/contracts/src/libs/ISP1Verifier.sol
  • prover/bin/shadow-prove/contracts/src/libs/PlonkVerifier.sol
  • prover/bin/shadow-prove/contracts/src/libs/SP1VerifierPlonk.sol
  • prover/bin/shadow-prove/rust-toolchain
  • prover/bin/shadow-prove/rustfmt.toml
  • prover/bin/shadow-prove/src/abi.rs
  • prover/bin/shadow-prove/src/batch.json
  • prover/bin/shadow-prove/src/execute.rs
  • prover/bin/shadow-prove/src/lib.rs
  • prover/bin/shadow-prove/src/main.rs
  • prover/bin/shadow-prove/src/shadow_prove.rs
  • prover/bin/shadow-prove/src/shadow_rollup.rs
  • prover/bin/shadow-prove/src/util.rs
  • prover/bin/shadow-prove/start.sh
  • prover/configs/4844_trusted_setup.txt
  • prover/contracts/README.md
  • prover/contracts/src/ISP1Verifier.sol
  • prover/contracts/src/PlonkVerifier.sol
  • prover/contracts/src/SP1VerifierPlonk.sol
  • prover/contracts/src/fixtures/plonk-fixture.json
  • prover/crates/core/Cargo.toml
  • prover/crates/core/src/batch.rs
  • prover/crates/core/src/database.rs
  • prover/crates/core/src/executor/builder.rs
  • prover/crates/core/src/executor/hooks.rs
  • prover/crates/core/src/executor/mod.rs
  • prover/crates/core/src/hardfork.rs
  • prover/crates/core/src/lib.rs
  • prover/crates/executor/client/Cargo.toml
  • prover/crates/executor/client/src/lib.rs
  • prover/crates/executor/client/src/types/batch.rs
  • prover/crates/executor/client/src/types/blob.rs
  • prover/crates/executor/client/src/types/error.rs
  • prover/crates/executor/client/src/types/input.rs
  • prover/crates/executor/client/src/types/mod.rs
  • prover/crates/executor/client/src/verifier/blob_verifier.rs
  • prover/crates/executor/client/src/verifier/evm_verifier.rs
  • prover/crates/executor/client/src/verifier/mod.rs
  • prover/crates/executor/core/Cargo.toml
  • prover/crates/executor/core/src/error.rs
  • prover/crates/executor/core/src/executor.rs
  • prover/crates/executor/core/src/lib.rs
  • prover/crates/executor/host/Cargo.toml
  • prover/crates/executor/host/src/blob.rs
  • prover/crates/executor/host/src/execute.rs
  • prover/crates/executor/host/src/lib.rs
  • prover/crates/executor/host/src/trace.rs
  • prover/crates/executor/host/src/utils.rs
  • prover/crates/executor/host/src/zstd_util.rs
  • prover/crates/morph-executor/client/Cargo.toml
  • prover/crates/morph-executor/client/src/lib.rs
  • prover/crates/morph-executor/client/src/types/input.rs
  • prover/crates/morph-executor/client/src/types/mod.rs
  • prover/crates/morph-executor/client/src/verifier/evm_verifier.rs
  • prover/crates/morph-executor/host/Cargo.toml
  • prover/crates/morph-executor/host/src/lib.rs
  • prover/crates/morph-executor/utils/Cargo.toml
  • prover/crates/morph-executor/utils/src/lib.rs
  • prover/crates/mpt/Cargo.toml
  • prover/crates/mpt/src/execution_witness.rs
  • prover/crates/mpt/src/lib.rs
  • prover/crates/mpt/src/mpt.rs
  • prover/crates/primitives/Cargo.toml
  • prover/crates/primitives/src/data/v1_l1_oracle_bytecode.txt
  • prover/crates/primitives/src/data/v2_l1_oracle_bytecode.txt
  • prover/crates/primitives/src/lib.rs
  • prover/crates/primitives/src/predeployed.rs
  • prover/crates/primitives/src/types/authorization_list.rs
  • prover/crates/primitives/src/types/blob.rs
  • prover/crates/primitives/src/types/block.rs
  • prover/crates/primitives/src/types/mod.rs
  • prover/crates/primitives/src/types/tx.rs
  • prover/crates/primitives/src/types/tx_alt_fee.rs
  • prover/crates/sbv/Cargo.toml
  • prover/crates/sbv/src/lib.rs
  • prover/crates/storage/rpc-db/Cargo.toml
  • prover/crates/storage/rpc-db/src/account_proof.rs
  • prover/crates/storage/rpc-db/src/basic_rpc_db.rs
  • prover/crates/storage/rpc-db/src/error.rs
  • prover/crates/storage/rpc-db/src/lib.rs
  • prover/crates/storage/witness-db/Cargo.toml
  • prover/crates/storage/witness-db/src/lib.rs
  • prover/crates/utils/Cargo.toml
  • prover/crates/utils/src/lib.rs
  • prover/crates/utils/src/macros.rs
  • prover/crates/utils/src/metrics/mod.rs
  • prover/crates/utils/src/metrics/registry.rs
  • prover/crates/utils/src/provider.rs
  • prover/crates/utils/src/utils/debug.rs
  • prover/crates/utils/src/utils/mod.rs
  • prover/docker-compose-app.yml
  • prover/rust-toolchain
  • prover/script/execute.sh
  • prover/script/prover_server.sh
  • prover/script/sp1up.sh
  • prover/script/stop.sh
  • prover/stop.sh
  • prover/testdata/altfeetx/block_traces_329475_329475.json
  • prover/testdata/altfeetx/block_traces_329791_329791.json
  • prover/testdata/altfeetx/block_traces_341111_341111.json
  • prover/testdata/altfeetx/trace_call.json
  • prover/testdata/altfeetx/trace_create.json
  • prover/testdata/altfeetx/trace_failed.json
  • prover/testdata/altfeetx/trace_slot.json
  • prover/testdata/altfeetx/trace_slot_another.json
  • prover/testdata/blob/mainnet_47561.data
  • prover/testdata/dev.json
  • prover/testdata/dev_block_traces.json
  • prover/testdata/dev_tx.json
  • prover/testdata/dev_tx_s.json
  • prover/testdata/devnet_batch_traces.json
  • prover/testdata/mainnet_batch_traces.json
  • prover/testdata/mainnet_batch_traces_l1.json
  • prover/testdata/mainnet_batch_traces_test.json
  • prover/testdata/morph203/morph203_0_traces.json
  • prover/testdata/morph203/morph203_1_traces.json
  • prover/testdata/morph203/morph203_2_traces.json
  • prover/testdata/morph203/morph203_3_traces.json
  • prover/testdata/mpt/executor_input_19720290.data
  • prover/testdata/mpt/hostexecutoroutput
  • prover/testdata/mpt/local_transfer_eth.json
  • prover/testdata/mpt/mainnet_1430.json
  • prover/testdata/mpt/mainnet_16283373.data
  • prover/testdata/mpt/mainnet_165256.data
  • prover/testdata/mpt/mainnet_18762206.json
  • prover/testdata/mpt/mainnet_19137902.json
  • prover/testdata/mpt/mainnet_19137909.json
  • prover/testdata/mpt/mainnet_19266117.json
  • prover/testdata/mpt/mainnet_19720219.json
  • prover/testdata/mpt/mainnet_19720290.data
  • prover/testdata/mpt/mainnet_209.json
  • prover/testdata/mpt/mainnet_25215.json
  • prover/testdata/mpt/mainnet_809.json
  • prover/testdata/mpt/mainnet_898.json
  • prover/testdata/qanet_traces.json
  • prover/testdata/viridian/eip7702_traces.json
  • prover/tests/algebra/host/Cargo.toml
  • prover/tests/algebra/host/src/main.rs
  • prover/tests/bls12381/host/Cargo.toml
  • prover/tests/bls12381/host/src/main.rs
  • prover/tests/keccak256/client/Cargo.toml
  • prover/tests/keccak256/host/Cargo.toml
  • prover/tests/keccak256/host/src/main.rs
  • prover/tests/zstd/host/Cargo.toml
  • prover/tests/zstd/host/src/main.rs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch prover-morph-reth

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@anylots anylots requested a review from chengwenxi February 26, 2026 04:01
#[cfg(feature = "network")]
let client = ProverClient::builder()
.network_for(NetworkMode::Mainnet)
.rpc_url("https://rpc.mainnet.succinct.xyz")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set it as a const?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved. There is indeed some overhead in constructing a ProverClient for each proof generation, so it has been moved into the BatchProver struct for reuse.

@panos-xyz
Copy link

Code review

Found 1 issue:

  1. Mainnet fix for error handling lost in code_by_hash_ref (regression from PR Sync Prover mainnet fix #821)

The new code_by_hash_ref implementation uses .unwrap() which will panic if the code hash is not found:

fn code_by_hash_ref(&self, hash: B256) -> Result<Bytecode, Self::Error> {
    Ok(self.bytecode_by_hash.get(&hash).map(|code| (*code).clone()).unwrap())
}

Commit e75a2de8 ("Sync Prover mainnet fix #821") specifically changed this from a panic to graceful recovery because code lookup failures were occurring in production. The new implementation reverts this safety improvement and will crash the prover when bytecode is not pre-loaded.

/// Get account code by its hash.
fn code_by_hash_ref(&self, hash: B256) -> Result<Bytecode, Self::Error> {
Ok(self.bytecode_by_hash.get(&hash).map(|code| (*code).clone()).unwrap())
}

Recommended fix: Replace .unwrap() with .unwrap_or_else(|| Bytecode::default()) or propagate the error properly through the Result type.


Additionally, basic_rpc_db.rs has unimplemented!() for the same method:

/// Get account code by its hash.
fn code_by_hash_ref(&self, _code_hash: B256) -> Result<Bytecode, Self::Error> {
unimplemented!()
}

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@anylots
Copy link
Contributor Author

anylots commented Feb 26, 2026

Code review

Found 1 issue:

  1. Mainnet fix for error handling lost in code_by_hash_ref (regression from PR Sync Prover mainnet fix #821)

The new code_by_hash_ref implementation uses .unwrap() which will panic if the code hash is not found:

fn code_by_hash_ref(&self, hash: B256) -> Result<Bytecode, Self::Error> {
    Ok(self.bytecode_by_hash.get(&hash).map(|code| (*code).clone()).unwrap())
}

Commit e75a2de8 ("Sync Prover mainnet fix #821") specifically changed this from a panic to graceful recovery because code lookup failures were occurring in production. The new implementation reverts this safety improvement and will crash the prover when bytecode is not pre-loaded.

/// Get account code by its hash.
fn code_by_hash_ref(&self, hash: B256) -> Result<Bytecode, Self::Error> {
Ok(self.bytecode_by_hash.get(&hash).map(|code| (*code).clone()).unwrap())
}

Recommended fix: Replace .unwrap() with .unwrap_or_else(|| Bytecode::default()) or propagate the error properly through the Result type.

Additionally, basic_rpc_db.rs has unimplemented!() for the same method:

/// Get account code by its hash.
fn code_by_hash_ref(&self, _code_hash: B256) -> Result<Bytecode, Self::Error> {
unimplemented!()
}

🤖 Generated with Claude Code

  • If this code review was useful, please react with 👍. Otherwise, react with 👎.

Code review

Found 1 issue:

  1. Mainnet fix for error handling lost in code_by_hash_ref (regression from PR Sync Prover mainnet fix #821)

The new code_by_hash_ref implementation uses .unwrap() which will panic if the code hash is not found:

fn code_by_hash_ref(&self, hash: B256) -> Result<Bytecode, Self::Error> {
    Ok(self.bytecode_by_hash.get(&hash).map(|code| (*code).clone()).unwrap())
}

Commit e75a2de8 ("Sync Prover mainnet fix #821") specifically changed this from a panic to graceful recovery because code lookup failures were occurring in production. The new implementation reverts this safety improvement and will crash the prover when bytecode is not pre-loaded.

/// Get account code by its hash.
fn code_by_hash_ref(&self, hash: B256) -> Result<Bytecode, Self::Error> {
Ok(self.bytecode_by_hash.get(&hash).map(|code| (*code).clone()).unwrap())
}

Recommended fix: Replace .unwrap() with .unwrap_or_else(|| Bytecode::default()) or propagate the error properly through the Result type.

Additionally, basic_rpc_db.rs has unimplemented!() for the same method:

/// Get account code by its hash.
fn code_by_hash_ref(&self, _code_hash: B256) -> Result<Bytecode, Self::Error> {
unimplemented!()
}

🤖 Generated with Claude Code

  • If this code review was useful, please react with 👍. Otherwise, react with 👎.

A TrieDBError has been added for the return value in witness-db.
Use basic_ref in basic_rpc_db to fetch the account info, which includes the code, Code comments have been added.

@anylots anylots merged commit 8c00f42 into main Feb 27, 2026
11 checks passed
@anylots anylots deleted the prover-morph-reth branch February 27, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZK proof for mpt block

3 participants