File tree Expand file tree Collapse file tree 3 files changed +34
-14
lines changed
crates/rbuilder/src/live_builder/block_output Expand file tree Collapse file tree 3 files changed +34
-14
lines changed Original file line number Diff line number Diff line change 1
1
use alloy_primitives:: U256 ;
2
2
use reth_primitives:: SealedBlock ;
3
3
4
- use crate :: { building:: BuiltBlockTrace , live_builder:: payload_events:: MevBoostSlotData } ;
4
+ use crate :: {
5
+ building:: BuiltBlockTrace , live_builder:: payload_events:: MevBoostSlotData ,
6
+ mev_boost:: submission:: SubmitBlockRequest ,
7
+ } ;
5
8
6
9
/// Trait that receives every bid made by us to the relays.
7
10
pub trait BidObserver : std:: fmt:: Debug {
@@ -11,6 +14,7 @@ pub trait BidObserver: std::fmt::Debug {
11
14
& self ,
12
15
slot_data : & MevBoostSlotData ,
13
16
sealed_block : & SealedBlock ,
17
+ submit_block_request : & SubmitBlockRequest ,
14
18
built_block_trace : & BuiltBlockTrace ,
15
19
builder_name : String ,
16
20
best_bid_value : U256 ,
@@ -25,6 +29,7 @@ impl BidObserver for NullBidObserver {
25
29
& self ,
26
30
_slot_data : & MevBoostSlotData ,
27
31
_sealed_block : & SealedBlock ,
32
+ _submit_block_request : & SubmitBlockRequest ,
28
33
_built_block_trace : & BuiltBlockTrace ,
29
34
_builder_name : String ,
30
35
_best_bid_value : U256 ,
Original file line number Diff line number Diff line change 1
1
use reth_primitives:: SealedBlock ;
2
2
3
- use crate :: { building:: BuiltBlockTrace , live_builder:: payload_events:: MevBoostSlotData } ;
3
+ use crate :: {
4
+ building:: BuiltBlockTrace , live_builder:: payload_events:: MevBoostSlotData ,
5
+ mev_boost:: submission:: SubmitBlockRequest ,
6
+ } ;
4
7
5
8
use super :: bid_observer:: BidObserver ;
6
9
@@ -27,6 +30,7 @@ impl BidObserver for BidObserverMultiplexer {
27
30
& self ,
28
31
slot_data : & MevBoostSlotData ,
29
32
sealed_block : & SealedBlock ,
33
+ submit_block_request : & SubmitBlockRequest ,
30
34
built_block_trace : & BuiltBlockTrace ,
31
35
builder_name : String ,
32
36
best_bid_value : alloy_primitives:: U256 ,
@@ -35,6 +39,7 @@ impl BidObserver for BidObserverMultiplexer {
35
39
obs. block_submitted (
36
40
slot_data,
37
41
sealed_block,
42
+ submit_block_request,
38
43
built_block_trace,
39
44
builder_name. clone ( ) ,
40
45
best_bid_value,
Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ async fn run_submit_to_relays_job(
307
307
& cancel,
308
308
) ;
309
309
310
- if let Some ( ( optimistic_signed_block, _) ) = optimistic_signed_block {
310
+ let signed_block = if let Some ( ( optimistic_signed_block, _) ) = optimistic_signed_block {
311
311
submit_block_to_relays (
312
312
& config. chain_spec ,
313
313
& optimistic_signed_block,
@@ -320,6 +320,7 @@ async fn run_submit_to_relays_job(
320
320
& submission_span,
321
321
& cancel,
322
322
) ;
323
+ optimistic_signed_block
323
324
} else {
324
325
// non-optimistic submission to optimistic relays
325
326
submit_block_to_relays (
@@ -334,18 +335,27 @@ async fn run_submit_to_relays_job(
334
335
& submission_span,
335
336
& cancel,
336
337
) ;
337
- }
338
+ normal_signed_block
339
+ } ;
338
340
339
- submission_span. in_scope ( || {
340
- // NOTE: we only notify normal submission here because they have the same contents but different pubkeys
341
- config. bid_observer . block_submitted (
342
- & slot_data,
343
- & block. sealed_block ,
344
- & block. trace ,
345
- builder_name,
346
- bid_metadata. value . top_competitor_bid . unwrap_or_default ( ) ,
347
- ) ;
348
- } )
341
+ match signed_block. into_request ( & config. chain_spec , None ) {
342
+ Ok ( request) => {
343
+ submission_span. in_scope ( || {
344
+ // NOTE: we only notify normal submission here because they have the same contents but different pubkeys
345
+ config. bid_observer . block_submitted (
346
+ & slot_data,
347
+ & block. sealed_block ,
348
+ & request,
349
+ & block. trace ,
350
+ builder_name,
351
+ bid_metadata. value . top_competitor_bid . unwrap_or_default ( ) ,
352
+ ) ;
353
+ } )
354
+ }
355
+ Err ( err) => {
356
+ error ! ( parent: & submission_span, err = ?err, "Error converting request for bid observer" ) ;
357
+ }
358
+ } ;
349
359
}
350
360
}
351
361
You can’t perform that action at this time.
0 commit comments