Sigil documentation
ReferenceRust referencesigil-tower

sigil-tower · evidence

Source declarations, signatures and documentation for evidence.

Source: sigil/node/sigil-tower/src/evidence.rs. SHA-256: 1df5575a476b477625728b72c07ae4938cd1816b41bc90d2fd5cc834f9f46044.

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.

evidence::validate_evidence

Validate that slashing evidence is internally consistent.

Returns Ok(true) if the evidence is valid, Ok(false) if it's invalid but parseable, or Err if the evidence is malformed.

pub fn validate_evidence(evidence: &SlashingEvidence) -> Result<bool, TowerError>;

Source line: 19.

evidence::calculate_penalty

Calculate the penalty amount for a slashing evidence type.

  • Double sign: 100% slash
  • Surround vote: 100% slash
  • Invalid block: 50% slash
  • Downtime: 1% per missed epoch (missed_slots / SLOTS_PER_EPOCH)
pub fn calculate_penalty(evidence_type: &EvidenceType, validator_stake: u64) -> u64;

Source line: 98.

evidence::compute_evidence_hash

Compute the evidence hash for a piece of evidence.

SECURITY: Returns an error instead of silently hashing an empty byte array on serialization failure. Hashing empty bytes would produce a fixed, predictable hash that could collide across unrelated evidence, enabling duplicate-evidence suppression attacks.

pub fn compute_evidence_hash(evidence: &SlashingEvidence) -> Result<SigilHash, TowerError>;

Source line: 127.

On this page