Trait diem_types::epoch_change::Verifier[][src]

pub trait Verifier: Debug + Send + Sync {
    fn verify(&self, ledger_info: &LedgerInfoWithSignatures) -> Result<()>;
fn epoch_change_verification_required(&self, epoch: u64) -> bool;
fn is_ledger_info_stale(&self, ledger_info: &LedgerInfo) -> bool; }

The verification of the epoch change proof starts with verifier that is trusted by the client: could be either a waypoint (upon startup) or a known epoch info.

Required methods

fn verify(&self, ledger_info: &LedgerInfoWithSignatures) -> Result<()>[src]

Verify if the ledger_info is trust worthy.

fn epoch_change_verification_required(&self, epoch: u64) -> bool[src]

Returns true in case the given epoch is larger than the existing verifier can support. In this case the EpochChangeProof should be verified and the verifier updated.

fn is_ledger_info_stale(&self, ledger_info: &LedgerInfo) -> bool[src]

Returns true if the given LedgerInfo is stale and probably in our trusted prefix.

For example, if we have a waypoint with version 5, an epoch change ledger info with version 3 < 5 is already in our trusted prefix and so we can ignore it.

Likewise, if we’re in epoch 10 with the corresponding validator set, an epoch change ledger info with epoch 6 can be safely ignored.

Loading content...

Implementors

Loading content...