Summary
The arbitrary feature of arc-consensus-types does not build when the crate is compiled on its own.
Reproduction
On main:
$ cargo check -p arc-consensus-types --features arbitrary
error[E0433]: failed to resolve: could not find `Arbitrary` in `arbitrary`
--> crates/types/src/address.rs:39:53
|
39 | #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
| ^^^^^^^^^ could not find `Arbitrary` in `arbitrary`
Adding only the derive feature moves the failure one step further:
error[E0277]: the trait bound `alloy_primitives::Address: Arbitrary<'_>` is not satisfied
Cause
The feature gates derive(arbitrary::Arbitrary) on Address but declares neither of the two things that derive needs:
arbitrary/derive — the derive macro lives behind that feature of the arbitrary crate.
alloy-primitives/arbitrary — the wrapped alloy_primitives::Address has no Arbitrary impl without it, so the generated impl does not satisfy its bound.
Why CI does not catch it
arc-consensus-db and arc-node-consensus both depend on alloy-rpc-types-engine with features = ["arbitrary"]. In a workspace build, feature unification turns on exactly what this crate omitted, so cargo clippy --all-targets --all-features at the workspace level passes and the gap stays invisible. It only appears when the crate is built alone — which is how a consumer would build it, and crates/types inherits publish from the workspace rather than opting out.
Suggested fix
Declare both, following the pattern arc-evm and arc-node already use, where the arbitrary feature forwards to its alloy dependencies explicitly:
[features]
arbitrary = ["dep:arbitrary", "alloy-primitives/arbitrary"]
[dependencies]
arbitrary = { workspace = true, optional = true, features = ["derive"] }
I have this working locally with no Cargo.lock change and no workspace regression, and opened #231 with it — happy to close that if you would rather take a different approach, such as enabling derive on the workspace-level arbitrary dependency instead.
Summary
The
arbitraryfeature ofarc-consensus-typesdoes not build when the crate is compiled on its own.Reproduction
On
main:Adding only the
derivefeature moves the failure one step further:Cause
The feature gates
derive(arbitrary::Arbitrary)onAddressbut declares neither of the two things that derive needs:arbitrary/derive— the derive macro lives behind that feature of thearbitrarycrate.alloy-primitives/arbitrary— the wrappedalloy_primitives::Addresshas noArbitraryimpl without it, so the generated impl does not satisfy its bound.Why CI does not catch it
arc-consensus-dbandarc-node-consensusboth depend onalloy-rpc-types-enginewithfeatures = ["arbitrary"]. In a workspace build, feature unification turns on exactly what this crate omitted, socargo clippy --all-targets --all-featuresat the workspace level passes and the gap stays invisible. It only appears when the crate is built alone — which is how a consumer would build it, andcrates/typesinheritspublishfrom the workspace rather than opting out.Suggested fix
Declare both, following the pattern
arc-evmandarc-nodealready use, where thearbitraryfeature forwards to its alloy dependencies explicitly:I have this working locally with no
Cargo.lockchange and no workspace regression, and opened #231 with it — happy to close that if you would rather take a different approach, such as enablingderiveon the workspace-levelarbitrarydependency instead.