Skip to main content

RETAINED_BLOCKS

Constant RETAINED_BLOCKS 

Source
const RETAINED_BLOCKS: usize = 4;
Expand description

How many blocks to keep.

One is the payload of the view we are locked at, which is what peers ask for. The rest are candidates waiting for a certificate to move the lock onto them, so this bounds how late a certificate may be — in payloads obtained meanwhile, which is roughly one per view — before the block it certifies has been evicted and the node can no longer serve it.

A count is the wrong shape if blocks ever approach the message size limit; it would then want to be a byte budget that always keeps the locked block and the newest.