Expand description

Zebra Mempool crawler.

The Crawler periodically requests transactions from peers in order to populate the mempool.

Crawling only happens when the local node has synchronized the chain to be close to its tip. If synchronization is still happening at a fast rate, the crawler will stay disabled until it slows down.

Once enabled, the crawler will periodically request FANOUT number of peers for transactions from the peer_set specified when it started. These crawl iterations occur at most once per RATE_LIMIT_DELAY. The received transaction IDs are forwarded to the mempool service so that they can be downloaded and included in the mempool.

Example

use zebrad::components::mempool;

let crawler_task = mempool::Crawler::spawn(
    &mempool::Config::default(),
    peer_set_service,
    mempool_service,
    sync_status,
    chain_tip_change,
);

crawler_task.await;

Structs

The mempool transaction crawler.

Constants

FANOUT 🔒
The number of peers to request transactions from per crawl event.
The time to wait for a peer response.
The delay between crawl events.