Sigil documentation
ReferenceRust referencesigil-node

sigil-node · tower_runtime

Source declarations, signatures and documentation for tower_runtime.

Source: sigil/node/sigil-node/src/tower_runtime.rs. SHA-256: 8831e5419118b5cf96167a2aedd6ee29e33624051e4cb2cb132a61532e1bd13e.

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.

tower_runtime::AttestationSender

A queued outbound attestation waiting to be gossiped.

BlockEngine::run drains this channel and dispatches the message to the network layer (or logs it until the gossip transport is connected).

pub type AttestationSender = mpsc::UnboundedSender<TowerAttestationMessage>;

Source line: 39.

tower_runtime::AttestationReceiver

Receiver side — held by the gossip transport task.

pub type AttestationReceiver = mpsc::UnboundedReceiver<TowerAttestationMessage>;

Source line: 41.

tower_runtime::TowerRuntime

Drives Tower attestation gossip for one node.

Thread safety

TowerRuntime is intended to be constructed once during BlockEngine::new and then used via shared Arc<dyn ExecutionState>. All methods are &self and interact with execution state through the sync trait, which is Send + Sync.

pub struct TowerRuntime {

}

Source line: 143.

tower_runtime::TowerRuntime::new

Create a new TowerRuntime.

Returns (runtime, receiver). The caller should store the receiver and drain it to forward attestations to the gossip transport.

pub fn new(
        validator_did: String,
        signing_key: SigningKey,
        state: Arc<dyn ExecutionState>,
        region: String,
    ) -> (Self, AttestationReceiver);

Source line: 161.

tower_runtime::TowerRuntime::on_epoch_boundary

Called from the block production loop at every epoch boundary.

If this validator is a Tower committee member, produces and emits a signed attestation, then applies it locally so the node's own vote is counted without waiting for a gossip round-trip.

block_hash is the hash of the last block in the completing epoch (i.e. the epoch-boundary block that is the attestation target).

pub fn on_epoch_boundary(&self, epoch: u64, block_hash: SigilHash) -> Result<(), NodeError>;

Source line: 186.

tower_runtime::TowerRuntime::on_attestation_received

Called when a peer's attestation arrives on [GossipTopic::TowerAttestations].

Steps:

  1. Validate that target_epoch > source_epoch.
  2. Look up the sender's public key from the Tower registry.
  3. Verify the Ed25519 signature.
  4. Persist via [commit_tower_tx] and advance [FinalityState].
pub fn on_attestation_received(&self, msg: TowerAttestationMessage) -> Result<(), NodeError>;

Source line: 269.

On this page