Skip to main content

Crate confium_attributes

Crate confium_attributes 

Source
Expand description

Attribute-based threshold party selection.

Allows deployments to express predicates like:

  • “at least K signers have attribute X”
  • “at least K distinct values of attribute X”
  • “no signer has attribute Y”
  • “all signers have attribute Z”

Predicates compose via boolean AND/OR/NOT.

See TODO.roadmap/38-attribute-based-threshold.md for the full spec.

Structs§

AttributePredicate
A wrapper for type-safe construction.
SignerAttributes
A signer’s attribute map. Keys are attribute names (e.g., “region”, “role:director”, “expertise:metrology”). Values are sets of strings.

Enums§

ParseError
DSL parse errors.
Predicate
A predicate over signer attributes.

Constants§

MAX_DSL_DEPTH
Maximum nesting depth for recursive DSL constructs (and/or/not). Limits stack-overflow DoS via adversarial inputs. 32 is generous (allows and(and(and(...))) 32 levels deep) and small enough to keep Rust stack usage bounded.

Functions§

evaluate
Evaluate predicate against a list of signers. Returns true iff satisfied.
parse
Parse a DSL expression into a Predicate.