Skip to content

Commit a0ada30

Browse files
committed
fix submit span use
1 parent 559d117 commit a0ada30

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/tasks/submit/flashbots.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,20 @@ impl FlashbotsTask {
118118
break;
119119
};
120120

121-
// Clone a span from the sim_env
122121
let span = sim_result.sim_env.clone_span();
123-
let host_block_number = sim_result.host_block_number();
124-
let ru_block_number = sim_result.block_number();
125-
let rollup_tx_count = sim_result.block.tx_count();
126-
span_debug!(span, "flashbots task received block");
127122

128123
// Don't submit empty blocks
129124
if sim_result.block.is_empty() {
125+
counter!("signet.builder.flashbots.empty_block").increment(1);
130126
span_debug!(span, "received empty block - skipping");
131127
continue;
132128
}
133129

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();
133+
span_debug!(span, "flashbots task received block");
134+
134135
// Prepare a MEV bundle with the configured call type from the sim result
135136
let bundle = match self.prepare(&sim_result).instrument(span.clone()).await {
136137
Ok(b) => b,
@@ -158,21 +159,21 @@ impl FlashbotsTask {
158159
.with_auth(self.signer.clone())
159160
.await
160161
}
161-
.instrument(submit_span)
162+
.instrument(submit_span.clone())
162163
.await;
163164

164165
match response {
165166
Ok(resp) => {
166167
counter!("signet.builder.flashbots.bundles_submitted").increment(1);
167168
span_debug!(
168-
span,
169+
submit_span,
169170
hash = resp.map(|r| r.bundle_hash.to_string()),
170171
"received bundle hash after submitted to flashbots"
171172
);
172173
}
173174
Err(err) => {
174175
counter!("signet.builder.flashbots.submission_failures").increment(1);
175-
span_error!(span, %err, "MEV bundle submission failed - error returned");
176+
span_error!(submit_span, %err, "MEV bundle submission failed - error returned");
176177
}
177178
}
178179
}

0 commit comments

Comments
 (0)