Expand description
Consensus types shared across the crate.
This module defines the core types used throughout the consensus implementation:
-
Epoch: Represents a distinct segment of a contiguous sequence of views. When the validator set changes, the epoch increments. Epochs provide reconfiguration boundaries for the consensus protocol. -
Height: Represents a sequential position in a chain or sequence. -
View: A monotonically increasing counter within a single epoch, representing individual consensus rounds. Views advance as the protocol progresses through proposals and votes. -
Round: Combines an epoch and view into a single identifier for a consensus round. Provides ordering across epoch boundaries. -
Delta: A generic type representing offsets or durations for consensus types. Provides type safety to prevent mixing epoch, height, and view deltas. Type aliasesEpochDelta,HeightDelta, andViewDeltaare provided for convenience. -
Epocher: Mechanism for determining epoch boundaries. -
coding::Commitment: A unique identifier combining a block digest, coding digest, context hash, and encoded coding configuration. Used as the certificate payload for erasure-coded blocks.
§Arithmetic Safety
Arithmetic operations avoid silent errors. Only next() panics on overflow. All other
operations either saturate or return Option.
§Type Conversions
Explicit type constructors (Epoch::new(), View::new()) are required to create instances
from raw integers. Implicit conversions via, e.g. From<u64> are intentionally not provided
to prevent accidental type misuse.
Modules§
- coding
- Types and utilities for working with
Commitments.
Structs§
- Delta
- A generic type representing offsets or durations for consensus types.
- Epoch
- Represents a distinct segment of a contiguous sequence of views.
- Epoch
Info - Information about an epoch relative to a specific height.
- Fixed
Epocher - Implementation of
Epocherfor fixed epoch lengths. - Height
- Represents a sequential position in a chain or sequence.
- Height
Range - An iterator over a range of heights.
- Participant
- Re-export Participant from commonware_utils for convenience. Represents a participant/validator index within a consensus committee.
- Round
- A unique identifier combining epoch and view for a consensus round.
- View
- A monotonically increasing counter within a single epoch.
- View
Range - An iterator over a range of views.
Enums§
- Epoch
Phase - Represents the relative position within an epoch.
Traits§
- Epocher
- Mechanism for determining epoch boundaries.
Type Aliases§
- Epoch
Delta - Type alias for epoch offsets and durations.
- Height
Delta - Type alias for height offsets and durations.
- View
Delta - Type alias for view offsets and durations.