Skip to content

Code Quality: Relax struct-level FftField bounds to impl-block bounds on public verifier types #245

@ocdbytes

Description

@ocdbytes

Several public structs in the verifier and round-execution code have FftField bounds on the struct definition itself. The Rust idiom is to place trait bounds on impl blocks, not struct definitions — the struct just holds data and doesn't need to constrain what can name the type. Currently, downstream code generic over F: Field cannot even name these types without upgrading to FftField

 // Won't compile today:
  fn log_commitment<F: Field>(c: &Commitments<F>) { ... }
  //                ^^^^^^^^ error: FftField is not satisfied

The minimum bound is Field (not unbounded) because the inner types (whir::Commitment, irs_commit::Commitment, whir::FinalClaim, UnivariateEvaluation) require Field on their own struct definitions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions