Expand description
Compact validator participation bitmap (SPEC §2.10).
§Requirements trace
- ATT-004 — struct shape,
MAX_VALIDATORS,new/from_bytes/ bit accessors / counts / thresholds /as_bytes. - ATT-005 —
SignerBitmap::merge,SignerBitmap::signer_indices(bitwise OR aggregation + sorted index list). - NORMATIVE — ATT-004 / ATT-005 API obligations.
§Encoding
- Byte length:
ceil(validator_count / 8)— seeSignerBitmap::new. - Bit order: LSB-first within each byte (validator
i→ bytei/8, biti % 8). This matches the pseudocode in ATT-004 and keeps popcount-basedSignerBitmap::signer_countaligned with the spec.
§Usage
Construct with SignerBitmap::new, mark signers with SignerBitmap::set_signed, query with
SignerBitmap::has_signed, SignerBitmap::signer_count, SignerBitmap::signing_percentage, and
SignerBitmap::has_threshold. Combine peer views with SignerBitmap::merge and enumerate participants
in order via SignerBitmap::signer_indices. Raw wire bytes are exposed through SignerBitmap::as_bytes
/ SignerBitmap::from_bytes for bincode payloads (SER-001).
§Safety / limits
SignerBitmap::new and SignerBitmap::from_bytes assert validator_count <= MAX_VALIDATORS so a
single u32 cannot force multi-gigabyte allocations in this crate; the protocol cap is 65536 validators.
Structs§
- Signer
Bitmap - Bit vector of “which validators signed,” sized for a fixed validator set (SPEC §2.10).
Constants§
- MAX_
VALIDATORS - Maximum number of validators representable in protocol bitmaps (SPEC §2.10, ATT-004).