Sigil documentation
ReferenceRust referencearise-verify

arise-verify · sentinel

Source declarations, signatures and documentation for sentinel.

Source: sigil/node/../arise-bridge/arise-verify/src/sentinel.rs. SHA-256: 1539bec5c95d7a84e6120400e6a1fd3da909c4a1dd97f01413a4f7fb7e6fb2c0.

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.

sentinel::DEFAULT_PROBE_INTERVAL_SECS

Default probe interval in seconds (5 minutes).

pub const DEFAULT_PROBE_INTERVAL_SECS: u64;

Source line: 13.

sentinel::DEFAULT_MAX_HISTORY

Default maximum history size per scheduler.

pub const DEFAULT_MAX_HISTORY: usize;

Source line: 16.

sentinel::SentinelProbe

A single sentinel probe sent to a provider.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SentinelProbe {
/// Unique probe identifier.

pub probe_id: String,
/// DID of the provider being probed.

pub provider_did: String,
/// Known input data for the probe.

pub known_input: Vec<u8>,
/// Expected BLAKE3 hash of the correct output.

pub expected_output_hash: [u8; 32],
/// Epoch-second timestamp when the probe was sent.

pub sent_at: u64,
/// Whether a response has been received.

pub response_received: bool,
/// Whether the response was correct.

pub response_correct: bool,
/// Response latency in milliseconds (if received).

pub response_latency_ms: Option<u64>
}

Source line: 20.

sentinel::SentinelScheduler

Scheduler that manages sentinel probes for providers.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SentinelScheduler {
/// Interval between probes in seconds.

pub probe_interval_secs: u64,
/// Currently active (pending) probes.

pub active_probes: Vec<SentinelProbe>,
/// Completed probes (capped at `max_history`).

pub probe_history: Vec<SentinelProbe>,
/// Maximum number of completed probes to retain.

pub max_history: usize
}

Source line: 41.

sentinel::SentinelScheduler::new

Creates a new scheduler with the given probe interval.

pub fn new(interval_secs: u64) -> Self;

Source line: 54.

sentinel::SentinelScheduler::create_probe

Creates a new sentinel probe for a provider.

The probe is added to the active probes list and a reference to it is returned.

pub fn create_probe(
        &mut self,
        probe_id: String,
        provider_did: &str,
        input: Vec<u8>,
        expected_hash: [u8; 32],
        sent_at: u64,
    ) -> &SentinelProbe;

Source line: 67.

sentinel::SentinelScheduler::record_response

Records a response for an active probe, moving it to history.

pub fn record_response(
        &mut self,
        probe_id: &str,
        correct: bool,
        latency_ms: u64,
    ) -> Result<(), VerifyError>;

Source line: 91.

sentinel::SentinelScheduler::provider_reliability

Computes the reliability score for a provider based on completed probes.

Returns the fraction of correct responses out of all received responses. Returns 1.0 if no probes have been recorded (benefit of the doubt).

pub fn provider_reliability(&self, provider_did: &str) -> f64;

Source line: 122.

sentinel::SentinelScheduler::needs_probe

Returns true if the provider needs a new probe based on the time since their last probe.

pub fn needs_probe(&self, provider_did: &str, now: u64) -> bool;

Source line: 139.

On this page