Skip to content

Commit d651f09

Browse files
authored
fix: span propagationto submission (#197)
1 parent f776d43 commit d651f09

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/tasks/submit/flashbots.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,24 @@ impl FlashbotsTask {
175175
counter!("signet.builder.flashbots.bundle_prep_failures").increment(1);
176176
span_debug!(span, %error, "bundle preparation failed");
177177
});
178+
178179
let bundle = match result {
179180
Ok(bundle) => bundle,
180181
Err(_) => continue,
181182
};
182183

183-
// Make a child span to cover submission
184+
// Make a child span to cover submission, or use the current span
185+
// if debug is not enabled.
186+
let _guard = span.enter();
184187
let submit_span = debug_span!(
185188
parent: &span,
186189
"flashbots.submit",
187-
);
190+
)
191+
.or_current();
188192

189-
// Send the bundle to Flashbots, instrumenting the send future so all
190-
// events inside the async send are attributed to the submit span.
193+
// Send the bundle to Flashbots, instrumenting the send future so
194+
// all events inside the async send are attributed to the submit
195+
// span.
191196
let flashbots = self.flashbots().to_owned();
192197
let signer = self.signer.clone();
193198

src/tasks/submit/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
/// Submission logic for Flashbots
2+
pub mod flashbots;
3+
pub use flashbots::FlashbotsTask;
4+
15
mod prep;
26
pub use prep::{Bumpable, SubmitPrep};
37

48
mod sim_err;
59
pub use sim_err::{SimErrorResp, SimRevertKind};
6-
7-
/// Submission logic for Flashbots
8-
pub mod flashbots;
9-
pub use flashbots::FlashbotsTask;

0 commit comments

Comments
 (0)