Sigil documentation
ReferenceRust referencearise-verify

arise-verify · optimistic

Source declarations, signatures and documentation for optimistic.

Source: sigil/node/../arise-bridge/arise-verify/src/optimistic.rs. SHA-256: edd552d58eba391a1a72c0131c6645e6e7c030b2f066dcdc4d460dd6c3659c64.

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.

optimistic::DEFAULT_CHALLENGE_WINDOW_EPOCHS

Default number of epochs for the challenge window.

pub const DEFAULT_CHALLENGE_WINDOW_EPOCHS: u64;

Source line: 12.

optimistic::OptimisticVerification

T1: Optimistic verification of a compute receipt.

The receipt is provisionally accepted upon provider signature. If no challenge is raised during the window, it finalizes.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OptimisticVerification {
/// The receipt being verified.

pub receipt_id: String,
/// Provider's Ed25519 signature over the receipt hash.

pub provider_signature: Vec<u8>,
/// Length of the challenge window in epochs.

pub challenge_window_epochs: u64,
/// Epoch when the receipt was submitted.

pub submitted_epoch: u64,
/// Whether the verification has been finalized.

pub finalized: bool
}

Source line: 19.

optimistic::OptimisticVerification::new

Creates a new optimistic verification with the default challenge window.

pub fn new(receipt_id: String, signature: Vec<u8>, epoch: u64) -> Self;

Source line: 34.

optimistic::OptimisticVerification::with_window

Creates a new optimistic verification with a custom challenge window.

pub fn with_window(
        receipt_id: String,
        signature: Vec<u8>,
        epoch: u64,
        window_epochs: u64,
    ) -> Self;

Source line: 45.

optimistic::OptimisticVerification::is_challenge_window_open

Returns true if the challenge window is still open at the given epoch.

pub fn is_challenge_window_open(&self, current_epoch: u64) -> bool;

Source line: 61.

optimistic::OptimisticVerification::finalize

Finalizes the verification if the challenge window has elapsed.

Returns an error if the window is still open or the verification is already finalized.

pub fn finalize(&mut self, current_epoch: u64) -> Result<(), VerifyError>;

Source line: 69.

On this page