Reduce maximum checkpoint size in the Zebra code
The new limits are 400 blocks and 32 MB.
This commit is contained in:
parent
672b39a847
commit
20dfd04463
|
|
@ -79,7 +79,14 @@ pub const MAX_QUEUED_BLOCKS_PER_HEIGHT: usize = 4;
|
||||||
|
|
||||||
/// We limit the maximum number of blocks in each checkpoint. Each block uses a
|
/// We limit the maximum number of blocks in each checkpoint. Each block uses a
|
||||||
/// constant amount of memory for the supporting data structures and futures.
|
/// constant amount of memory for the supporting data structures and futures.
|
||||||
pub const MAX_CHECKPOINT_HEIGHT_GAP: usize = 2_000;
|
///
|
||||||
|
/// We choose a checkpoint gap that allows us to verify one checkpoint for
|
||||||
|
/// every `ObtainTips` or `ExtendTips` response.
|
||||||
|
///
|
||||||
|
/// `zcashd`'s maximum `FindBlocks` response size is 500 hashes. `zebrad` uses
|
||||||
|
/// 1 hash to verify the tip, and discards 1-2 hashes to work around `zcashd`
|
||||||
|
/// bugs. So the most efficient gap is slightly less than 500 blocks.
|
||||||
|
pub const MAX_CHECKPOINT_HEIGHT_GAP: usize = 400;
|
||||||
|
|
||||||
/// A checkpointing block verifier.
|
/// A checkpointing block verifier.
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ use std::os::unix::process::ExitStatusExt;
|
||||||
mod args;
|
mod args;
|
||||||
|
|
||||||
/// We limit the memory usage for each checkpoint, based on the cumulative size of
|
/// We limit the memory usage for each checkpoint, based on the cumulative size of
|
||||||
/// the serialized blocks in the chain. Deserialized blocks are larger, because
|
/// the serialized blocks in the chain. Deserialized blocks are slightly larger
|
||||||
/// they contain pointers and non-compact integers. But they should be within a
|
/// than serialized blocks, but they should be within a constant factor of the
|
||||||
/// constant factor of the serialized size.
|
/// serialized size.
|
||||||
const MAX_CHECKPOINT_BYTE_COUNT: u64 = 256 * 1024 * 1024;
|
const MAX_CHECKPOINT_BYTE_COUNT: u64 = 32 * 1024 * 1024;
|
||||||
|
|
||||||
/// Initialise tracing using its defaults.
|
/// Initialise tracing using its defaults.
|
||||||
fn init_tracing() {
|
fn init_tracing() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue