Sigil documentation
ReferenceRust referencesigil-node

sigil-node · error

Source declarations, signatures and documentation for error.

Source: sigil/node/sigil-node/src/error.rs. SHA-256: 3a599e3c736d120029610f954cdcf3732f150113072131412c30b7c1744b8afc.

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.

error::NodeError

Errors that can occur during node operation.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, thiserror::Error)]
pub enum NodeError {
    /// Invalid or incomplete node configuration.
    #[error("config error: {0}")]
    ConfigError(String),

    /// Failed to load or validate the genesis configuration.
    #[error("genesis load failed: {0}")]
    GenesisLoadFailed(String),

    /// Storage subsystem error.
    #[error("storage error: {0}")]
    StorageError(String),

    /// Consensus subsystem error.
    #[error("consensus error: {0}")]
    ConsensusError(String),

    /// Network subsystem error.
    #[error("network error: {0}")]
    NetworkError(String),

    /// RPC subsystem error.
    #[error("rpc error: {0}")]
    RpcError(String),

    /// Error during node shutdown.
    #[error("shutdown error: {0}")]
    ShutdownError(String),

    /// Transaction execution error.
    #[error("execution error: {0}")]
    ExecutionError(String),

    /// A transaction targeted a different chain than the block execution
    /// context.
    #[error(
        "invalid transaction chain id at tx index {tx_index}: expected {expected:?}, got {actual:?}"
    )]
    InvalidTransactionChainId {
        /// Transaction index within the block.
        tx_index: u32,
        /// Expected chain ID supplied by consensus/startup context.
        expected: String,
        /// Chain ID declared by the transaction.
        actual: String,
        /// Receipts already produced before the rejected transaction.
        partial_receipts: Vec<Receipt>,
    },

    /// A transaction's Ed25519 signature failed verification.
    #[error("invalid transaction signature at tx index {tx_index}: {reason}")]
    InvalidTransactionSignature {
        /// Transaction index within the block.
        tx_index: u32,
        /// Stable, non-secret rejection reason.
        reason: String,
        /// Receipts already produced before the rejected transaction.
        partial_receipts: Vec<Receipt>,
    },

    /// A transaction failed signer/public-key policy validation.
    #[error("invalid transaction signer at tx index {tx_index}: {reason}")]
    InvalidTransactionSigner {
        /// Transaction index within the block.
        tx_index: u32,
        /// Stable, non-secret rejection reason.
        reason: String,
        /// Receipts already produced before the rejected transaction.
        partial_receipts: Vec<Receipt>,
    },

    /// A transaction's nonce did not match the sender's next expected nonce.
    #[error(
        "invalid transaction nonce at tx index {tx_index}: sender {sender_did}, expected {expected}, got {actual}"
    )]
    InvalidTransactionNonce {
        /// Transaction index within the block.
        tx_index: u32,
        /// Sender DID whose nonce was checked.
        sender_did: String,
        /// Next nonce expected by execution state.
        expected: u64,
        /// Nonce declared by the transaction.
        actual: u64,
        /// Receipts already produced before the rejected transaction.
        partial_receipts: Vec<Receipt>,
    },

    /// A transaction was already durably recorded as included.
    #[error("transaction replay at tx index {tx_index}: {tx_hash}")]
    TransactionReplay {
        /// Transaction index within the block.
        tx_index: u32,
        /// Hex-encoded transaction hash.
        tx_hash: String,
        /// Receipts already produced before the rejected transaction.
        partial_receipts: Vec<Receipt>,
    },

    /// A transaction violated gas admission bounds.
    #[error("invalid transaction gas at tx index {tx_index}: {reason}")]
    InvalidTransactionGas {
        /// Transaction index within the block.
        tx_index: u32,
        /// Stable, non-secret rejection reason.
        reason: String,
        /// Receipts already produced before the rejected transaction.
        partial_receipts: Vec<Receipt>,
    },

    /// Idempotent compute settlement rejected because the receipt/job/task
    /// tuple has already been settled.
    #[error("already settled: {0}")]
    AlreadySettled(String),

    /// Bootstrap or agent initialization error.
    #[error("bootstrap error: {0}")]
    BootstrapError(String),

    /// Mainnet startup refused because no pre-provisioned validator keys were
    /// found and auto-generation is forbidden on mainnet.
    ///
    /// `path` is the canonical location where the node expected to find
    /// `validator_keys.json`. Operators must provision keys via HSM, a sealed
    /// file mount, or by copying an externally generated key file to that path
    /// before starting the mainnet validator.
    #[error(
        "production validator key missing at {path}. \
         Mainnet validators must be provisioned with pre-generated or \
         HSM-backed Ed25519 keys. Auto-generation and DID-derived keys \
         are forbidden on mainnet. \
         Operator workflow: (1) generate keys offline or via HSM, \
         (2) write validator_keys.json to {path}, \
         (3) restart with --validator-key-path <path> if using a custom location. \
         See docs/operator/validator-key-provisioning.md for HSM workflows."
    )]
    ProductionKeyMissing {
        /// Canonical path where the key file was expected.
        path: String,
    },
}

Source line: 8.

error::NodeError::with_partial_receipts

Attach block-level partial receipts to transaction-validity errors.

pub fn with_partial_receipts(self, partial_receipts: Vec<Receipt>) -> Self;

Source line: 152.

On this page