Skip to content

feat: get rid of seismic-trie fork#328

Closed
samlaf wants to merge 4 commits intoveridise-audit-feb-2026from
feat--no-trie-fork
Closed

feat: get rid of seismic-trie fork#328
samlaf wants to merge 4 commits intoveridise-audit-feb-2026from
feat--no-trie-fork

Conversation

@samlaf
Copy link
Copy Markdown
Contributor

@samlaf samlaf commented Mar 5, 2026

DO NOT MERGE

We probably will want to only merge this after the audit is done, unless we decide we want to pull the trigger and want it audited.

Depends on:

These PRs implement a migration away from our seismic-trie fork and back to using stock alloy-trie, by changing the way we RLP encode FlaggedStorage slots.

See design in https://hackmd.io/ZOGfcUP2SyKmPeOuz0tmvg

Diff with upstream

this branch vs main (upstream)

 crates/trie/common/src/proofs.rs                               | 41 ++++++++++++++++++++++++++++---------
 crates/trie/common/src/root.rs                                 |  9 ++++++---
 crates/trie/db/Cargo.toml                                      |  7 +++++++
 crates/trie/db/src/hashed_cursor.rs                            |  9 +++++----
 crates/trie/db/src/state.rs                                    | 23 ++++++++++++++++-----
 crates/trie/db/src/storage.rs                                  |  2 +-
 crates/trie/db/tests/fuzz_in_memory_nodes.proptest-regressions |  7 +++++++
 crates/trie/db/tests/fuzz_in_memory_nodes.rs                   |  6 +++---
 crates/trie/db/tests/post_state.rs                             | 61 ++++++++++++++++++++++++++++++++-----------------------
 crates/trie/db/tests/proof.rs                                  |  8 ++++++++
 crates/trie/db/tests/trie.proptest-regressions                 |  8 ++++++++
 crates/trie/db/tests/trie.rs                                   | 68 +++++++++++++++++++++++++++++++++++++++++++------------------
 crates/trie/db/tests/witness.rs                                | 23 +++++++++++++++------
 crates/trie/parallel/Cargo.toml                                |  2 ++
 crates/trie/parallel/benches/root.rs                           |  9 ++++++---
 crates/trie/parallel/src/lib.rs                                |  2 +-
 crates/trie/parallel/src/proof.rs                              |  8 ++++----
 crates/trie/parallel/src/root.rs                               |  9 +++++----
 crates/trie/sparse-parallel/src/trie.rs                        | 49 +++++++++++++++++++++++---------------------
 crates/trie/sparse/benches/rlp_node.rs                         |  1 +
 crates/trie/sparse/benches/root.rs                             |  6 +++++-
 crates/trie/sparse/src/state.rs                                |  5 ++---
 crates/trie/sparse/src/trie.rs                                 | 40 +++++++++++++++++++-----------------
 crates/trie/trie/Cargo.toml                                    |  8 ++------
 crates/trie/trie/benches/hash_post_state.rs                    |  5 +++--
 crates/trie/trie/src/hashed_cursor/mock.rs                     |  9 +++++----
 crates/trie/trie/src/hashed_cursor/mod.rs                      |  5 +++--
 crates/trie/trie/src/hashed_cursor/noop.rs                     |  5 +++--
 crates/trie/trie/src/hashed_cursor/post_state.rs               | 35 +++++++++++++++++++-------------
 crates/trie/trie/src/lib.rs                                    |  2 +-
 crates/trie/trie/src/node_iter.rs                              |  8 ++++----
 crates/trie/trie/src/test_utils.rs                             | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 crates/trie/trie/src/verify.rs                                 |  7 ++++---
 crates/trie/trie/src/witness.rs                                |  8 +++-----
 40 files changed, 462 insertions(+), 216 deletions(-)

