From f0dfcf6b81654634fbfb8c32e6613f5f4c975ff9 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 10 Mar 2026 14:30:20 +0700 Subject: [PATCH] fix(consensus): cap bootstrap ledgerMAX_CONSENSUS at 5s Use an explicit 5s cap instead of dividing the default 15s. 5s is the sweet spot: long enough for peers to exchange proposals and converge naturally, short enough to avoid wasted time. Shorter values (e.g. 3.75s) cause nodes to hit reachedMax before peers converge, cascading into slower subsequent rounds. --- src/xrpld/consensus/Consensus.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index b5ce7d311..133eed8f2 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -2940,12 +2940,16 @@ Consensus::haveConsensus( << (ourPosition.myReveal ? "yes" : "no"); } - // During bootstrap fast start, halve ledgerMAX_CONSENSUS so the - // "alone with zero peers" establish path exits faster. All nodes - // share the same bootstrap config, so they advance in lockstep. + // During bootstrap fast start, cap ledgerMAX_CONSENSUS at 5s so the + // "alone with zero peers" establish path exits faster. 5s is the + // sweet spot: long enough for peers to exchange proposals and agree + // naturally, short enough to not waste time waiting. Shorter values + // (e.g. 3.75s) cause nodes to hit reachedMax before peers converge, + // leading to disagreement that cascades into slower subsequent rounds. + // All nodes share the same bootstrap config, so they advance in lockstep. auto effectiveParms = adaptor_.parms(); if (bootstrapFastStart_) - effectiveParms.ledgerMAX_CONSENSUS /= 2; + effectiveParms.ledgerMAX_CONSENSUS = std::chrono::seconds{5}; // Determine if we actually have consensus or not result_->state = checkConsensus(