From b65d9faf12edb60b40a0d4d93101244b69dc4b80 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Wed, 11 Mar 2026 10:45:04 +0700 Subject: [PATCH] docs(consensus): add MERGE NOTE comments for upstream 86ef16dbeb resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends merge guidance to cover the empty-disputes bugfix (not yet in sync-2.5.0): !disputes.empty() guard, stalled() j/clog params, "should be rare" doc wording, debug→warn promotion, and auto-merged testDisputes duplicate warning. --- src/test/consensus/Consensus_test.cpp | 4 ++++ src/xrpld/app/consensus/RCLValidations.cpp | 1 + src/xrpld/consensus/Consensus.h | 6 ++++++ src/xrpld/consensus/DisputedTx.h | 2 ++ 4 files changed, 13 insertions(+) diff --git a/src/test/consensus/Consensus_test.cpp b/src/test/consensus/Consensus_test.cpp index 3a27e464f..9218e5b53 100644 --- a/src/test/consensus/Consensus_test.cpp +++ b/src/test/consensus/Consensus_test.cpp @@ -1131,6 +1131,10 @@ public: // MERGE NOTE (sync-2.5.0): upstream adds testDisputes() method and its // run() entry here. Keep both all RNG tests below and testDisputes. // The stalled() calls in testDisputes need j/clog params (from 86ef16dbeb). + // WARNING: upstream testDisputes() body may auto-merge WITHOUT conflict + // markers, creating a duplicate alongside our version (which already has + // j/clog params). Delete the auto-merged duplicate — keep only the version + // with j/clog params and expectStalled() lambda. void testRngCommitRevealConverges() { diff --git a/src/xrpld/app/consensus/RCLValidations.cpp b/src/xrpld/app/consensus/RCLValidations.cpp index fd79ba78d..ada10bd1d 100644 --- a/src/xrpld/app/consensus/RCLValidations.cpp +++ b/src/xrpld/app/consensus/RCLValidations.cpp @@ -139,6 +139,7 @@ RCLValidationsAdaptor::acquire(LedgerHash const& hash) if (!ledger) { + // MERGE NOTE (upstream 86ef16dbeb): promoted from debug to warn. JLOG(j_.warn()) << "Need validated ledger for preferred ledger analysis " << hash; diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index c50a9c368..4743fbbf5 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -110,6 +110,8 @@ shouldCloseLedger( last ledger @param currentAgreeTime how long, in milliseconds, we've been trying to agree + // MERGE NOTE (upstream 86ef16dbeb): "should be rare" wording is from the + // bugfix. Upstream sync-2.5.0 has "will cause" instead. Keep ours. @param stalled the network appears to be stalled, where neither we nor our peers have changed their vote on any disputes in a while. This is undesirable, and should be rare, and will cause us to @@ -2976,6 +2978,10 @@ Consensus::haveConsensus( effectiveParms.ledgerMAX_CONSENSUS = std::chrono::seconds{5}; ConsensusParms const& parms = adaptor_.parms(); + // MERGE NOTE (upstream 86ef16dbeb): the !result_->disputes.empty() guard, + // j_/clog capture in the lambda, and the stalled-logging block below are + // all from the bugfix. Upstream sync-2.5.0 does NOT have them yet. + // When 86ef16dbeb arrives, keep our version — it's already applied. // Stalling is BAD. It means that we have a consensus on the close time, so // peers are talking, but we have disputed transactions that peers are // unable or unwilling to come to agreement on one way or the other. diff --git a/src/xrpld/consensus/DisputedTx.h b/src/xrpld/consensus/DisputedTx.h index 40fcdc70c..ec3d799b1 100644 --- a/src/xrpld/consensus/DisputedTx.h +++ b/src/xrpld/consensus/DisputedTx.h @@ -175,6 +175,8 @@ public: @return bool Whether the peer changed its vote. (A new vote counts as a change.) */ + // MERGE NOTE (sync-2.5.0): upstream changes return type from void to + // [[nodiscard]] bool. We already have this. Keep ours. [[nodiscard]] bool setVote(NodeID_t const& peer, bool votesYes);