consensus_core

Trait TransactionVerifier

Source
pub trait TransactionVerifier:
    Send
    + Sync
    + 'static {
    // Required methods
    fn verify_batch(&self, batch: &[&[u8]]) -> Result<(), ValidationError>;
    fn verify_and_vote_batch(
        &self,
        batch: &[&[u8]],
    ) -> Result<Vec<TransactionIndex>, ValidationError>;
}
Expand description

TransactionVerifier implementation is supplied by Sui to validate transactions in a block, before acceptance of the block.

Required Methods§

Source

fn verify_batch(&self, batch: &[&[u8]]) -> Result<(), ValidationError>

Determines if this batch of transactions is valid. Fails if any one of the transactions is invalid.

Source

fn verify_and_vote_batch( &self, batch: &[&[u8]], ) -> Result<Vec<TransactionIndex>, ValidationError>

Returns indices of transactions to reject, or a transaction validation error. Currently only uncertified user transactions can be voted to reject, which are created by Mysticeti fastpath client. Honest validators may disagree on voting for uncertified user transactions. The other types of transactions are implicitly voted to be accepted if they pass validation.

Honest validators should produce the same validation outcome on the same batch of transactions. So if a batch from a peer fails validation, the peer is equivocating.

Implementors§