pub trait BlockVerifier:
Send
+ Sync
+ 'static {
// Required methods
fn verify_and_vote(
&self,
block: SignedBlock,
serialized_block: Bytes,
) -> Result<(VerifiedBlock, Vec<TransactionIndex>), ConsensusError>;
fn vote(
&self,
block: &VerifiedBlock,
) -> Result<Vec<TransactionIndex>, ConsensusError>;
}Required Methods§
Sourcefn verify_and_vote(
&self,
block: SignedBlock,
serialized_block: Bytes,
) -> Result<(VerifiedBlock, Vec<TransactionIndex>), ConsensusError>
fn verify_and_vote( &self, block: SignedBlock, serialized_block: Bytes, ) -> Result<(VerifiedBlock, Vec<TransactionIndex>), ConsensusError>
Verifies a block and its transactions, checking signatures, size limits, and transaction validity. All honest validators should produce the same verification outcome for the same block, so any verification error should be due to equivocation. Returns the verified block.
When Mysticeti fastpath is enabled, it also votes on the transactions in verified blocks, and can return a non-empty list of rejected transaction indices. Different honest validators may vote differently on transactions.
The method takes both the SignedBlock and its serialized bytes, to avoid re-serializing the block.
Sourcefn vote(
&self,
block: &VerifiedBlock,
) -> Result<Vec<TransactionIndex>, ConsensusError>
fn vote( &self, block: &VerifiedBlock, ) -> Result<Vec<TransactionIndex>, ConsensusError>
Votes on the transactions in a verified block. This is used to vote on transactions in a verified block, without having to verify the block again. The method will verify the transactions and vote on them.