Skip to content

Commit 45f8e09

Browse files
committed
cleanup and refactor spans
1 parent a0ada30 commit 45f8e09

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

src/tasks/submit/flashbots.rs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,6 @@ impl FlashbotsTask {
126126
span_debug!(span, "received empty block - skipping");
127127
continue;
128128
}
129-
130-
let host_block_number = sim_result.host_block_number();
131-
let ru_block_number = sim_result.block_number();
132-
let rollup_tx_count = sim_result.block.tx_count();
133129
span_debug!(span, "flashbots task received block");
134130

135131
// Prepare a MEV bundle with the configured call type from the sim result
@@ -146,9 +142,6 @@ impl FlashbotsTask {
146142
let submit_span = debug_span!(
147143
parent: &span,
148144
"flashbots.submit",
149-
host_block_number,
150-
ru_block_number,
151-
rollup_tx_count
152145
);
153146

154147
// Send the bundle to Flashbots, instrumenting the send future so all
@@ -157,25 +150,26 @@ impl FlashbotsTask {
157150
self.flashbots()
158151
.send_mev_bundle(bundle.clone())
159152
.with_auth(self.signer.clone())
153+
.into_future()
154+
.instrument(submit_span.clone())
160155
.await
161156
}
162-
.instrument(submit_span.clone())
163157
.await;
164158

165-
match response {
166-
Ok(resp) => {
167-
counter!("signet.builder.flashbots.bundles_submitted").increment(1);
168-
span_debug!(
169-
submit_span,
170-
hash = resp.map(|r| r.bundle_hash.to_string()),
171-
"received bundle hash after submitted to flashbots"
172-
);
173-
}
174-
Err(err) => {
175-
counter!("signet.builder.flashbots.submission_failures").increment(1);
159+
let Ok(resp) = &response else {
160+
counter!("signet.builder.flashbots.submission_failures").increment(1);
161+
if let Err(err) = &response {
176162
span_error!(submit_span, %err, "MEV bundle submission failed - error returned");
177163
}
178-
}
164+
continue;
165+
};
166+
167+
counter!("signet.builder.flashbots.bundles_submitted").increment(1);
168+
span_debug!(
169+
submit_span,
170+
hash = resp.as_ref().map(|r| r.bundle_hash.to_string()),
171+
"received bundle hash after submitted to flashbots"
172+
);
179173
}
180174
}
181175

0 commit comments

Comments
 (0)