From dcfdb60e9fb39dc18bbd4997047158fdbb79dea5 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Mon, 6 Jul 2026 15:19:57 +0100 Subject: [PATCH] ci issues Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> --- src/xrpld/app/ledger/LedgerHistory.cpp | 17 +++++++++++------ src/xrpld/app/ledger/detail/InboundLedger.cpp | 4 ++-- src/xrpld/app/main/Application.cpp | 2 ++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/xrpld/app/ledger/LedgerHistory.cpp b/src/xrpld/app/ledger/LedgerHistory.cpp index 5655cc2c6e..9b1e36defc 100644 --- a/src/xrpld/app/ledger/LedgerHistory.cpp +++ b/src/xrpld/app/ledger/LedgerHistory.cpp @@ -371,6 +371,12 @@ LedgerHistory::handleMismatch( return; } + // Tracks whether the mismatch reason has already been recorded. The + // consensus tx-set hash disagreement is the root cause, so it is counted + // once here; the tx-level comparison below still logs its diagnostics but + // must not record a second reason for the same mismatch event. + bool reasonRecorded = false; + if (builtConsensusHash && validatedConsensusHash) { if (builtConsensusHash != validatedConsensusHash) @@ -378,11 +384,8 @@ LedgerHistory::handleMismatch( JLOG(j_.error()) << "MISMATCH on consensus transaction set " << " built: " << to_string(*builtConsensusHash) << " validated: " << to_string(*validatedConsensusHash); - // The consensus tx-set hashes disagree — this is the root cause, - // so record it as the single reason and stop. The tx-level - // comparison below would otherwise double-count the same mismatch. recordReason("consensus_txset"); - return; + reasonRecorded = true; } else { @@ -398,13 +401,15 @@ LedgerHistory::handleMismatch( if (builtTx == validTx) { JLOG(j_.error()) << "MISMATCH with same " << builtTx.size() << " transactions"; - recordReason("same_txset_diff_result"); + if (!reasonRecorded) + recordReason("same_txset_diff_result"); } else { JLOG(j_.error()) << "MISMATCH with " << builtTx.size() << " built and " << validTx.size() << " valid transactions."; - recordReason("different_txset"); + if (!reasonRecorded) + recordReason("different_txset"); } JLOG(j_.error()) << "built\n" << getJson({*builtLedger, {}}); diff --git a/src/xrpld/app/ledger/detail/InboundLedger.cpp b/src/xrpld/app/ledger/detail/InboundLedger.cpp index 0f8ac3fa9f..75da7b1078 100644 --- a/src/xrpld/app/ledger/detail/InboundLedger.cpp +++ b/src/xrpld/app/ledger/detail/InboundLedger.cpp @@ -22,11 +22,11 @@ #include #include #include -#include +#include // IWYU pragma: keep #include #include #include -#include +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index e40448da8d..19e9fcd593 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -79,10 +79,12 @@ #include #include #include +#include // IWYU pragma: keep #include #include #include #include +#include // IWYU pragma: keep #include #include #include