From 749535a3cabe5b3d7eaecb6214932b5237c7054c Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Wed, 8 Jul 2026 15:22:24 +0100 Subject: [PATCH] fix(telemetry): resolve clang-tidy CI errors in consensus tracing Add missing include in Consensus.h and RCLConsensus.h. Remove unused SHAMap.h include from RCLConsensus.h. Add braces around single-line if/else bodies in RCLConsensus.cpp. Co-Authored-By: Claude Opus 4.6 --- src/xrpld/app/consensus/RCLConsensus.cpp | 6 ++++++ src/xrpld/app/consensus/RCLConsensus.h | 2 +- src/xrpld/consensus/Consensus.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xrpld/app/consensus/RCLConsensus.cpp b/src/xrpld/app/consensus/RCLConsensus.cpp index 978d9c9ee2..25abfb6d51 100644 --- a/src/xrpld/app/consensus/RCLConsensus.cpp +++ b/src/xrpld/app/consensus/RCLConsensus.cpp @@ -1269,11 +1269,15 @@ RCLConsensus::Adaptor::startRoundTracing(RCLCxLedger const& prevLgr) // TraceCategory-aware, so gate it explicitly to match the gating // of the hashSpan/span factories used below. if (link != nullptr && app_.getTelemetry().shouldTraceConsensus()) + { roundSpan_.emplace(telemetry::SpanGuard::linkedSpan(cs::round, *link)); + } else + { roundSpan_.emplace( telemetry::SpanGuard::span( telemetry::TraceCategory::Consensus, telemetry::seg::consensus, cs::op::round)); + } } else { @@ -1289,7 +1293,9 @@ RCLConsensus::Adaptor::startRoundTracing(RCLCxLedger const& prevLgr) } if (!*roundSpan_) + { return; + } roundSpan_->setAttribute(cs::attr::ledgerId, to_string(prevLgr.id()).c_str()); roundSpan_->setAttribute(cs::attr::ledgerSeq, static_cast(prevLgr.seq()) + 1); diff --git a/src/xrpld/app/consensus/RCLConsensus.h b/src/xrpld/app/consensus/RCLConsensus.h index 493acbef82..37b8724abc 100644 --- a/src/xrpld/app/consensus/RCLConsensus.h +++ b/src/xrpld/app/consensus/RCLConsensus.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -36,6 +35,7 @@ #include #include #include +#include #include namespace xrpl { diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index 270f9f8771..240dd11560 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -26,6 +26,7 @@ #include #include #include +#include #include namespace xrpl {