fix: feature propagation (#11888)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Oliver <onbjerg@users.noreply.github.com>
This commit is contained in:
liamaharon
2024-10-20 07:36:11 +11:00
committed by GitHub
parent 6c026daf92
commit cf4a4454ec
59 changed files with 880 additions and 201 deletions

40
.config/zepter.yaml Normal file
View File

@ -0,0 +1,40 @@
version:
format: 1
# Minimum zepter version that is expected to work. This is just for printing a nice error
# message when someone tries to use an older version.
binary: 0.13.2
# The examples in the following comments assume crate `A` to have a dependency on crate `B`.
workflows:
check:
- [
"lint",
# Check that `A` activates the features of `B`.
"propagate-feature",
# These are the features to check:
"--features=std,optimism,dev,asm-keccak,jemalloc,jemalloc-prof,tracy-allocator,serde-bincode-compat,serde,test-utils,arbitrary,bench",
# Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually.
"--left-side-feature-missing=ignore",
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.
"--left-side-outside-workspace=ignore",
# Auxillary flags:
"--offline",
"--locked",
"--show-path",
"--quiet",
]
default:
# Running `zepter` with no subcommand will check & fix.
- [$check.0, "--fix"]
# Will be displayed when any workflow fails:
help:
text: |
Reth uses the Zepter CLI to detect abnormalities in Cargo features, e.g. missing propagation.
It looks like one more more checks failed; please check the console output.
You can try to automatically address them by installing zepter (`cargo install zepter --locked`) and simply running `zepter` in the workspace root.
links:
- "https://github.com/paradigmxyz/reth/pull/11888"
- "https://github.com/ggwpez/zepter"

View File

@ -219,6 +219,22 @@ jobs:
env: env:
RUSTFLAGS: -D warnings RUSTFLAGS: -D warnings
# Check crates correctly propagate features
feature-propagation:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: fetch deps
run: |
# Eagerly pull dependencies
time cargo metadata --format-version=1 --locked > /dev/null
- name: run zepter
run: |
cargo install zepter -f --locked
zepter --version
time zepter run check
lint-success: lint-success:
name: lint success name: lint success
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -236,6 +252,7 @@ jobs:
- grafana - grafana
- no-test-deps - no-test-deps
- features - features
- feature-propagation
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
- name: Decide whether the needed jobs succeeded or failed - name: Decide whether the needed jobs succeeded or failed

27
Cargo.lock generated
View File

@ -516,6 +516,7 @@ dependencies = [
"alloy-rlp", "alloy-rlp",
"alloy-serde", "alloy-serde",
"alloy-sol-types", "alloy-sol-types",
"arbitrary",
"derive_more 1.0.0", "derive_more 1.0.0",
"itertools 0.13.0", "itertools 0.13.0",
"jsonrpsee-types", "jsonrpsee-types",
@ -1497,6 +1498,17 @@ dependencies = [
"tinyvec", "tinyvec",
] ]
[[package]]
name = "bstr"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c"
dependencies = [
"memchr",
"regex-automata 0.4.8",
"serde",
]
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.16.0" version = "3.16.0"
@ -2258,6 +2270,7 @@ dependencies = [
"lock_api", "lock_api",
"once_cell", "once_cell",
"parking_lot_core 0.9.10", "parking_lot_core 0.9.10",
"serde",
] ]
[[package]] [[package]]
@ -3318,6 +3331,7 @@ version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [ dependencies = [
"serde",
"typenum", "typenum",
"version_check", "version_check",
"zeroize", "zeroize",
@ -4512,7 +4526,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.52.6", "windows-targets 0.48.5",
] ]
[[package]] [[package]]
@ -4623,6 +4637,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588"
dependencies = [ dependencies = [
"linked-hash-map", "linked-hash-map",
"serde",
] ]
[[package]] [[package]]
@ -4645,6 +4660,7 @@ checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"scopeguard", "scopeguard",
"serde",
] ]
[[package]] [[package]]
@ -5009,6 +5025,7 @@ dependencies = [
"libc", "libc",
"log", "log",
"mio 0.8.11", "mio 0.8.11",
"serde",
"walkdir", "walkdir",
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
@ -5277,6 +5294,7 @@ dependencies = [
"alloy-primitives", "alloy-primitives",
"alloy-rpc-types-eth", "alloy-rpc-types-eth",
"alloy-serde", "alloy-serde",
"arbitrary",
"op-alloy-consensus", "op-alloy-consensus",
"serde", "serde",
"serde_json", "serde_json",
@ -5370,6 +5388,7 @@ version = "3.6.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee"
dependencies = [ dependencies = [
"arbitrary",
"arrayvec", "arrayvec",
"bitvec", "bitvec",
"byte-slice-cast", "byte-slice-cast",
@ -10098,6 +10117,10 @@ name = "similar"
version = "2.6.0" version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e"
dependencies = [
"bstr",
"unicode-segmentation",
]
[[package]] [[package]]
name = "similar-asserts" name = "similar-asserts"
@ -10106,6 +10129,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfe85670573cd6f0fa97940f26e7e6601213c3b0555246c24234131f88c5709e" checksum = "cfe85670573cd6f0fa97940f26e7e6601213c3b0555246c24234131f88c5709e"
dependencies = [ dependencies = [
"console", "console",
"serde",
"similar", "similar",
] ]
@ -11016,6 +11040,7 @@ dependencies = [
"parking_lot 0.12.3", "parking_lot 0.12.3",
"rand 0.8.5", "rand 0.8.5",
"resolv-conf", "resolv-conf",
"serde",
"smallvec", "smallvec",
"thiserror", "thiserror",
"tokio", "tokio",

View File

@ -585,7 +585,7 @@ pprof = "0.13"
proptest = "1.4" proptest = "1.4"
proptest-derive = "0.5" proptest-derive = "0.5"
serial_test = { default-features = false, version = "3" } serial_test = { default-features = false, version = "3" }
similar-asserts = { default-features = false, version = "1.5.0" } similar-asserts = { version = "1.5.0", features = ["serde"] }
tempfile = "3.8" tempfile = "3.8"
test-fuzz = "6" test-fuzz = "6"

View File

@ -76,9 +76,16 @@ reth-tracing.workspace = true
[features] [features]
default = ["jemalloc"] default = ["jemalloc"]
asm-keccak = ["reth-primitives/asm-keccak"] asm-keccak = [
"reth-primitives/asm-keccak",
"reth-node-core/asm-keccak",
"alloy-primitives/asm-keccak"
]
jemalloc = ["reth-cli-util/jemalloc"] jemalloc = [
"reth-cli-util/jemalloc",
"reth-node-core/jemalloc"
]
jemalloc-prof = ["reth-cli-util/jemalloc-prof"] jemalloc-prof = ["reth-cli-util/jemalloc-prof"]
tracy-allocator = ["reth-cli-util/tracy-allocator"] tracy-allocator = ["reth-cli-util/tracy-allocator"]

View File

@ -103,14 +103,21 @@ default = ["jemalloc"]
dev = ["reth-cli-commands/dev"] dev = ["reth-cli-commands/dev"]
asm-keccak = ["reth-node-core/asm-keccak", "reth-primitives/asm-keccak"] asm-keccak = [
"reth-node-core/asm-keccak",
"reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak"
]
jemalloc = [ jemalloc = [
"reth-cli-util/jemalloc", "reth-cli-util/jemalloc",
"reth-node-core/jemalloc", "reth-node-core/jemalloc",
"reth-node-metrics/jemalloc", "reth-node-metrics/jemalloc",
] ]
jemalloc-prof = ["reth-cli-util/jemalloc"] jemalloc-prof = [
"reth-cli-util/jemalloc",
"reth-cli-util/jemalloc-prof"
]
tracy-allocator = ["reth-cli-util/tracy-allocator"] tracy-allocator = ["reth-cli-util/tracy-allocator"]
min-error-logs = ["tracing/release_max_level_error"] min-error-logs = ["tracing/release_max_level_error"]

View File

@ -63,5 +63,24 @@ alloy-genesis.workspace = true
alloy-consensus.workspace = true alloy-consensus.workspace = true
[features] [features]
test-utils = [] test-utils = [
optimism = ["reth-primitives/optimism", "reth-provider/optimism"] "reth-chainspec/test-utils",
"reth-consensus/test-utils",
"reth-evm/test-utils",
"reth-network/test-utils",
"reth-primitives/test-utils",
"reth-revm/test-utils",
"reth-stages-api/test-utils",
"reth-db/test-utils",
"reth-db-api/test-utils",
"reth-provider/test-utils",
"reth-trie-db/test-utils",
"reth-trie/test-utils"
]
optimism = [
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-execution-types/optimism",
"reth-db/optimism",
"reth-db-api/optimism"
]

View File

@ -56,9 +56,13 @@ revm.workspace = true
[features] [features]
test-utils = [ test-utils = [
"alloy-signer", "alloy-signer",
"alloy-signer-local", "alloy-signer-local",
"alloy-consensus", "alloy-consensus",
"rand", "rand",
"revm" "revm",
"reth-chainspec/test-utils",
"reth-primitives/test-utils",
"reth-trie/test-utils",
"revm?/test-utils"
] ]

View File

@ -40,11 +40,26 @@ alloy-genesis.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [ std = [
"alloy-chains/std", "alloy-chains/std",
"alloy-eips/std", "alloy-eips/std",
"alloy-genesis/std", "alloy-genesis/std",
"alloy-primitives/std", "alloy-primitives/std",
"alloy-trie/std", "alloy-trie/std",
"reth-primitives-traits/std",
"alloy-consensus/std",
"once_cell/std"
]
arbitrary = [
"alloy-chains/arbitrary",
"reth-ethereum-forks/arbitrary",
"reth-primitives-traits/arbitrary",
"reth-trie-common/arbitrary",
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"alloy-trie/arbitrary"
]
test-utils = [
"reth-primitives-traits/test-utils",
"reth-trie-common/test-utils"
] ]
arbitrary = ["alloy-chains/arbitrary"]
test-utils = []

View File

@ -46,4 +46,12 @@ tokio-stream.workspace = true
tracing.workspace = true tracing.workspace = true
[features] [features]
optimism = ["reth-provider/optimism", "reth-optimism-consensus"] optimism = [
"reth-provider/optimism",
"reth-optimism-consensus",
"reth-beacon-consensus/optimism",
"reth-execution-types/optimism",
"reth-optimism-consensus?/optimism",
"reth-primitives/optimism",
"revm-primitives/optimism"
]

View File

@ -78,8 +78,10 @@ assert_matches.workspace = true
[features] [features]
optimism = [ optimism = [
"reth-chainspec", "reth-chainspec",
"reth-primitives/optimism", "reth-primitives/optimism",
"reth-provider/optimism", "reth-provider/optimism",
"reth-blockchain-tree/optimism", "reth-blockchain-tree/optimism",
"reth-db/optimism",
"reth-db-api/optimism"
] ]

View File

@ -24,5 +24,11 @@ derive_more.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [] std = [
test-utils = [] "reth-primitives/std",
"alloy-primitives/std",
"alloy-eips/std"
]
test-utils = [
"reth-primitives/test-utils"
]

View File

@ -46,4 +46,8 @@ op-alloy-rpc-types-engine = { workspace = true, optional = true }
workspace = true workspace = true
[features] [features]
optimism = ["op-alloy-rpc-types-engine"] optimism = [
"op-alloy-rpc-types-engine",
"reth-beacon-consensus/optimism",
"reth-provider/optimism"
]

View File

@ -79,11 +79,21 @@ assert_matches.workspace = true
[features] [features]
test-utils = [ test-utils = [
"reth-db/test-utils", "reth-db/test-utils",
"reth-chain-state/test-utils", "reth-chain-state/test-utils",
"reth-network-p2p/test-utils", "reth-network-p2p/test-utils",
"reth-prune-types", "reth-prune-types",
"reth-stages/test-utils", "reth-stages/test-utils",
"reth-static-file", "reth-static-file",
"reth-tracing", "reth-tracing",
"reth-blockchain-tree/test-utils",
"reth-chainspec/test-utils",
"reth-consensus/test-utils",
"reth-evm/test-utils",
"reth-payload-builder/test-utils",
"reth-primitives/test-utils",
"reth-revm/test-utils",
"reth-stages-api/test-utils",
"reth-provider/test-utils",
"reth-trie/test-utils"
] ]

View File

@ -50,4 +50,9 @@ itertools.workspace = true
tracing.workspace = true tracing.workspace = true
[features] [features]
optimism = ["reth-beacon-consensus/optimism"] optimism = [
"reth-beacon-consensus/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"revm-primitives/optimism"
]

View File

@ -39,12 +39,27 @@ alloy-consensus.workspace = true
[features] [features]
default = ["std", "serde", "rustc-hash"] default = ["std", "serde", "rustc-hash"]
arbitrary = ["dep:arbitrary", "dep:proptest", "dep:proptest-derive"] arbitrary = [
serde = ["dep:serde"] "dep:arbitrary",
"dep:proptest",
"dep:proptest-derive",
"alloy-chains/arbitrary",
"alloy-consensus/arbitrary",
"alloy-primitives/arbitrary"
]
serde = [
"dep:serde",
"alloy-chains/serde",
"alloy-consensus/serde",
"alloy-primitives/serde"
]
std = [ std = [
"alloy-chains/std", "alloy-chains/std",
"alloy-primitives/std", "alloy-primitives/std",
"thiserror-no-std/std", "thiserror-no-std/std",
"rustc-hash/std", "rustc-hash/std",
"alloy-consensus/std",
"once_cell/std",
"serde?/std"
] ]
rustc-hash = ["dep:rustc-hash"] rustc-hash = ["dep:rustc-hash"]

View File

@ -41,4 +41,14 @@ alloy-genesis.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [] std = [
"reth-consensus/std",
"reth-primitives/std",
"reth-revm/std",
"alloy-consensus/std",
"alloy-eips/std",
"alloy-genesis/std",
"alloy-primitives/std",
"revm-primitives/std",
"secp256k1/std"
]

View File

@ -55,4 +55,17 @@ alloy-consensus.workspace = true
[features] [features]
default = [] default = []
test-utils = ["reth-node-builder/test-utils"] test-utils = [
"reth-node-builder/test-utils",
"reth-chainspec/test-utils",
"reth-consensus/test-utils",
"reth-network/test-utils",
"reth-payload-builder/test-utils",
"reth-primitives/test-utils",
"reth-revm/test-utils",
"reth-db/test-utils",
"reth-provider/test-utils",
"reth-transaction-pool/test-utils",
"revm/test-utils",
"reth-evm/test-utils"
]

View File

@ -42,5 +42,24 @@ reth-ethereum-forks.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = ["dep:metrics", "dep:reth-metrics"] std = [
test-utils = ["dep:parking_lot"] "dep:metrics",
"dep:reth-metrics",
"reth-consensus/std",
"reth-primitives/std",
"reth-primitives-traits/std",
"reth-revm/std",
"alloy-eips/std",
"alloy-primitives/std",
"revm-primitives/std",
"revm/std"
]
test-utils = [
"dep:parking_lot",
"reth-chainspec/test-utils",
"reth-consensus/test-utils",
"reth-primitives/test-utils",
"reth-primitives-traits/test-utils",
"reth-revm/test-utils",
"revm/test-utils"
]

View File

@ -26,4 +26,9 @@ derive_more.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = ["reth-consensus/std"] std = [
"reth-consensus/std",
"alloy-eips/std",
"alloy-primitives/std",
"revm-primitives/std"
]

View File

@ -33,10 +33,24 @@ reth-primitives = { workspace = true, features = ["arbitrary", "test-utils"] }
[features] [features]
default = ["std"] default = ["std"]
optimism = ["reth-primitives/optimism", "revm/optimism"] optimism = ["reth-primitives/optimism", "revm/optimism"]
serde = ["dep:serde", "reth-trie/serde", "revm/serde"] serde = [
serde-bincode-compat = [ "dep:serde",
"reth-primitives/serde-bincode-compat", "reth-trie/serde",
"reth-trie/serde-bincode-compat", "revm/serde",
"serde_with", "alloy-eips/serde",
"alloy-primitives/serde",
"rand/serde"
]
serde-bincode-compat = [
"reth-primitives/serde-bincode-compat",
"reth-trie/serde-bincode-compat",
"serde_with",
"alloy-eips/serde-bincode-compat"
]
std = [
"reth-primitives/std",
"alloy-eips/std",
"alloy-primitives/std",
"revm/std",
"serde?/std"
] ]
std = []

View File

@ -70,4 +70,14 @@ tempfile.workspace = true
[features] [features]
default = [] default = []
serde = ["reth-provider/serde", "reth-exex-types/serde"] serde = [
"reth-provider/serde",
"reth-exex-types/serde",
"reth-revm/serde",
"alloy-consensus/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"parking_lot/serde",
"rand/serde",
"secp256k1/serde"
]

View File

@ -33,5 +33,16 @@ rand.workspace = true
[features] [features]
default = [] default = []
serde = ["dep:serde", "reth-execution-types/serde"] serde = [
serde-bincode-compat = ["reth-execution-types/serde-bincode-compat", "serde_with"] "dep:serde",
"reth-execution-types/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"rand/serde"
]
serde-bincode-compat = [
"reth-execution-types/serde-bincode-compat",
"serde_with",
"reth-primitives/serde-bincode-compat",
"alloy-eips/serde-bincode-compat"
]

View File

@ -51,5 +51,14 @@ reth-tracing.workspace = true
[features] [features]
default = ["serde"] default = ["serde"]
serde = ["dep:serde"] serde = [
"dep:serde",
"alloy-primitives/serde",
"discv5/serde",
"enr/serde",
"generic-array/serde",
"parking_lot/serde",
"rand?/serde",
"secp256k1/serde"
]
test-utils = ["dep:rand"] test-utils = ["dep:rand"]

View File

@ -48,4 +48,15 @@ reth-tracing.workspace = true
rand.workspace = true rand.workspace = true
[features] [features]
serde = ["dep:serde", "dep:serde_with"] serde = [
"dep:serde",
"dep:serde_with",
"alloy-chains/serde",
"alloy-primitives/serde",
"enr/serde",
"linked_hash_set/serde",
"parking_lot/serde",
"rand/serde",
"secp256k1/serde",
"trust-dns-resolver/serde"
]

View File

@ -71,10 +71,14 @@ tempfile.workspace = true
[features] [features]
test-utils = [ test-utils = [
"dep:tempfile", "dep:tempfile",
"dep:reth-db-api", "dep:reth-db-api",
"reth-db/test-utils", "reth-db/test-utils",
"reth-consensus/test-utils", "reth-consensus/test-utils",
"reth-network-p2p/test-utils", "reth-network-p2p/test-utils",
"reth-testing-utils", "reth-testing-utils",
"reth-chainspec/test-utils",
"reth-primitives/test-utils",
"reth-db-api?/test-utils",
"reth-provider/test-utils"
] ]

View File

@ -45,10 +45,22 @@ alloy-consensus.workspace = true
[features] [features]
arbitrary = [ arbitrary = [
"reth-primitives/arbitrary", "reth-primitives/arbitrary",
"alloy-chains/arbitrary", "alloy-chains/arbitrary",
"dep:arbitrary", "dep:arbitrary",
"dep:proptest", "dep:proptest",
"dep:proptest-arbitrary-interop", "dep:proptest-arbitrary-interop",
"reth-chainspec/arbitrary",
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary"
]
serde = [
"dep:serde",
"alloy-chains/serde",
"alloy-consensus/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"bytes/serde",
"rand/serde"
] ]
serde = ["dep:serde"]

View File

@ -66,11 +66,22 @@ alloy-eips.workspace = true
[features] [features]
arbitrary = [ arbitrary = [
"reth-primitives/arbitrary", "reth-primitives/arbitrary",
"reth-eth-wire-types/arbitrary", "reth-eth-wire-types/arbitrary",
"dep:arbitrary", "dep:arbitrary",
"reth-chainspec/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary"
]
serde = [
"dep:serde",
"reth-eth-wire-types/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"bytes/serde",
"rand/serde",
"secp256k1/serde"
] ]
serde = ["dep:serde", "reth-eth-wire-types/serde"]
[[test]] [[test]]
name = "fuzz_roundtrip" name = "fuzz_roundtrip"

View File

@ -40,4 +40,10 @@ derive_more.workspace = true
[features] [features]
default = ["serde"] default = ["serde"]
serde = ["dep:serde"] serde = [
"dep:serde",
"reth-eth-wire-types/serde",
"reth-network-types/serde",
"alloy-primitives/serde",
"enr/serde"
]

View File

@ -101,8 +101,36 @@ criterion = { workspace = true, features = ["async_tokio", "html_reports"] }
[features] [features]
default = ["serde"] default = ["serde"]
geth-tests = [] geth-tests = []
serde = ["dep:serde", "secp256k1/serde", "enr/serde", "reth-network-types/serde"] serde = [
test-utils = ["dep:reth-provider", "reth-provider?/test-utils", "dep:tempfile", "reth-transaction-pool/test-utils", "reth-network-types/test-utils"] "dep:serde",
"secp256k1/serde",
"enr/serde",
"reth-network-types/serde",
"reth-dns-discovery/serde",
"reth-eth-wire/serde",
"reth-provider?/serde",
"alloy-consensus/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"discv5/serde",
"parking_lot/serde",
"rand/serde",
"smallvec/serde",
"url/serde"
]
test-utils = [
"dep:reth-provider",
"reth-provider?/test-utils",
"dep:tempfile",
"reth-transaction-pool/test-utils",
"reth-network-types/test-utils",
"reth-chainspec/test-utils",
"reth-consensus/test-utils",
"reth-discv4/test-utils",
"reth-network/test-utils",
"reth-network-p2p/test-utils",
"reth-primitives/test-utils"
]
[[bench]] [[bench]]
name = "bench" name = "bench"

View File

@ -43,5 +43,15 @@ tokio = { workspace = true, features = ["full"] }
[features] [features]
default = ["std"] default = ["std"]
test-utils = ["reth-consensus/test-utils", "parking_lot"] test-utils = [
std = ["reth-consensus/std"] "reth-consensus/test-utils",
"parking_lot",
"reth-network-types/test-utils",
"reth-primitives/test-utils"
]
std = [
"reth-consensus/std",
"reth-primitives/std",
"alloy-eips/std",
"alloy-primitives/std"
]

View File

@ -96,4 +96,21 @@ tempfile.workspace = true
[features] [features]
default = [] default = []
test-utils = ["reth-db/test-utils"] test-utils = [
"reth-db/test-utils",
"reth-blockchain-tree/test-utils",
"reth-chain-state/test-utils",
"reth-chainspec/test-utils",
"reth-consensus/test-utils",
"reth-engine-tree/test-utils",
"reth-evm/test-utils",
"reth-downloaders/test-utils",
"reth-network/test-utils",
"reth-network-p2p/test-utils",
"reth-payload-builder/test-utils",
"reth-primitives/test-utils",
"reth-stages/test-utils",
"reth-db-api/test-utils",
"reth-provider/test-utils",
"reth-transaction-pool/test-utils"
]

View File

@ -76,10 +76,18 @@ proptest.workspace = true
tokio.workspace = true tokio.workspace = true
[features] [features]
optimism = ["reth-primitives/optimism"] optimism = [
"reth-primitives/optimism",
"reth-db/optimism"
]
# Features for vergen to generate correct env vars # Features for vergen to generate correct env vars
jemalloc = [] jemalloc = [
asm-keccak = [] "reth-cli-util/jemalloc"
]
asm-keccak = [
"reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak"
]
[build-dependencies] [build-dependencies]
vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] } vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] }

View File

@ -37,7 +37,15 @@ tracy-allocator = ["reth-cli-util/tracy-allocator"]
asm-keccak = ["reth-optimism-cli/asm-keccak", "reth-optimism-node/asm-keccak"] asm-keccak = ["reth-optimism-cli/asm-keccak", "reth-optimism-node/asm-keccak"]
optimism = ["reth-optimism-cli/optimism", "reth-optimism-node/optimism"] optimism = [
"reth-optimism-cli/optimism",
"reth-optimism-node/optimism",
"reth-optimism-consensus/optimism",
"reth-optimism-evm/optimism",
"reth-optimism-payload-builder/optimism",
"reth-optimism-rpc/optimism",
"reth-provider/optimism"
]
min-error-logs = ["tracing/release_max_level_error"] min-error-logs = ["tracing/release_max_level_error"]
min-warn-logs = ["tracing/release_max_level_warn"] min-warn-logs = ["tracing/release_max_level_warn"]

View File

@ -45,12 +45,14 @@ op-alloy-rpc-types.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [ std = [
"alloy-chains/std", "alloy-chains/std",
"alloy-genesis/std", "alloy-genesis/std",
"alloy-primitives/std", "alloy-primitives/std",
"op-alloy-rpc-types/std", "op-alloy-rpc-types/std",
"reth-chainspec/std", "reth-chainspec/std",
"reth-ethereum-forks/std", "reth-ethereum-forks/std",
"reth-primitives-traits/std", "reth-primitives-traits/std",
"reth-optimism-forks/std", "reth-optimism-forks/std",
"alloy-consensus/std",
"once_cell/std"
] ]

View File

@ -73,11 +73,14 @@ reth-cli-commands.workspace = true
[features] [features]
optimism = [ optimism = [
"reth-primitives/optimism", "reth-primitives/optimism",
"reth-optimism-evm/optimism", "reth-optimism-evm/optimism",
"reth-provider/optimism", "reth-provider/optimism",
"reth-node-core/optimism", "reth-node-core/optimism",
"reth-optimism-node/optimism", "reth-optimism-node/optimism",
"reth-execution-types/optimism",
"reth-db/optimism",
"reth-db-api/optimism"
] ]
asm-keccak = [ asm-keccak = [
"alloy-primitives/asm-keccak", "alloy-primitives/asm-keccak",

View File

@ -51,10 +51,21 @@ alloy-consensus.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [] std = [
optimism = [ "reth-consensus/std",
"reth-primitives/optimism", "reth-primitives/std",
"reth-execution-types/optimism", "reth-revm/std",
"reth-optimism-consensus/optimism", "alloy-consensus/std",
"revm/optimism", "alloy-eips/std",
"alloy-genesis/std",
"alloy-primitives/std",
"revm-primitives/std",
"revm/std"
]
optimism = [
"reth-primitives/optimism",
"reth-execution-types/optimism",
"reth-optimism-consensus/optimism",
"revm/optimism",
"revm-primitives/optimism"
] ]

View File

@ -27,5 +27,13 @@ once_cell.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [] std = [
serde = ["dep:serde"] "alloy-primitives/std",
"once_cell/std",
"serde?/std"
]
serde = [
"dep:serde",
"alloy-chains/serde",
"alloy-primitives/serde"
]

View File

@ -69,15 +69,35 @@ op-alloy-consensus.workspace = true
[features] [features]
optimism = [ optimism = [
"reth-primitives/optimism", "reth-primitives/optimism",
"reth-provider/optimism", "reth-provider/optimism",
"reth-optimism-evm/optimism", "reth-optimism-evm/optimism",
"reth-optimism-payload-builder/optimism", "reth-optimism-payload-builder/optimism",
"reth-beacon-consensus/optimism", "reth-beacon-consensus/optimism",
"revm/optimism", "revm/optimism",
"reth-auto-seal-consensus/optimism", "reth-auto-seal-consensus/optimism",
"reth-optimism-rpc/optimism", "reth-optimism-rpc/optimism",
"reth-engine-local/optimism", "reth-engine-local/optimism",
"reth-optimism-consensus/optimism",
"reth-db/optimism"
]
asm-keccak = [
"reth-primitives/asm-keccak",
"reth/asm-keccak",
"alloy-primitives/asm-keccak",
"revm/asm-keccak"
]
test-utils = [
"reth-node-builder/test-utils",
"reth-chainspec/test-utils",
"reth-consensus/test-utils",
"reth-evm/test-utils",
"reth-network/test-utils",
"reth-payload-builder/test-utils",
"reth-primitives/test-utils",
"reth-revm/test-utils",
"reth-db/test-utils",
"reth-provider/test-utils",
"reth-transaction-pool/test-utils",
"revm/test-utils"
] ]
asm-keccak = ["reth-primitives/asm-keccak"]
test-utils = ["reth-node-builder/test-utils"]

View File

@ -50,8 +50,11 @@ sha2.workspace = true
[features] [features]
optimism = [ optimism = [
"reth-primitives/optimism", "reth-primitives/optimism",
"reth-provider/optimism", "reth-provider/optimism",
"reth-optimism-evm/optimism", "reth-optimism-evm/optimism",
"revm/optimism", "revm/optimism",
"reth-execution-types/optimism",
"reth-optimism-consensus/optimism",
"revm-primitives/optimism"
] ]

View File

@ -63,8 +63,9 @@ reth-optimism-chainspec.workspace = true
[features] [features]
optimism = [ optimism = [
"reth-optimism-evm/optimism", "reth-optimism-evm/optimism",
"reth-primitives/optimism", "reth-primitives/optimism",
"reth-provider/optimism", "reth-provider/optimism",
"revm/optimism", "revm/optimism",
"reth-optimism-consensus/optimism"
] ]

View File

@ -20,4 +20,8 @@ reth-prune-types.workspace = true
reth-stages-types.workspace = true reth-stages-types.workspace = true
[features] [features]
optimism = ["reth-primitives/optimism"] optimism = [
"reth-primitives/optimism",
"reth-codecs/optimism",
"reth-db-api/optimism"
]

View File

@ -40,4 +40,10 @@ tracing.workspace = true
revm.workspace = true revm.workspace = true
[features] [features]
test-utils = ["reth-chain-state"] test-utils = [
"reth-chain-state",
"reth-chain-state?/test-utils",
"reth-primitives/test-utils",
"reth-provider/test-utils",
"revm/test-utils"
]

View File

@ -54,14 +54,30 @@ test-fuzz.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [] std = [
test-utils = ["arbitrary"] "alloy-consensus/std",
arbitrary = [ "alloy-eips/std",
"std", "alloy-genesis/std",
"alloy-consensus/arbitrary", "alloy-primitives/std",
"alloy-primitives/arbitrary", "revm-primitives/std",
"dep:arbitrary", "serde/std"
"dep:proptest", ]
"dep:proptest-arbitrary-interop", test-utils = [
"arbitrary",
"reth-codecs/test-utils"
]
arbitrary = [
"std",
"alloy-consensus/arbitrary",
"alloy-primitives/arbitrary",
"dep:arbitrary",
"dep:proptest",
"dep:proptest-arbitrary-interop",
"alloy-eips/arbitrary",
"revm-primitives/arbitrary"
]
serde-bincode-compat = [
"serde_with",
"alloy-consensus/serde-bincode-compat",
"alloy-eips/serde-bincode-compat"
] ]
serde-bincode-compat = ["serde_with", "alloy-consensus/serde-bincode-compat"]

View File

@ -90,18 +90,41 @@ pprof = { workspace = true, features = [
[features] [features]
default = ["c-kzg", "alloy-compat", "std", "reth-codec", "secp256k1"] default = ["c-kzg", "alloy-compat", "std", "reth-codec", "secp256k1"]
std = ["reth-primitives-traits/std"] std = [
"reth-primitives-traits/std",
"alloy-consensus/std",
"alloy-eips/std",
"alloy-genesis/std",
"alloy-primitives/std",
"alloy-serde?/std",
"k256/std",
"once_cell/std",
"revm-primitives/std",
"secp256k1?/std",
"serde/std"
]
reth-codec = ["dep:reth-codecs", "dep:zstd", "dep:modular-bitfield", "std"] reth-codec = ["dep:reth-codecs", "dep:zstd", "dep:modular-bitfield", "std"]
asm-keccak = ["alloy-primitives/asm-keccak"] asm-keccak = [
"alloy-primitives/asm-keccak",
"revm-primitives/asm-keccak"
]
arbitrary = [ arbitrary = [
"dep:arbitrary", "dep:arbitrary",
"alloy-eips/arbitrary", "alloy-eips/arbitrary",
"rand", "rand",
"reth-codec", "reth-codec",
"reth-ethereum-forks/arbitrary", "reth-ethereum-forks/arbitrary",
"reth-primitives-traits/arbitrary", "reth-primitives-traits/arbitrary",
"revm-primitives/arbitrary", "revm-primitives/arbitrary",
"secp256k1", "secp256k1",
"reth-chainspec/arbitrary",
"reth-trie-common/arbitrary",
"alloy-consensus/arbitrary",
"alloy-primitives/arbitrary",
"alloy-rpc-types?/arbitrary",
"alloy-serde?/arbitrary",
"op-alloy-consensus?/arbitrary",
"op-alloy-rpc-types?/arbitrary"
] ]
secp256k1 = ["dep:secp256k1"] secp256k1 = ["dep:secp256k1"]
c-kzg = [ c-kzg = [
@ -121,12 +144,18 @@ alloy-compat = [
"dep:alloy-serde", "dep:alloy-serde",
"dep:op-alloy-rpc-types", "dep:op-alloy-rpc-types",
] ]
test-utils = ["reth-primitives-traits/test-utils"] test-utils = [
"reth-primitives-traits/test-utils",
"reth-chainspec/test-utils",
"reth-codecs?/test-utils",
"reth-trie-common/test-utils"
]
serde-bincode-compat = [ serde-bincode-compat = [
"alloy-consensus/serde-bincode-compat", "alloy-consensus/serde-bincode-compat",
"op-alloy-consensus?/serde-bincode-compat", "op-alloy-consensus?/serde-bincode-compat",
"reth-primitives-traits/serde-bincode-compat", "reth-primitives-traits/serde-bincode-compat",
"serde_with", "serde_with",
"alloy-eips/serde-bincode-compat"
] ]
[[bench]] [[bench]]

View File

@ -34,6 +34,21 @@ alloy-primitives.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [] std = [
test-utils = ["dep:reth-trie"] "reth-primitives/std",
serde = ["revm/serde"] "alloy-primitives/std",
"revm/std",
"alloy-eips/std"
]
test-utils = [
"dep:reth-trie",
"reth-primitives/test-utils",
"reth-trie?/test-utils",
"revm/test-utils"
]
serde = [
"revm/serde",
"reth-trie?/serde",
"alloy-eips/serde",
"alloy-primitives/serde"
]

View File

@ -46,4 +46,9 @@ tokio-stream.workspace = true
reth-testing-utils.workspace = true reth-testing-utils.workspace = true
[features] [features]
test-utils = [] test-utils = [
"reth-consensus/test-utils",
"reth-network-p2p/test-utils",
"reth-primitives-traits/test-utils",
"reth-provider/test-utils"
]

View File

@ -93,13 +93,24 @@ pprof = { workspace = true, features = [
[features] [features]
test-utils = [ test-utils = [
"dep:reth-chainspec", "dep:reth-chainspec",
"reth-network-p2p/test-utils", "reth-network-p2p/test-utils",
"reth-db/test-utils", "reth-db/test-utils",
"reth-provider/test-utils", "reth-provider/test-utils",
"reth-stages-api/test-utils", "reth-stages-api/test-utils",
"dep:reth-testing-utils", "dep:reth-testing-utils",
"dep:tempfile", "dep:tempfile",
"reth-chainspec?/test-utils",
"reth-consensus/test-utils",
"reth-evm/test-utils",
"reth-downloaders/test-utils",
"reth-primitives/test-utils",
"reth-primitives-traits/test-utils",
"reth-revm/test-utils",
"reth-codecs/test-utils",
"reth-db-api/test-utils",
"reth-trie-db/test-utils",
"reth-trie/test-utils"
] ]
[[bench]] [[bench]]

View File

@ -49,7 +49,15 @@ serde.workspace = true
[features] [features]
default = ["std", "alloy"] default = ["std", "alloy"]
std = ["alloy-primitives/std", "bytes/std"] std = [
"alloy-primitives/std",
"bytes/std",
"alloy-consensus?/std",
"alloy-eips?/std",
"alloy-genesis?/std",
"alloy-trie?/std",
"serde/std"
]
alloy = [ alloy = [
"dep:alloy-consensus", "dep:alloy-consensus",
"dep:alloy-eips", "dep:alloy-eips",

View File

@ -56,11 +56,25 @@ proptest.workspace = true
proptest-arbitrary-interop.workspace = true proptest-arbitrary-interop.workspace = true
[features] [features]
test-utils = ["arbitrary"] test-utils = [
arbitrary = [ "arbitrary",
"reth-primitives/arbitrary", "reth-primitives/test-utils",
"reth-db-models/arbitrary", "reth-primitives-traits/test-utils",
"dep:arbitrary", "reth-codecs/test-utils",
"dep:proptest", "reth-db-models/test-utils",
"reth-trie-common/test-utils"
]
arbitrary = [
"reth-primitives/arbitrary",
"reth-db-models/arbitrary",
"dep:arbitrary",
"dep:proptest",
"reth-primitives-traits/arbitrary",
"reth-trie-common/arbitrary",
"alloy-primitives/arbitrary",
"parity-scale-codec/arbitrary"
]
optimism = [
"reth-primitives/optimism",
"reth-codecs/optimism"
] ]
optimism = ["reth-primitives/optimism"]

View File

@ -39,5 +39,14 @@ proptest-arbitrary-interop.workspace = true
test-fuzz.workspace = true test-fuzz.workspace = true
[features] [features]
test-utils = ["arbitrary"] test-utils = [
arbitrary = ["reth-primitives/arbitrary", "dep:arbitrary", "dep:proptest"] "arbitrary",
"reth-primitives/test-utils",
"reth-codecs/test-utils"
]
arbitrary = [
"reth-primitives/arbitrary",
"dep:arbitrary",
"dep:proptest",
"alloy-primitives/arbitrary"
]

View File

@ -89,10 +89,28 @@ mdbx = [
"dep:strum", "dep:strum",
"dep:rustc-hash", "dep:rustc-hash",
] ]
test-utils = ["dep:tempfile", "arbitrary", "parking_lot"] test-utils = [
"dep:tempfile",
"arbitrary",
"parking_lot",
"reth-primitives/test-utils",
"reth-primitives-traits/test-utils",
"reth-db-api/test-utils",
"reth-nippy-jar/test-utils",
"reth-trie-common/test-utils"
]
bench = [] bench = []
arbitrary = ["reth-primitives/arbitrary", "reth-db-api/arbitrary"] arbitrary = [
optimism = [] "reth-primitives/arbitrary",
"reth-db-api/arbitrary",
"reth-primitives-traits/arbitrary",
"reth-trie-common/arbitrary",
"alloy-primitives/arbitrary"
]
optimism = [
"reth-primitives/optimism",
"reth-db-api/optimism"
]
disable-lock = [] disable-lock = []
[[bench]] [[bench]]

View File

@ -25,4 +25,8 @@ derive_more.workspace = true
[features] [features]
default = ["std"] default = ["std"]
std = [] std = [
"reth-primitives/std",
"alloy-eips/std",
"alloy-primitives/std"
]

View File

@ -88,16 +88,41 @@ alloy-consensus.workspace = true
[features] [features]
optimism = [ optimism = [
"reth-primitives/optimism", "reth-primitives/optimism",
"reth-execution-types/optimism", "reth-execution-types/optimism",
"reth-optimism-primitives", "reth-optimism-primitives",
"reth-codecs/optimism",
"reth-db/optimism",
"reth-db-api/optimism",
"revm/optimism"
]
serde = [
"reth-execution-types/serde",
"reth-trie-db/serde",
"reth-trie/serde",
"alloy-consensus?/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"alloy-rpc-types-engine/serde",
"dashmap/serde",
"notify/serde",
"parking_lot/serde",
"rand/serde",
"revm/serde"
] ]
serde = ["reth-execution-types/serde"]
test-utils = [ test-utils = [
"reth-db/test-utils", "reth-db/test-utils",
"reth-nippy-jar/test-utils", "reth-nippy-jar/test-utils",
"reth-trie/test-utils", "reth-trie/test-utils",
"reth-chain-state/test-utils", "reth-chain-state/test-utils",
"reth-ethereum-engine-primitives", "reth-ethereum-engine-primitives",
"alloy-consensus", "alloy-consensus",
"reth-chainspec/test-utils",
"reth-evm/test-utils",
"reth-network-p2p/test-utils",
"reth-primitives/test-utils",
"reth-codecs/test-utils",
"reth-db-api/test-utils",
"reth-trie-db/test-utils",
"revm/test-utils"
] ]

View File

@ -72,12 +72,42 @@ serde_json.workspace = true
[features] [features]
default = ["serde"] default = ["serde"]
serde = ["dep:serde"] serde = [
test-utils = ["rand", "paste", "serde"] "dep:serde",
"reth-execution-types/serde",
"reth-eth-wire-types/serde",
"reth-provider/serde",
"alloy-consensus/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"bitflags/serde",
"parking_lot/serde",
"rand?/serde",
"revm/serde",
"smallvec/serde"
]
test-utils = [
"rand",
"paste",
"serde",
"reth-chain-state/test-utils",
"reth-chainspec/test-utils",
"reth-primitives/test-utils",
"reth-provider/test-utils",
"revm/test-utils"
]
arbitrary = [ arbitrary = [
"proptest", "proptest",
"reth-primitives/arbitrary", "reth-primitives/arbitrary",
"proptest-arbitrary-interop", "proptest-arbitrary-interop",
"reth-chainspec/arbitrary",
"reth-eth-wire-types/arbitrary",
"alloy-consensus/arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"bitflags/arbitrary",
"revm/arbitrary",
"smallvec/arbitrary"
] ]
[[bench]] [[bench]]

View File

@ -41,8 +41,19 @@ hash-db = "=0.15.2"
plain_hasher = "0.2" plain_hasher = "0.2"
[features] [features]
test-utils = ["dep:plain_hasher", "dep:hash-db", "arbitrary"] test-utils = [
arbitrary = [ "dep:plain_hasher",
"alloy-trie/arbitrary", "dep:hash-db",
"dep:arbitrary", "arbitrary",
"reth-primitives-traits/test-utils",
"reth-codecs/test-utils"
]
arbitrary = [
"alloy-trie/arbitrary",
"dep:arbitrary",
"reth-primitives-traits/arbitrary",
"alloy-consensus/arbitrary",
"alloy-primitives/arbitrary",
"nybbles/arbitrary",
"revm-primitives/arbitrary"
] ]

View File

@ -66,5 +66,23 @@ similar-asserts.workspace = true
[features] [features]
metrics = ["reth-metrics", "reth-trie/metrics", "dep:metrics"] metrics = ["reth-metrics", "reth-trie/metrics", "dep:metrics"]
serde = ["dep:serde"] serde = [
test-utils = ["triehash", "reth-trie-common/test-utils"] "dep:serde",
"reth-provider/serde",
"reth-trie/serde",
"alloy-consensus/serde",
"alloy-primitives/serde",
"revm/serde",
"similar-asserts/serde"
]
test-utils = [
"triehash",
"reth-trie-common/test-utils",
"reth-chainspec/test-utils",
"reth-primitives/test-utils",
"reth-db/test-utils",
"reth-db-api/test-utils",
"reth-provider/test-utils",
"reth-trie/test-utils",
"revm/test-utils"
]

View File

@ -64,9 +64,23 @@ bincode.workspace = true
[features] [features]
metrics = ["reth-metrics", "dep:metrics"] metrics = ["reth-metrics", "dep:metrics"]
serde = ["dep:serde"] serde = [
serde-bincode-compat = ["serde_with"] "dep:serde",
test-utils = ["triehash", "reth-trie-common/test-utils"] "alloy-consensus/serde",
"alloy-primitives/serde",
"revm/serde"
]
serde-bincode-compat = [
"serde_with",
"reth-primitives/serde-bincode-compat",
"alloy-consensus/serde-bincode-compat"
]
test-utils = [
"triehash",
"reth-trie-common/test-utils",
"reth-primitives/test-utils",
"revm/test-utils"
]
[[bench]] [[bench]]
name = "prefix_set" name = "prefix_set"

View File

@ -13,7 +13,11 @@ workspace = true
[features] [features]
ef-tests = [] ef-tests = []
asm-keccak = ["reth-primitives/asm-keccak"] asm-keccak = [
"reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak",
"revm/asm-keccak"
]
[dependencies] [dependencies]
reth-chainspec.workspace = true reth-chainspec.workspace = true