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; }
Expand description
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]
Expand description
Verify if the ledger_info is trust worthy.
fn epoch_change_verification_required(&self, epoch: u64) -> bool
[src]
Expand description
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]
Expand description
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.
Implementors
impl Verifier for TrustedStateVerifier
[src]
impl Verifier for TrustedStateVerifier
[src]fn verify(&self, ledger_info: &LedgerInfoWithSignatures) -> Result<()>
[src]
fn epoch_change_verification_required(&self, epoch: u64) -> bool
[src]
fn is_ledger_info_stale(&self, ledger_info: &LedgerInfo) -> bool
[src]
impl Verifier for EpochState
[src]
impl Verifier for EpochState
[src]fn verify(&self, ledger_info: &LedgerInfoWithSignatures) -> Result<()>
[src]
fn epoch_change_verification_required(&self, epoch: u64) -> bool
[src]
fn is_ledger_info_stale(&self, ledger_info: &LedgerInfo) -> bool
[src]
impl Verifier for Waypoint
[src]
impl Verifier for Waypoint
[src]