Sigil documentation
ReferenceRust referencesigil-node

sigil-node · consensus_coordinator

Source declarations, signatures and documentation for consensus_coordinator.

Source: sigil/node/sigil-node/src/consensus_coordinator.rs. SHA-256: 17f14a881f2f1b3e7f3597aad8fb9400093ab52b3f5030e223e8308373f0eb2a.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

consensus_coordinator::PeerEndpoint

Peer address for consensus message broadcasting.

#[derive(Debug, Clone)]
pub struct PeerEndpoint {
/// Validator DID.

pub did: String,
/// HTTP RPC URL (e.g., "http://validator-2:26657/rpc").

pub rpc_url: String
}

Source line: 54.

consensus_coordinator::InboundConsensusMsg

Messages that flow into the coordinator from the RPC layer.

#[derive(Debug, Clone)]
pub enum InboundConsensusMsg {
    Proposal {
        block: Box<Block>,
        proposer_did: String,
        view: u64,
        signature: Vec<u8>,
    },
    PreVote(PreVote),
    PreCommit(PreCommit),
    ViewChange(ViewChangeMessage),
    NewView(NewViewMessage),
}

Source line: 63.

consensus_coordinator::RejectedReason

Bounded reasons a proposal can be rejected before this validator prevotes.

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RejectedReason {
    WrongChainId,
    WrongParentHash,
    WrongHeight,
    InvalidProposer,
    InvalidProposerSignature,
    InvalidTransactionChainId,
    InvalidTransactionSignature,
    InvalidTransactionSigner,
    InvalidTransactionNonce,
    TransactionReplay,
    TxRootMismatch,
    ReceiptCountMismatch,
    ReceiptRootMismatch,
    StateRootMismatch,
    ZeroRootNonEmpty,
    GasLimitExceeded,
    GasUsedMismatch,
    SemanticValidationFailed,
    ExecutionSnapshotUnavailable,
    ExecutionFailed,
}

Source line: 83.

consensus_coordinator::CoordinatorConfig

Configuration for the consensus coordinator.

pub struct CoordinatorConfig {
/// This node's validator DID.

pub validator_did: String,
/// This node's Ed25519 signing key for consensus messages.

pub signing_key: ed25519_dalek::SigningKey,
/// Chain ID.

pub chain_id: String,
/// Target block time in milliseconds.

pub block_time_ms: u64,
/// Blocks per epoch.

pub blocks_per_epoch: u64,
/// Maximum gas per block.

pub max_block_gas: u64,
/// Ed25519 transaction signature batch size.

pub signature_batch_size: usize,
/// Peer endpoints for broadcasting.

pub peers: Vec<PeerEndpoint>,
/// The validator set (from genesis).

pub validator_set: ValidatorSet
}

Source line: 134.

consensus_coordinator::ConsensusCoordinator

Drives the MACA consensus protocol across validators.

pub struct ConsensusCoordinator {

}

Source line: 156.

consensus_coordinator::ConsensusCoordinator::new

Create a new consensus coordinator.

#[allow(clippy::too_many_arguments)]
pub fn new(
        config: CoordinatorConfig,
        mempool: Arc<RwLock<Mempool>>,
        state: Arc<dyn ExecutionState>,
        inbound_rx: mpsc::Receiver<InboundConsensusMsg>,
        initial_height: u64,
        initial_hash: SigilHash,
        block_store: Option<Arc<dyn sigil_storage::BlockStore>>,
        zk_prover: Option<sigil_zk::HashCommitmentProver>,
    ) -> Self;

Source line: 179.

consensus_coordinator::ConsensusCoordinator::run

Run the consensus coordinator loop.

For each block height:

  1. Determine the proposer (round-robin by height)
  2. If we are the proposer: build block, broadcast proposal
  3. Run the MACA round, collecting votes from peers
  4. Finalize when quorum is reached
pub async fn run(&mut self) -> Result<(), NodeError>;

Source line: 211.

On this page