File tree Expand file tree Collapse file tree 4 files changed +27
-12
lines changed
crates/rbuilder/src/live_builder/block_output Expand file tree Collapse file tree 4 files changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ impl BidObserver for NullBidObserver {
25
25
& self ,
26
26
_slot_data : & MevBoostSlotData ,
27
27
_sealed_block : & SealedBlock ,
28
+ _submit_block_request : & SubmitBlockRequest ,
28
29
_built_block_trace : & BuiltBlockTrace ,
29
30
_builder_name : String ,
30
31
_best_bid_value : U256 ,
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ impl BidObserver for BidObserverMultiplexer {
27
27
& self ,
28
28
slot_data : & MevBoostSlotData ,
29
29
sealed_block : & SealedBlock ,
30
+ submit_block_request : & SubmitBlockRequest ,
30
31
built_block_trace : & BuiltBlockTrace ,
31
32
builder_name : String ,
32
33
best_bid_value : alloy_primitives:: U256 ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use tokio_util::sync::CancellationToken;
10
10
use crate :: {
11
11
building:: { builders:: block_building_helper:: BiddableUnfinishedBlock , BuiltBlockTrace } ,
12
12
live_builder:: payload_events:: MevBoostSlotData ,
13
+ mev_boost:: submission:: SubmitBlockRequest ,
13
14
} ;
14
15
15
16
/// Trait that receives every bid made by us to the relays.
@@ -19,6 +20,7 @@ pub trait BidObserver: std::fmt::Debug {
19
20
& self ,
20
21
slot_data : & MevBoostSlotData ,
21
22
sealed_block : & SealedBlock ,
23
+ submit_block_request : & SubmitBlockRequest ,
22
24
built_block_trace : & BuiltBlockTrace ,
23
25
builder_name : String ,
24
26
best_bid_value : U256 ,
@@ -33,6 +35,7 @@ impl BidObserver for NullBidObserver {
33
35
& self ,
34
36
_slot_data : & MevBoostSlotData ,
35
37
_sealed_block : & SealedBlock ,
38
+ _submit_block_request : & SubmitBlockRequest ,
36
39
_built_block_trace : & BuiltBlockTrace ,
37
40
_builder_name : String ,
38
41
_best_bid_value : U256 ,
Original file line number Diff line number Diff line change @@ -298,7 +298,7 @@ async fn run_submit_to_relays_job(
298
298
& cancel,
299
299
) ;
300
300
301
- if let Some ( ( optimistic_signed_block, _) ) = optimistic_signed_block {
301
+ let signed_block = if let Some ( ( optimistic_signed_block, _) ) = optimistic_signed_block {
302
302
submit_block_to_relays (
303
303
& config. chain_spec ,
304
304
& optimistic_signed_block,
@@ -311,6 +311,7 @@ async fn run_submit_to_relays_job(
311
311
& submission_span,
312
312
& cancel,
313
313
) ;
314
+ optimistic_signed_block
314
315
} else {
315
316
// non-optimistic submission to optimistic relays
316
317
submit_block_to_relays (
@@ -325,18 +326,27 @@ async fn run_submit_to_relays_job(
325
326
& submission_span,
326
327
& cancel,
327
328
) ;
328
- }
329
+ normal_signed_block
330
+ } ;
329
331
330
- submission_span. in_scope ( || {
331
- // NOTE: we only notify normal submission here because they have the same contents but different pubkeys
332
- config. bid_observer . block_submitted (
333
- & slot_data,
334
- & block. sealed_block ,
335
- & block. trace ,
336
- builder_name,
337
- bid_metadata. value . top_competitor_bid . unwrap_or_default ( ) ,
338
- ) ;
339
- } )
332
+ match signed_block. into_request ( & config. chain_spec , None ) {
333
+ Ok ( request) => {
334
+ submission_span. in_scope ( || {
335
+ // NOTE: we only notify normal submission here because they have the same contents but different pubkeys
336
+ config. bid_observer . block_submitted (
337
+ & slot_data,
338
+ & block. sealed_block ,
339
+ & request,
340
+ & block. trace ,
341
+ builder_name,
342
+ bid_metadata. value . top_competitor_bid . unwrap_or_default ( ) ,
343
+ ) ;
344
+ } )
345
+ }
346
+ Err ( err) => {
347
+ error ! ( parent: & submission_span, err = ?err, "Error converting request for bid observer" ) ;
348
+ }
349
+ } ;
340
350
}
341
351
}
342
352
You can’t perform that action at this time.
0 commit comments