From 360698d79d7eae09e44de0eeaa3e6f42a2edb5a9 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 28 Apr 2026 15:00:26 +0100 Subject: [PATCH] fix(telemetry): remove duplicate hashSpan(4-arg) from rebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 4-arg hashSpan overload was duplicated during a prior rebase cascade — it appeared at both line 240 and line 305 in SpanGuard.cpp. This would cause a linker error (multiple definition). Co-Authored-By: Claude Opus 4.6 (1M context) --- src/libxrpl/telemetry/SpanGuard.cpp | 33 ----------------------------- 1 file changed, 33 deletions(-) diff --git a/src/libxrpl/telemetry/SpanGuard.cpp b/src/libxrpl/telemetry/SpanGuard.cpp index fee94ec8cb..cf434e2e1a 100644 --- a/src/libxrpl/telemetry/SpanGuard.cpp +++ b/src/libxrpl/telemetry/SpanGuard.cpp @@ -299,39 +299,6 @@ SpanGuard::hashSpan( return SpanGuard(std::make_unique(tel->startSpan(std::string(name), parentCtx))); } -// ===== Hash-derived span (generic, category-gated) ========================= - -SpanGuard -SpanGuard::hashSpan( - TraceCategory cat, - std::string_view name, - std::uint8_t const* hashData, - std::size_t hashSize) -{ - if (hashSize < 16) - return {}; - auto* tel = Telemetry::getInstance(); - if (!tel || !tel->isEnabled() || !isCategoryEnabled(*tel, cat)) - return {}; - - otel_trace::TraceId traceId(opentelemetry::nostd::span(hashData, 16)); - - auto const rval = default_prng()(); - std::uint8_t spanIdBytes[8]; - std::memcpy(spanIdBytes, &rval, sizeof(spanIdBytes)); - otel_trace::SpanId spanId(opentelemetry::nostd::span(spanIdBytes, 8)); - - otel_trace::SpanContext syntheticCtx( - traceId, spanId, otel_trace::TraceFlags(1), /* remote = */ false); - - auto parentCtx = opentelemetry::context::Context{}.SetValue( - otel_trace::kSpanKey, - opentelemetry::nostd::shared_ptr( - new otel_trace::DefaultSpan(syntheticCtx))); - - return SpanGuard(std::make_unique(tel->startSpan(std::string(name), parentCtx))); -} - // ===== Context capture ===================================================== SpanContext