From 00fe6842fbe8912df7a30697d93a3c9e56035067 Mon Sep 17 00:00:00 2001 From: mehmetkr-31 Date: Fri, 7 Aug 2026 00:02:39 +0300 Subject: [PATCH] fix(types): make the arbitrary feature self-contained `cargo check -p arc-consensus-types --features arbitrary` fails: error[E0433]: failed to resolve: could not find `Arbitrary` in `arbitrary` --> crates/types/src/address.rs:39 | #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] The feature gates `derive(arbitrary::Arbitrary)` on `Address`, but it declared neither of the two things that derive needs: - the `derive` feature of the `arbitrary` crate, which provides the derive macro itself; - `alloy-primitives/arbitrary`, without which the generated impl fails with `the trait bound alloy_primitives::Address: Arbitrary<'_> is not satisfied`, since the wrapped type has no `Arbitrary` impl. This is invisible in a workspace build: `arc-consensus-db` and `arc-node-consensus` both depend on `alloy-rpc-types-engine` with `features = ["arbitrary"]`, and feature unification turns on what this crate omitted. Building the crate on its own is what exposes it. Declare both, following the pattern already used by `arc-evm` and `arc-node`, whose `arbitrary` features forward to their alloy dependencies explicitly. Cargo.lock is unchanged. `cargo check --workspace --all-features` still passes, and `cargo test -p arc-consensus-types --features arbitrary` passes (192 tests). Co-Authored-By: Claude Opus 5 --- crates/types/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index 0228926b..d445499d 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -9,7 +9,7 @@ publish.workspace = true [features] default = ["signer-local"] -arbitrary = ["dep:arbitrary"] +arbitrary = ["dep:arbitrary", "alloy-primitives/arbitrary"] signer-local = ["dep:malachitebft-signing-ed25519"] [dependencies] @@ -21,7 +21,7 @@ alloy-rlp = { workspace = true } alloy-rpc-types-engine = { workspace = true, features = ["ssz"] } # others -arbitrary = { workspace = true, optional = true } +arbitrary = { workspace = true, optional = true, features = ["derive"] } arc-shared = { workspace = true } async-trait = { workspace = true } bytes = { workspace = true }