Skip to content

feat: get rid of seismic-trie fork#370

Draft
samlaf wants to merge 6 commits intoseismicfrom
feat--no-trie-fork
Draft

feat: get rid of seismic-trie fork#370
samlaf wants to merge 6 commits intoseismicfrom
feat--no-trie-fork

Conversation

@samlaf
Copy link
Copy Markdown
Contributor

@samlaf samlaf commented Apr 8, 2026

Related to:

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 April 8, 2026 20:34
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

Migrates from seismic-trie fork to standard alloy-trie with FlaggedStorage-aware wrapper functions from seismic-alloy-trie.

Phase 1

  • crates/trie/common/src/hash_builder/state.rs:109-144HashBuilderState::from_compact() no longer reads the is_private byte that was serialized in the previous version. Existing MDBX data with HashBuilderState will fail to decode correctly — the deserializer expects the stored_in_database byte where the is_private byte used to be, causing field misalignment.

Phase 2

  • crates/trie/common/src/hash_builder/state.rs:651-660 — Removed test hash_builder_state_regression_with_private but no replacement test ensures the new FlaggedStorage approach works correctly with compact encoding. Consider adding a test that verifies FlaggedStorage encoding/decoding in the context where is_private was previously used.

  • .github/workflows/seismic.yml:7 — Removed branches: [seismic] from pull_request trigger. This means the workflow will now run on PRs targeting any branch, which may not be intended for a seismic-specific workflow.

This appears to be a coordinated breaking change that requires careful deployment coordination since the compact codec format changes. The PR description correctly marks it "DO NOT MERGE" pending audit completion, which is appropriate given the backward compatibility implications.

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