Sigil documentation
ReferenceRust referencesigil-node

sigil-node · health

Source declarations, signatures and documentation for health.

Source: sigil/node/sigil-node/src/health.rs. SHA-256: 2cd193841fbc67320b80063b3d58ce98c8c1042b06b02fba7df3f885a86a2752.

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.

health::HealthStatus

Overall health status of the node.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum HealthStatus {
    /// Node is healthy, synced, and participating normally.
    Healthy,
    /// Node is syncing and not yet caught up to the network tip.
    Syncing,
    /// Node is degraded — operational but experiencing issues.
    Degraded,
    /// Node is not operational.
    Unhealthy,
}

Source line: 11.

health::HealthStatus::is_serving

Returns true if the node is in a state where it can serve requests.

pub fn is_serving(&self) -> bool;

Source line: 24.

health::HealthStatus::is_healthy

Returns true if the node is fully healthy.

pub fn is_healthy(&self) -> bool;

Source line: 29.

health::SyncState

Sync state of the node relative to the network.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SyncState {
/// Whether the node has completed initial sync.

pub synced: bool,
/// Current block height on this node.

pub current_height: u64,
/// Highest block height known from peers.

pub highest_known_height: u64,
/// Number of blocks remaining to sync.

pub blocks_behind: u64,
/// Current epoch number.

pub current_epoch: u64
}

Source line: 48.

health::SyncState::progress

Returns the sync progress as a fraction in [0.0, 1.0].

Returns 1.0 if synced or if the highest known height is 0.

pub fn progress(&self) -> f64;

Source line: 65.

health::NodeMetrics

Counters tracking node activity since startup.

#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct NodeMetrics {
/// Total blocks processed (produced + validated + synced).

pub blocks_processed: u64,
/// Total transactions processed across all blocks.

pub transactions_processed: u64,
/// Number of blocks this node proposed (validator/producer modes only).

pub blocks_proposed: u64,
/// Number of consensus votes cast (validator/producer modes only).

pub votes_cast: u64,
/// Number of peers currently connected.

pub peer_count: u32,
/// Number of transactions in the mempool.

pub mempool_size: u32,
/// Total bytes received from the P2P network.

pub bytes_received: u64,
/// Total bytes sent on the P2P network.

pub bytes_sent: u64
}

Source line: 78.

health::NodeMetrics::new

Create a new zeroed metrics instance.

pub fn new() -> Self;

Source line: 99.

health::NodeMetrics::record_block

Record that a block was processed.

pub fn record_block(&mut self, tx_count: u64);

Source line: 104.

health::NodeMetrics::record_proposal

Record that this node proposed a block.

pub fn record_proposal(&mut self);

Source line: 110.

health::NodeMetrics::record_vote

Record that a consensus vote was cast.

pub fn record_vote(&mut self);

Source line: 115.

health::TowerMetrics

Tower chain metrics (only populated in validator/producer/tower modes).

#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct TowerMetrics {
/// Current Tower slot number.

pub current_slot: u64,
/// Current Tower epoch.

pub current_epoch: u64,
/// Latest finalized epoch via Casper FFG.

pub finalized_epoch: u64,
/// Total finality votes this node has cast.

pub finality_votes_cast: u64,
/// Total committee attestations this node has produced.

pub attestations_produced: u64
}

Source line: 122.

health::HealthCheck

Complete health check response combining status, sync, and metrics.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HealthCheck {
/// Overall health status.

pub status: HealthStatus,
/// Software version.

pub version: String,
/// Chain ID.

pub chain_id: String,
/// Node operating mode.

pub node_mode: String,
/// Sync state relative to the network.

pub sync: SyncState,
/// Activity counters.

pub metrics: NodeMetrics,
/// Tower chain metrics (present only for Tower-aware modes).

#[serde(default, skip_serializing_if = "Option::is_none")]
pub tower: Option<TowerMetrics>,
/// Unix timestamp of this health check.

pub timestamp: u64,
/// Node uptime in seconds.

pub uptime_secs: u64
}

Source line: 137.

health::HealthCheck::compute_status

Determine the overall health status from the current state.

The status is derived from:

  • Healthy: synced, has peers, no degradation signals
  • Syncing: not yet synced
  • Degraded: synced but zero peers
  • Unhealthy: none of the above
pub fn compute_status(synced: bool, peer_count: u32) -> HealthStatus;

Source line: 167.

On this page