Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions src/tasks/submit/flashbots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,31 +188,35 @@ impl FlashbotsTask {
parent: &span,
"flashbots.submit",
);
let submit_span_clone = submit_span.clone();

// Send the bundle to Flashbots, instrumenting the send future so all
// events inside the async send are attributed to the submit span.
let response = self
.flashbots()
.send_mev_bundle(bundle.clone())
.with_auth(self.signer.clone())
.into_future()
.instrument(submit_span.clone())
.await;

match response {
Ok(resp) => {
counter!("signet.builder.flashbots.bundles_submitted").increment(1);
span_debug!(
submit_span,
hash = resp.map(|r| r.bundle_hash.to_string()),
"received bundle hash after submitted to flashbots"
);
let flashbots = self.flashbots().to_owned();
let signer = self.signer.clone();

tokio::spawn(async move {
let response = flashbots
.send_mev_bundle(bundle.clone())
.with_auth(signer.clone())
.into_future()
.await;

match response {
Ok(resp) => {
counter!("signet.builder.flashbots.bundles_submitted").increment(1);
span_debug!(
submit_span_clone,
hash = resp.map(|r| r.bundle_hash.to_string()),
"received bundle hash after submitted to flashbots"
);
}
Err(err) => {
counter!("signet.builder.flashbots.submission_failures").increment(1);
span_error!(submit_span_clone, %err, "MEV bundle submission failed - error returned");
}
}
Err(err) => {
counter!("signet.builder.flashbots.submission_failures").increment(1);
span_error!(submit_span, %err, "MEV bundle submission failed - error returned");
}
}
}.instrument(submit_span.clone()));
}
}

Expand Down