Skip to content

bug: arc-consensus-types does not build with --no-default-features; signer-local gates a mandatory dependency #236

Description

@mehmetkr-31

Summary

arc-consensus-types does not build with --no-default-features, and the signer-local feature that causes it provides no actual optionality.

Reproduction

On main:

$ cargo check -p arc-consensus-types --no-default-features
error[E0432]: unresolved import `malachitebft_signing_ed25519`
  --> crates/types/src/proposal_part.rs:26:5
error[E0432]: unresolved import `malachitebft_signing_ed25519`
  --> crates/types/src/codec/proto.rs:28:5
error[E0432]: unresolved import `malachitebft_signing_ed25519`
  --> crates/types/src/signing.rs:21:9
error[E0432]: unresolved import `malachitebft_signing_ed25519`
  --> crates/types/src/ssz/v1/vote.rs:21:5
error: could not compile `arc-consensus-types` (lib) due to 4 previous errors

Cause

[features]
default = ["signer-local"]
signer-local = ["dep:malachitebft-signing-ed25519"]

The four modules above import malachitebft_signing_ed25519 unconditionally, and feature = "signer-local" never appears in a #[cfg] anywhere in the workspace — it exists only to gate the dependency. So the feature cannot meaningfully be turned off: with it the crate builds, without it the build breaks with unresolved imports rather than a diagnosable message.

Worth contrasting with arc-signer, which has a genuine choice between signing providers and states it properly:

#[cfg(not(any(feature = "local", feature = "remote")))]
compile_error!("At least one signing provider feature must be enabled");

cargo check -p arc-signer --no-default-features fails with that sentence instead of an import error. arc-consensus-types has no such choice to express.

Suggested fix

Make malachitebft-signing-ed25519 a required dependency and drop signer-local along with the now-empty default. No crate in the workspace requests signer-local explicitly, so nothing needs updating alongside it.

Opened as #237. One thing worth your call: removing the feature name means an external consumer who spelled out features = ["signer-local"] would get an unknown-feature error, even though no such consumer can exist today (the crate does not build without it). If you would rather preserve the name, keeping signer-local = [] as a no-op alias achieves the same fix while staying spelling-compatible — happy to switch to that. The other alternative is to keep the feature and add a compile_error! guard like arc-signer's, which turns the failure into a clear message but leaves a flag that can only ever be on.

Note

This is the second feature-declaration gap in this crate; see also #233 (the arbitrary feature does not build standalone). Both are invisible to CI, which only ever builds the full workspace with --all-features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions