Skip to main content

FinalStateWitness

Trait FinalStateWitness 

Source
pub trait FinalStateWitness: Send + Sync {
    // Required methods
    fn check_final<'a>(
        &'a self,
        state: &'a PointerState,
    ) -> BoxFuture<'a, FinalityCheck>;
    fn proven_conflict(&self, state: &PointerState) -> Option<PointerState>;
    fn forget_clear(&self, state: &PointerState);
}
Expand description

Where a node looks, before it takes a final state, for a different final state its close group already holds (ADR-0018).

A trait rather than the replication engine itself, because the engine is built after this service and needs a running P2P node, and because what the service decides from the answer is worth testing without one.

Required Methods§

Source

fn check_final<'a>( &'a self, state: &'a PointerState, ) -> BoxFuture<'a, FinalityCheck>

Ask the close group whether a final state other than state is already held at state.address.

Source

fn proven_conflict(&self, state: &PointerState) -> Option<PointerState>

A final state at state.address, other than state, that an earlier check already proved, without asking anyone.

Cheap enough to consult ahead of the signature check, so a final state that lost once is refused again for nothing, however often the same paid record is replayed.

Source

fn forget_clear(&self, state: &PointerState)

Forget that a look found state clear: the write it cleared did not land, so a retry must look again rather than reuse the answer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§