Skip to main content

InvalidBlockOracle

Trait InvalidBlockOracle 

Source
pub trait InvalidBlockOracle {
    // Required method
    fn re_execute(
        &self,
        header: &L2BlockHeader,
        witness: &[u8],
    ) -> Result<ExecutionOutcome, SlashingError>;

    // Provided method
    fn verify_failure(
        &self,
        _header: &L2BlockHeader,
        _witness: &[u8],
        _reason: InvalidBlockReason,
    ) -> Result<(), SlashingError> { ... }
}
Expand description

Full-node block re-execution hook.

Traces to SPEC §15.3, catalogue rows DSL-020

§Role

  • verify_invalid_block (DSL-020) calls verify_failure when the caller supplied an oracle; absence means bootstrap mode (the evidence is admitted and defers to the challenge window).
  • InvalidBlockAppeal::BlockActuallyValid (DSL-049) calls re_execute to adjudicate whether the accused block really is invalid.

§Default verify_failure

The default body is Ok(()) — bootstrap mode where every well-signed evidence envelope is admitted. Real full-node impls override to re-execute the block and cross-check the claimed failure reason.

§Determinism

re_execute MUST be deterministic — same inputs → same outcome (DSL-145). Non-determinism here would let the same block flip between “valid” and “invalid” across honest nodes, breaking evidence consensus.

Required Methods§

Source

fn re_execute( &self, header: &L2BlockHeader, witness: &[u8], ) -> Result<ExecutionOutcome, SlashingError>

Re-execute the block deterministically. Returns whether it is Valid or Invalid (with the specific reason when invalid).

Provided Methods§

Source

fn verify_failure( &self, _header: &L2BlockHeader, _witness: &[u8], _reason: InvalidBlockReason, ) -> Result<(), SlashingError>

Verify the caller’s claim that header is invalid for the stated reason, using witness bytes (trie proofs, state diff, etc.).

Default: accept — bootstrap path. Full nodes override.

Implementors§