Expand description
Zebra mempool.
A zebrad application component that manages the active collection, reception, gossip, verification, in-memory storage, eviction, and rejection of unmined Zcash transactions (those that have not been confirmed in a mined block on the blockchain).
Major parts of the mempool include:
- Mempool Service
- activates when the syncer is near the chain tip
- spawns download and verify tasks for each crawled or gossiped transaction
- handles in-memory storage of unmined transactions
- Crawler
- runs in the background to periodically poll peers for fresh unmined transactions
- Queue Checker
- runs in the background, polling the mempool to store newly verified transactions
- Transaction Gossip Task
- runs in the background and gossips newly added mempool transactions to peers
Re-exportsΒ§
pub use crate::BoxError;pub use config::Config;pub use gossip::gossip_mempool_transaction_id;
ModulesΒ§
- config
- User-configurable mempool parameters.
- crawler π
- Zebra Mempool crawler.
- downloads
- Transaction downloader and verifier.
- error π
- Errors that can occur when interacting with the mempool.
- gossip
- A task that gossips any
zebra_chain::transaction::UnminedTxIdthat enters the mempool to peers. - pending_
outputs π - Pending
transparent::Outputtracker forAwaitOutputrequests. - queue_
checker π - Zebra Mempool queue checker.
- storage π
- Mempool transaction storage.
StructsΒ§
- Crawler
- The mempool transaction crawler.
- Mempool
- Mempool async management and query service.
- Queue
Checker - The mempool queue checker.
- Storage
- Hold mempool verified and rejected mempool transactions.
EnumsΒ§
- Active
State π - The state of the mempool.
- Exact
TipRejection Error - Transactions rejected based on transaction authorizing data (scripts, proofs, signatures), or lock times. These rejections are only valid for the current tip.
- Mempool
Error - Mempool errors.
- Same
Effects Chain Rejection Error - Transactions rejected based only on their effects (spends, outputs, transaction header). These rejections are valid while the current chain continues to grow.
- Same
Effects TipRejection Error - Transactions rejected based only on their effects (spends, outputs, transaction header). These rejections are only valid for the current tip.
ConstantsΒ§
- BRANCH_
ID_ πGRACE_ PERIOD - The wall-clock window around a network upgrade activation where an adjacent upgradeβs branch ID receives no peer score: 40 blocks at 75 seconds, 120 blocks at ZIP 218βs 25 seconds.
FunctionsΒ§
- adjusted_
mempool_ πmisbehavior_ score - Returns the mempool peer score after applying branch ID activation policy.
- is_
in_ πbranch_ id_ grace_ period - Returns
trueiftransaction_upgradeactivates immediately before or after the upgrade current atheightonnetwork, andheightis within the grace window of that boundary.
Type AliasesΒ§
- Inbound
TxDownloads π - Outbound π
- State π
- TxVerifier π