consensus: Add a transaction verification stub

Part of #428.
This commit is contained in:
teor 2020-06-09 21:17:50 +10:00 committed by Henry de Valence
parent 997201c9c7
commit af1d64b218
2 changed files with 24 additions and 0 deletions

View File

@ -18,6 +18,8 @@ use tower::{buffer::Buffer, Service};
use zebra_chain::block::Block;
mod transaction;
/// Block verification service.
///
/// After verification, blocks and their associated transactions are added to

View File

@ -0,0 +1,22 @@
//! Transaction verification for Zebra.
//!
//! Verification occurs in multiple stages:
//! - getting transactions from blocks or the mempool (disk- or network-bound)
//! - context-free verification of signatures, proofs, and scripts (CPU-bound)
//! - context-dependent verification of transactions against the chain state
//! (awaits an up-to-date chain)
//!
//! Verification is provided via a `tower::Service`, to support backpressure and batch
//! verification.
//!
//! This is an internal module. Use `verify::BlockVerifier` for blocks and their
//! transactions, or `mempool::MempoolTransactionVerifier` for mempool transactions.
/// Internal transaction verification service.
///
/// After verification, the transaction future completes. State changes are handled by
/// `BlockVerifier` or `MempoolTransactionVerifier`.
///
/// `TransactionVerifier` is not yet implemented.
#[derive(Default)]
pub(crate) struct TransactionVerifier {}