seismic branch vs main branch

 crates/trie/common/Cargo.toml                                  |   4 +-
 crates/trie/common/src/account.rs                              |   8 +-
 crates/trie/common/src/added_removed_keys.rs                   |  14 +--
 crates/trie/common/src/hash_builder/state.rs                   |  49 +++++++++-
 crates/trie/common/src/hashed_state.rs                         |  56 +++++++----
 crates/trie/common/src/lib.rs                                  |   2 +-
 crates/trie/common/src/proofs.rs                               |  34 +++++--
 crates/trie/db/Cargo.toml                                      |   7 ++
 crates/trie/db/src/hashed_cursor.rs                            |   9 +-
 crates/trie/db/src/state.rs                                    |  27 +++++-
 crates/trie/db/src/storage.rs                                  |   2 +-
 crates/trie/db/tests/fuzz_in_memory_nodes.proptest-regressions |   7 ++
 crates/trie/db/tests/fuzz_in_memory_nodes.rs                   |   6 +-
 crates/trie/db/tests/post_state.rs                             |  61 +++++++-----
 crates/trie/db/tests/proof.rs                                  |   8 ++
 crates/trie/db/tests/trie.proptest-regressions                 |   8 ++
 crates/trie/db/tests/trie.rs                                   | 117 +++++++++++++++++------
 crates/trie/db/tests/witness.rs                                |  23 +++--
 crates/trie/parallel/Cargo.toml                                |   2 +
 crates/trie/parallel/benches/root.rs                           |   9 +-
 crates/trie/parallel/src/lib.rs                                |   2 +-
 crates/trie/parallel/src/proof.rs                              |  15 ++-
 crates/trie/parallel/src/root.rs                               |  16 +++-
 crates/trie/sparse-parallel/src/trie.rs                        | 241 ++++++++++++++++++++++++++--------------------
 crates/trie/sparse/benches/rlp_node.rs                         |   6 +-
 crates/trie/sparse/benches/root.rs                             |  20 +++-
 crates/trie/sparse/benches/update.rs                           |   6 +-
 crates/trie/sparse/src/state.rs                                |  41 ++++++--
 crates/trie/sparse/src/traits.rs                               |   1 +
 crates/trie/sparse/src/trie.rs                                 | 436 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------
 crates/trie/trie/Cargo.toml                                    |   1 +
 crates/trie/trie/benches/hash_post_state.rs                    |   5 +-
 crates/trie/trie/benches/trie_root.rs                          |   3 +-
 crates/trie/trie/src/hashed_cursor/mock.rs                     |   9 +-
 crates/trie/trie/src/hashed_cursor/mod.rs                      |   5 +-
 crates/trie/trie/src/hashed_cursor/noop.rs                     |   5 +-
 crates/trie/trie/src/hashed_cursor/post_state.rs               |  35 ++++---
 crates/trie/trie/src/lib.rs                                    |   2 +-
 crates/trie/trie/src/node_iter.rs                              |   4 +-
 crates/trie/trie/src/proof/mod.rs                              |  10 +-
 crates/trie/trie/src/test_utils.rs                             |  94 +++++++++++++++++-
 crates/trie/trie/src/trie.rs                                   |  12 ++-
 crates/trie/trie/src/verify.rs                                 |   7 +-
 crates/trie/trie/src/witness.rs                                |  20 ++--
 44 files changed, 1037 insertions(+), 412 deletions(-)

@samlaf samlaf requested a review from cdrappi as a code owner March 5, 2026 16:18
@samlaf samlaf marked this pull request as draft March 5, 2026 16:18
Comment on lines -315 to -319
// If we had the same state root calculation as ethereum when all values are public:
/*
hex!("b464525710cafcf5d4044ac85b72c08b1e76231b8d91f288fe438cc41d8eaafd")
*/
hex!("64f7822621afd8a66d71e233b48e945c101ab97334e19398422f22c3fae72223")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that we now do have the same state root as ethereum when storage only contains public slots

@samlaf samlaf deleted the branch veridise-audit-feb-2026 March 10, 2026 19:08
@samlaf samlaf closed this Mar 10, 2026
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.

1 participant