Skip to main content

Module mempool

Module mempool 

Source
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::UnminedTxId that enters the mempool to peers.
pending_outputs πŸ”’
Pending transparent::Output tracker for AwaitOutput requests.
queue_checker πŸ”’
Zebra Mempool queue checker.
storage πŸ”’
Mempool transaction storage.

StructsΒ§

Crawler
The mempool transaction crawler.
Mempool
Mempool async management and query service.
QueueChecker
The mempool queue checker.
Storage
Hold mempool verified and rejected mempool transactions.

EnumsΒ§

ActiveState πŸ”’
The state of the mempool.
ExactTipRejectionError
Transactions rejected based on transaction authorizing data (scripts, proofs, signatures), or lock times. These rejections are only valid for the current tip.
MempoolError
Mempool errors.
SameEffectsChainRejectionError
Transactions rejected based only on their effects (spends, outputs, transaction header). These rejections are valid while the current chain continues to grow.
SameEffectsTipRejectionError
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 true if transaction_upgrade activates immediately before or after the upgrade current at height on network, and height is within the grace window of that boundary.

Type AliasesΒ§

InboundTxDownloads πŸ”’
Outbound πŸ”’
State πŸ”’
TxVerifier πŸ”’