From e2f4b3c8e6c0e85e834088f96238f0cd05d73e10 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Thu, 6 Aug 2026 12:00:06 +0100 Subject: [PATCH] fix: repair build against renamed namespaces from develop develop renamed CamelCase namespaces to snake_case with no compatibility aliases, so lines this branch added still referenced the old names. The merge was textually clean because develop never touched those lines, which left the breakage invisible to git and visible only at compile time. PeerFinder:: -> peer_finder:: Overlay.h, OverlayImpl.h, MetricMacros.cpp Tuning:: -> tuning:: PeerImp.cpp (the other call sites in this file already used the lowercase form) Two further merge artifacts: json_value.h develop added `using value_type = Value const` to ValueConstIterator, and this branch had added `using value_type = Value` for the same reason, so the merge kept both and they redefined the alias with different types. Keep develop's const-qualified type -- correct for an iterator whose reference is `Value const&` -- and keep only this branch's iterator_category addition. InboundLedger.h is no longer used directly by the header, but five translation units that include it use std::string without including themselves. Mark it `IWYU pragma: keep` rather than remove it, matching suite_list.h. --- include/xrpl/json/json_value.h | 1 - src/tests/libxrpl/telemetry/MetricMacros.cpp | 12 ++++++------ src/xrpld/app/ledger/InboundLedger.h | 2 +- src/xrpld/overlay/Overlay.h | 2 +- src/xrpld/overlay/detail/OverlayImpl.h | 2 +- src/xrpld/overlay/detail/PeerImp.cpp | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/xrpl/json/json_value.h b/include/xrpl/json/json_value.h index 2b7459f6bf..0a87341a97 100644 --- a/include/xrpl/json/json_value.h +++ b/include/xrpl/json/json_value.h @@ -629,7 +629,6 @@ public: // this as a Cpp17InputIterator; without them it defaults to output-only, // which breaks standard algorithms (e.g. std::all_of). The iterator walks a // map both ways via ++/--, so it is bidirectional. - using value_type = Value; using iterator_category = std::bidirectional_iterator_tag; using reference = Value const&; using pointer = Value const*; diff --git a/src/tests/libxrpl/telemetry/MetricMacros.cpp b/src/tests/libxrpl/telemetry/MetricMacros.cpp index 7c93ed82c6..9d5909a513 100644 --- a/src/tests/libxrpl/telemetry/MetricMacros.cpp +++ b/src/tests/libxrpl/telemetry/MetricMacros.cpp @@ -1719,7 +1719,7 @@ TEST(MetricMacros, jobq_saturation_gauge_observes_exact_pool_exhaustion_values) // meter, mirroring the production callback shape, because the real // MetricsRegistry's enabled path cannot be linked into this standalone binary // (see the file header). The snapshot types are the REAL xrpl::PeerLedgerSupply -// and xrpl::PeerFinder::SlotCensus aggregates, so a field rename or a reorder on +// and xrpl::peer_finder::SlotCensus aggregates, so a field rename or a reorder on // either side breaks these tests instead of silently drifting from production. // Both are plain header-only aggregates with no out-of-line members, so using // them here adds no xrpld link dependency. @@ -1889,7 +1889,7 @@ TEST(MetricMacros, slot_census_gauge_names_each_bootstrap_fault_exactly) // The real snapshot type the production callback consumes. Outbound is 2 of // 10 with 6 dials in flight; one configured fixed peer is missing. - PeerFinder::SlotCensus observed{ + peer_finder::SlotCensus observed{ .outActive = 2, .outMax = 10, .inActive = 0, @@ -1905,7 +1905,7 @@ TEST(MetricMacros, slot_census_gauge_names_each_bootstrap_fault_exactly) "PeerFinder slots, connection attempts and address caches"); gauge->AddCallback( [](opentelemetry::metrics::ObserverResult result, void* state) { - auto const* self = static_cast(state); + auto const* self = static_cast(state); // Same single-label Observe() form the production callback uses. auto observe = [&](char const* field, std::int64_t value) { opentelemetry::nostd::getAddCallback( [](opentelemetry::metrics::ObserverResult result, void* state) { - auto const* self = static_cast(state); + auto const* self = static_cast(state); auto observe = [&](char const* field, std::int64_t value) { opentelemetry::nostd::get>>(result) @@ -2022,7 +2022,7 @@ TEST(MetricMacros, slot_census_gauge_reports_every_field_even_when_idle) // NEGATIVE: an idle-but-healthy node still reports EVERY field. A zero-valued // field must be a present series, never an absent one -- absence would be // indistinguishable from a dead exporter or a crashed callback. - observed = PeerFinder::SlotCensus{ + observed = peer_finder::SlotCensus{ .outActive = 10, .outMax = 10, .inActive = 5, diff --git a/src/xrpld/app/ledger/InboundLedger.h b/src/xrpld/app/ledger/InboundLedger.h index da9fc88b1c..81f5114e1a 100644 --- a/src/xrpld/app/ledger/InboundLedger.h +++ b/src/xrpld/app/ledger/InboundLedger.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include // IWYU pragma: keep #include #include #include diff --git a/src/xrpld/overlay/Overlay.h b/src/xrpld/overlay/Overlay.h index ec75e9ccc4..402d2c08da 100644 --- a/src/xrpld/overlay/Overlay.h +++ b/src/xrpld/overlay/Overlay.h @@ -332,7 +332,7 @@ public: * * @return One consistent snapshot of all nine fields. */ - [[nodiscard]] virtual PeerFinder::SlotCensus + [[nodiscard]] virtual peer_finder::SlotCensus getSlotCensus() = 0; }; diff --git a/src/xrpld/overlay/detail/OverlayImpl.h b/src/xrpld/overlay/detail/OverlayImpl.h index 4f41d46943..f6994c0e80 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.h +++ b/src/xrpld/overlay/detail/OverlayImpl.h @@ -452,7 +452,7 @@ public: * * @return One consistent snapshot of all nine slot/cache fields. */ - [[nodiscard]] PeerFinder::SlotCensus + [[nodiscard]] peer_finder::SlotCensus getSlotCensus() override { return peerFinder_->getSlotCensus(); diff --git a/src/xrpld/overlay/detail/PeerImp.cpp b/src/xrpld/overlay/detail/PeerImp.cpp index e97a39a5e0..908aa2f5e3 100644 --- a/src/xrpld/overlay/detail/PeerImp.cpp +++ b/src/xrpld/overlay/detail/PeerImp.cpp @@ -3722,7 +3722,7 @@ PeerImp::finishServeSpan( auto const served = ledgerData.nodes_size(); span.setAttribute(ledger_span::attr::servedNodes, static_cast(served)); span.setAttribute( - ledger_span::attr::outcome, ledger_span::serveOutcome(served, Tuning::kSoftMaxReplyNodes)); + ledger_span::attr::outcome, ledger_span::serveOutcome(served, tuning::kSoftMaxReplyNodes)); // Which ledger was served. Known only once getLedger() succeeded, so it is // read here rather than at span start. Span-only: a per-ledger value as a // metric dimension would mint one series per ledger.