diff --git a/Cargo.lock b/Cargo.lock index d6972e3741..d6b7e8b25a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2300,7 +2300,6 @@ dependencies = [ "ethrex-common", "ethrex-rlp", "ethrex-storage", - "ethrex-vm", "hex", "lazy_static", "serde", diff --git a/Cargo.toml b/Cargo.toml index 764c2c3a52..6b8b897146 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,30 +1,30 @@ [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/sdk", "crates/networking/p2p", "crates/networking/rpc", "crates/storage/store", - "crates/vm", "crates/storage/trie", - "crates/common/rlp", - "cmd/ethrex", - "cmd/ef_tests/blockchain", - "cmd/ef_tests/state", - "cmd/ethrex_l2", - "cmd/hive_report", + "crates/vm", "crates/vm/levm", "crates/vm/levm/bench/revm_comparison", - "crates/l2/", - "crates/l2/prover", - "crates/l2/contracts", - "crates/l2/sdk", - "cmd/loc", ] resolver = "2" -default-members = ["cmd/ethrex", "cmd/ethrex_l2", "crates/l2/prover", "cmd/loc"] +default-members = ["cmd/ethrex"] [workspace.package] version = "0.1.0" @@ -37,6 +37,7 @@ ethrex-p2p = { path = "./crates/networking/p2p" } ethrex-rpc = { path = "./crates/networking/rpc" } ethrex-storage = { path = "./crates/storage/store" } ethrex-vm = { path = "./crates/vm" } +ethrex-levm = { path = "./crates/vm/levm" } ethrex-trie = { path = "./crates/storage/trie" } ethrex-rlp = { path = "./crates/common/rlp" } ethrex-l2 = { path = "./crates/l2" } diff --git a/Makefile b/Makefile index 4f6deb12c4..88c88bd799 100644 --- a/Makefile +++ b/Makefile @@ -150,10 +150,10 @@ loc-stats: fi loc-detailed: - cargo run --release --bin loc -- --detailed + cargo run --release -p loc --bin loc -- --detailed loc-compare-detailed: - cargo run --release --bin loc -- --compare-detailed + cargo run --release -p loc --bin loc -- --compare-detailed hive-stats: make hive QUIET=true diff --git a/cmd/ef_tests/blockchain/Cargo.toml b/cmd/ef_tests/blockchain/Cargo.toml index 8bd8dfcd6d..870c9aa669 100644 --- a/cmd/ef_tests/blockchain/Cargo.toml +++ b/cmd/ef_tests/blockchain/Cargo.toml @@ -8,7 +8,7 @@ ethrex-blockchain.workspace = true ethrex-common.workspace = true ethrex-storage.workspace = true ethrex-rlp.workspace = true -ethrex-vm.workspace = true + serde.workspace = true serde_json.workspace = true bytes.workspace = true @@ -21,6 +21,10 @@ datatest-stable = "0.2.9" [lib] path = "./lib.rs" +[features] +default = ["c-kzg"] +c-kzg = ["ethrex-blockchain/c-kzg"] + [[test]] name = "cancun" harness = false diff --git a/cmd/ef_tests/state/Cargo.toml b/cmd/ef_tests/state/Cargo.toml index 55b0a2c461..5451af5d97 100644 --- a/cmd/ef_tests/state/Cargo.toml +++ b/cmd/ef_tests/state/Cargo.toml @@ -4,12 +4,13 @@ version.workspace = true edition.workspace = true [dependencies] -ethrex-blockchain = { workspace = true } +ethrex-blockchain.workspace = true ethrex-common.workspace = true ethrex-storage.workspace = true ethrex-rlp.workspace = true -ethrex-vm = { workspace = true } -ethrex-levm = { path = "../../../crates/vm/levm" } +ethrex-vm.workspace = true +ethrex-levm.workspace = true + serde.workspace = true serde_json.workspace = true bytes.workspace = true @@ -35,6 +36,11 @@ hex = "0.4.3" [lib] path = "./lib.rs" +[features] +default = ["c-kzg", "blst"] +c-kzg = ["ethrex-vm/c-kzg", "ethrex-levm/c-kzg", "ethrex-common/c-kzg"] +blst = ["ethrex-vm/blst"] + [[test]] name = "all" harness = false diff --git a/cmd/ethrex/Cargo.toml b/cmd/ethrex/Cargo.toml index 468dabaf91..7e9f09b1a4 100644 --- a/cmd/ethrex/Cargo.toml +++ b/cmd/ethrex/Cargo.toml @@ -10,7 +10,7 @@ ethrex-blockchain.workspace = true ethrex-rpc.workspace = true ethrex-common.workspace = true ethrex-p2p.workspace = true -ethrex-storage = { workspace = true } +ethrex-storage.workspace = true ethrex-vm.workspace = true ethrex-rlp.workspace = true ethrex-l2 = { workspace = true, optional = true } @@ -42,9 +42,11 @@ name = "ethrex" path = "./ethrex.rs" [features] -default = ["libmdbx"] +default = ["libmdbx", "c-kzg", "blst"] dev = ["dep:ethrex-dev"] +c-kzg = ["ethrex-vm/c-kzg", "ethrex-common/c-kzg", "ethrex-blockchain/c-kzg", "ethrex-p2p/c-kzg"] metrics = ["ethrex-blockchain/metrics", "ethrex-l2/metrics"] libmdbx = ["dep:libmdbx", "ethrex-storage/libmdbx"] redb = ["dep:redb", "ethrex-storage/redb"] +blst = ["ethrex-vm/blst"] l2 = ["dep:ethrex-l2", "ethrex-vm/l2"] diff --git a/cmd/ethrex_l2/Cargo.toml b/cmd/ethrex_l2/Cargo.toml index 9fca20fd0b..150c1d5189 100644 --- a/cmd/ethrex_l2/Cargo.toml +++ b/cmd/ethrex_l2/Cargo.toml @@ -4,6 +4,14 @@ version.workspace = true edition.workspace = true [dependencies] +ethrex-l2.workspace = true +ethrex-sdk.workspace = true +ethrex-common.workspace = true +ethrex-blockchain.workspace = true +ethrex-prover.workspace = true +ethrex-rlp.workspace = true +ethrex-rpc.workspace = true + serde_json.workspace = true serde.workspace = true bytes.workspace = true @@ -26,14 +34,6 @@ strum = "0.26.3" secp256k1.workspace = true keccak-hash.workspace = true -ethrex-l2.workspace = true -ethrex-sdk.workspace = true -ethrex-common.workspace = true -ethrex-blockchain.workspace = true -ethrex-prover.workspace = true -ethrex-rlp.workspace = true -ethrex-rpc.workspace = true - [[bin]] name = "ethrex_l2" path = "./src/main.rs" diff --git a/crates/blockchain/Cargo.toml b/crates/blockchain/Cargo.toml index 9ede7d46d7..4a30a964e2 100644 --- a/crates/blockchain/Cargo.toml +++ b/crates/blockchain/Cargo.toml @@ -6,17 +6,19 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -ethrex-levm = { path = "../vm/levm", default-features = false } +ethrex-rlp.workspace = true +ethrex-common.workspace = true +ethrex-storage.workspace = true +ethrex-vm.workspace = true +ethrex-levm.workspace = true + thiserror.workspace = true sha3.workspace = true tracing.workspace = true bytes.workspace = true cfg-if = "1.0.0" -ethrex-rlp.workspace = true -ethrex-common = { path = "../common", default-features = false } -ethrex-storage = { path = "../storage/store", default-features = false } -ethrex-vm = { path = "../vm", default-features = false } + k256 = { version = "0.13.3", features = ["ecdh"] } @@ -30,7 +32,7 @@ hex = "0.4.3" path = "./blockchain.rs" [features] -default = ["c-kzg"] +default = [] libmdbx = ["ethrex-common/libmdbx", "ethrex-storage/default", "ethrex-vm/libmdbx"] -c-kzg = ["ethrex-common/c-kzg", "ethrex-levm/c-kzg"] +c-kzg = ["ethrex-common/c-kzg", "ethrex-vm/c-kzg", "ethrex-levm/c-kzg"] metrics = ["ethrex-metrics/transactions"] diff --git a/crates/blockchain/metrics/Cargo.toml b/crates/blockchain/metrics/Cargo.toml index 9626d4eea2..2fba12fb98 100644 --- a/crates/blockchain/metrics/Cargo.toml +++ b/crates/blockchain/metrics/Cargo.toml @@ -12,7 +12,7 @@ thiserror.workspace = true serde_json.workspace = true serde.workspace = true -ethrex-common = { path = "../../common", default-features = false } +ethrex-common.workspace = true prometheus = { version = "0.13.4", optional = true } diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index cc083b9a6e..6e73a30663 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] ethrex-rlp.workspace = true -ethrex-trie = { path = "../storage/trie", default-features = false } +ethrex-trie.workspace = true tracing.workspace = true tinyvec = "1.6.0" @@ -31,7 +31,7 @@ lazy_static.workspace = true hex-literal.workspace = true [features] -default = ["c-kzg"] +default = [] libmdbx = ["ethrex-trie/libmdbx"] redb = ["ethrex-trie/redb"] c-kzg = ["dep:c-kzg"] diff --git a/crates/l2/Cargo.toml b/crates/l2/Cargo.toml index bb50c6a554..ac3c816f21 100644 --- a/crates/l2/Cargo.toml +++ b/crates/l2/Cargo.toml @@ -19,7 +19,7 @@ ethrex-rpc.workspace = true ethrex-blockchain.workspace = true ethrex-storage.workspace = true ethrex-vm.workspace = true -ethrex-dev = { path = "../../crates/blockchain/dev" } +ethrex-dev = { path = "../../crates/blockchain/dev", default-features = false } hex.workspace = true bytes.workspace = true jsonwebtoken.workspace = true diff --git a/crates/l2/prover/Cargo.toml b/crates/l2/prover/Cargo.toml index 929c6ec577..594747e1b9 100644 --- a/crates/l2/prover/Cargo.toml +++ b/crates/l2/prover/Cargo.toml @@ -32,7 +32,6 @@ risc0-zkvm = { version = "1.2.2" } sp1-sdk = "3.4.0" [dev-dependencies] -ethrex-vm.workspace = true ethrex-storage.workspace = true ethrex-blockchain.workspace = true diff --git a/crates/networking/p2p/Cargo.toml b/crates/networking/p2p/Cargo.toml index 1b8c380e32..3f8f8e75cc 100644 --- a/crates/networking/p2p/Cargo.toml +++ b/crates/networking/p2p/Cargo.toml @@ -41,3 +41,7 @@ hex-literal = "0.4.1" [lib] path = "./p2p.rs" + +[features] +default = ["c-kzg"] +c-kzg = ["ethrex-blockchain/c-kzg", "ethrex-common/c-kzg"] diff --git a/crates/storage/store/Cargo.toml b/crates/storage/store/Cargo.toml index 18c7451665..1e9293aebd 100644 --- a/crates/storage/store/Cargo.toml +++ b/crates/storage/store/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" [dependencies] ethrex-rlp.workspace = true -ethrex-common = { path = "../../common", default-features = false } -ethrex-trie = { path = "../../storage/trie", default-features = false } +ethrex-common.workspace = true +ethrex-trie.workspace = true ethereum-types.workspace = true anyhow = "1.0.86" diff --git a/crates/vm/Cargo.toml b/crates/vm/Cargo.toml index 5701f7edb2..3db14712e0 100644 --- a/crates/vm/Cargo.toml +++ b/crates/vm/Cargo.toml @@ -1,14 +1,15 @@ [package] name = "ethrex-vm" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true [dependencies] -ethrex-common = { path = "../common", default-features = false } -ethrex-storage = { path = "../storage/store", default-features = false } -ethrex-levm = { path = "./levm", default-features = false } -ethrex-trie = { path = "../storage/trie", default-features = false } -ethrex-rlp = { path = "../common/rlp", default-features = false } +ethrex-common.workspace = true +ethrex-storage.workspace = true +ethrex-levm.workspace = true +ethrex-trie.workspace = true +ethrex-rlp.workspace = true + revm = { version = "18.0.0", features = [ "serde", "std", @@ -38,7 +39,7 @@ ethereum-types.workspace = true path = "./vm.rs" [features] -default = ["c-kzg", "blst"] +default = [] l2 = [] c-kzg = ["revm/c-kzg", "ethrex-levm/c-kzg", "ethrex-common/c-kzg"] blst = ["revm/blst"] diff --git a/crates/vm/levm/Cargo.toml b/crates/vm/levm/Cargo.toml index d4fc6721ed..1907cf0281 100644 --- a/crates/vm/levm/Cargo.toml +++ b/crates/vm/levm/Cargo.toml @@ -4,7 +4,7 @@ version.workspace = true edition.workspace = true [dependencies] -ethrex-common = { path = "../../common", default-features = false } +ethrex-common.workspace = true ethrex-rlp.workspace = true revm-primitives = { version = "14.0.0", features = [ "std", @@ -40,7 +40,7 @@ colored = "2.1.0" spinoff = "0.8.0" [features] -default = ["c-kzg"] +default = [] c-kzg = ["ethrex-common/c-kzg"] ethereum_foundation_tests = []