Support multiple stateless trie implementations#10
Conversation
Signed-off-by: jsign <jsign.uy@gmail.com>
| run: cargo clippy --workspace --all-targets --all-features -- -D warnings | ||
|
|
||
| ef-tests: | ||
| name: Ethereum Foundation tests |
There was a problem hiding this comment.
Run CI for both tries (or more in the future if supported).
Mechanism is basically passing a mandatory arg to ruf_ef_tests.sh which will proxy through env var for test runner.
It is mostly plumbing since stateless_validation already has support for generic trie via generics.
There was a problem hiding this comment.
Mainly renamed & moved file, and move StatelessTrie in lib.rs of new crate.
| @@ -0,0 +1,220 @@ | |||
| //! Provides a zeth-backed sparse MPT implementation for the stateless validator guest program. | |||
There was a problem hiding this comment.
| @@ -0,0 +1,195 @@ | |||
| // Copyright 2025 RISC Zero, Inc. | |||
There was a problem hiding this comment.
All zeth-mpt files are https://github.com/eth-act/zkvm-ethereum-mpt/tree/main/crates/zeth-mpt verbatim.
| path::{Path, PathBuf}, | ||
| sync::Arc, | ||
| }; | ||
| use tries::{StatelessTrie, default::StatelessSparseTrie, zeth::SparseState}; |
There was a problem hiding this comment.
Here until end is mainly the mentioned plumbing for testing with different tries.
| workspace = true | ||
|
|
||
| [dependencies] | ||
| alloy-trie = { version = "0.8.0", default-features = false } |
There was a problem hiding this comment.
Important note: zeth trie depends on 0.8.0. We can't use workspace 0.9.0 since this version removed a critical feature that this other trie relies on.
Signed-off-by: jsign <jsign.uy@gmail.com>
This PR generalizes trie support for stateless validation by separating trie implementations into a dedicated crate and adding a second implementation backed by
zeth-mpt.statelessinto newcrates/tries:tries::default::StatelessSparseTrietriestries::zeth::SparseStateimplementation backed by vendoredcrates/zeth-mptstatelessandef-teststo consume trie implementations fromtriesscripts/run_ef_tests.shnow requires an explicit arg:default|zethEF_TEST_TRIEand dispatch to the selected trietries::default).I didn't want to touch much the zeth-mpt implementation -- but I think we might want to iterate on it further to remove some panic cases or similars. Kept the Reth trie still be the default one.
Close #9