From 3231d7c1a2ddd33a8e8f10e7beb01e05d9405d52 Mon Sep 17 00:00:00 2001 From: Martins0152 Date: Sat, 29 Aug 2026 00:11:47 +0100 Subject: [PATCH] Remove dead SorobanTraceLayer (fixes #240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/tracing/lib.rs was never declared in src/tracing/mod.rs, so it was never compiled into the crate — unreachable, not just unused. It was an incomplete first attempt at Soroban trace-context injection (its own comment called it a placeholder). That problem is already solved by the mechanism that actually shipped: soroban_propagator::inject_context, called from blockchain/soroban/client.rs, with context recovered on-chain by SorobanEventPoller. Distributed tracing itself (issue #240) was implemented under #108/PR #210, with correlation-ID propagation following 9 days before this audit. See NOTES.md for the full audit. --- src/tracing/lib.rs | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/tracing/lib.rs diff --git a/src/tracing/lib.rs b/src/tracing/lib.rs deleted file mode 100644 index 540bdd38..00000000 --- a/src/tracing/lib.rs +++ /dev/null @@ -1,43 +0,0 @@ -use std::future::Future; -use std::pin::Pin; -use std::task::{Context, Poll}; -use tower::{Layer, Service}; -use crate::tracing::soroban_propagator::inject_context; -use crate::tracing::get_current_span_context; - -#[derive(Clone)] -pub struct SorobanTraceLayer; - -impl Layer for SorobanTraceLayer { - type Service = SorobanTraceService; - - fn layer(&self, inner: S) -> Self::Service { - SorobanTraceService { inner } - } -} - -#[derive(Clone)] -pub struct SorobanTraceService { - inner: S, -} - -impl Service for SorobanTraceService -where - S: Service, -{ - type Response = S::Response; - type Error = S::Error; - type Future = S::Future; - - fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { - self.inner.poll_ready(cx) - } - - fn call(&mut self, req: Request) -> Self::Future { - // Here we would ideally inject the context if Request allowed it. - // Since SorobanClient uses a specific method call, this Layer might need to - // be applied to a more generic HTTP service if the client was structured that way. - // For now, it's a placeholder as requested by the blueprint. - self.inner.call(req) - } -}