zebra_network::constants

Constant PEERSET_BUFFER_SIZE

source
pub const PEERSET_BUFFER_SIZE: usize = 3;
Expand description

The buffer size for the peer set.

This should be greater than 1 to avoid sender contention, but also reasonably small, to avoid queueing too many in-flight block downloads. (A large queue of in-flight block downloads can choke a constrained local network connection, or a small peer set on testnet.)

We assume that Zebra nodes have at least 10 Mbps bandwidth. Therefore, a maximum-sized block can take up to 2 seconds to download. So the peer set buffer adds up to 6 seconds worth of blocks to the queue.