Skip to content

Commit

Permalink
chore(l1): move ethrex-trie to common folder. (#2051)
Browse files Browse the repository at this point in the history
**Motivation**
Even though the trie is related to a structure that is stored on disk,
we have decoupled the trie logic from the storing (see `trie_db`).

Some modules like the types, just use the trie logic to calculate hash
tree roots, without storing anything, for example:
https://github.com/lambdaclass/ethrex/blob/51b7dcbac7226e748b711ced1920bcf11b326577/crates/common/types/account.rs#L158

Geth does something similar with:
- https://github.com/ethereum/go-ethereum/tree/master/trie
- https://github.com/ethereum/go-ethereum/tree/master/triedb

So the trie logic should go in `common`, whereas the trie db
implementations should go in `storage`.

Finally, this would simplify the dependencies if we decided to merge
common, trie, and rpc into one crate.
  • Loading branch information
mpaulucci authored Feb 25, 2025
1 parent 86b6bda commit 616800f
Show file tree
Hide file tree
Showing 37 changed files with 33 additions and 211 deletions.
183 changes: 3 additions & 180 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 26 additions & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
[workspace]
members = [
"cmd/ef_tests/blockchain",
"cmd/ef_tests/state",
"cmd/ethrex",
"cmd/ethrex_l2",
"cmd/hive_report",
"cmd/loc",
"crates/blockchain",
"crates/blockchain/dev",
"crates/common",
"crates/common/rlp",
"crates/l2/",
"crates/l2/contracts",
"crates/l2/prover",
"crates/l2/prover/bench",
"crates/l2/sdk",
"crates/networking/p2p",
"crates/networking/rpc",
"crates/storage/store",
"crates/storage/trie",
"crates/vm",
"crates/vm/levm",
"crates/vm/levm/bench/revm_comparison",
"cmd/ef_tests/blockchain",
"cmd/ef_tests/state",
"cmd/ethrex",
"cmd/ethrex_l2",
"cmd/hive_report",
"cmd/loc",
"crates/blockchain",
"crates/blockchain/dev",
"crates/common",
"crates/common/rlp",
"crates/common/trie",
"crates/l2/",
"crates/l2/contracts",
"crates/l2/prover",
"crates/l2/sdk",
"crates/networking/p2p",
"crates/networking/rpc",
"crates/storage",
"crates/vm",
"crates/vm/levm",
"crates/vm/levm/bench/revm_comparison",
]
resolver = "2"

Expand All @@ -36,10 +35,10 @@ ethrex-blockchain = { path = "./crates/blockchain" }
ethrex-common = { path = "./crates/common" }
ethrex-p2p = { path = "./crates/networking/p2p" }
ethrex-rpc = { path = "./crates/networking/rpc" }
ethrex-storage = { path = "./crates/storage/store" }
ethrex-storage = { path = "./crates/storage" }
ethrex-vm = { path = "./crates/vm" }
ethrex-levm = { path = "./crates/vm/levm" }
ethrex-trie = { path = "./crates/storage/trie" }
ethrex-trie = { path = "./crates/common/trie" }
ethrex-rlp = { path = "./crates/common/rlp" }
ethrex-l2 = { path = "./crates/l2" }
ethrex-sdk = { path = "./crates/l2/sdk" }
Expand Down Expand Up @@ -69,9 +68,9 @@ redb = "2.2.0"
snap = "1.1.1"
k256 = { version = "0.13.3", features = ["ecdh"] }
secp256k1 = { version = "0.29.1", default-features = false, features = [
"global-context",
"recovery",
"rand",
"global-context",
"recovery",
"rand",
] }
keccak-hash = "0.11.0"
axum = "0.8.1"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions crates/l2/prover/zkvm/interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ thiserror = "2.0.9"
ethrex-common = { path = "../../../../common/", default-features = false }
ethrex-vm = { path = "../../../../vm", default-features = false }
ethrex-rlp = { path = "../../../../common/rlp", default-features = false }
ethrex-storage = { path = "../../../../storage/store", default-features = false }
ethrex-trie = { path = "../../../../storage/trie", default-features = false }
ethrex-storage = { path = "../../../../storage", default-features = false }
ethrex-trie = { path = "../../../../common/trie", default-features = false }

[build-dependencies]
risc0-build = { version = "1.2.2" }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 616800f

Please sign in to comment.