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 11use alloy_primitives:: U256 ;
22use reth_primitives:: SealedBlock ;
33
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+ } ;
58
69/// Trait that receives every bid made by us to the relays.
710pub trait BidObserver : std:: fmt:: Debug {
@@ -11,6 +14,7 @@ pub trait BidObserver: std::fmt::Debug {
1114 & self ,
1215 slot_data : & MevBoostSlotData ,
1316 sealed_block : & SealedBlock ,
17+ submit_block_request : & SubmitBlockRequest ,
1418 built_block_trace : & BuiltBlockTrace ,
1519 builder_name : String ,
1620 best_bid_value : U256 ,
@@ -25,6 +29,7 @@ impl BidObserver for NullBidObserver {
2529 & self ,
2630 _slot_data : & MevBoostSlotData ,
2731 _sealed_block : & SealedBlock ,
32+ _submit_block_request : & SubmitBlockRequest ,
2833 _built_block_trace : & BuiltBlockTrace ,
2934 _builder_name : String ,
3035 _best_bid_value : U256 ,
Original file line number Diff line number Diff line change 11use reth_primitives:: SealedBlock ;
22
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+ } ;
47
58use super :: bid_observer:: BidObserver ;
69
@@ -27,6 +30,7 @@ impl BidObserver for BidObserverMultiplexer {
2730 & self ,
2831 slot_data : & MevBoostSlotData ,
2932 sealed_block : & SealedBlock ,
33+ submit_block_request : & SubmitBlockRequest ,
3034 built_block_trace : & BuiltBlockTrace ,
3135 builder_name : String ,
3236 best_bid_value : alloy_primitives:: U256 ,
@@ -35,6 +39,7 @@ impl BidObserver for BidObserverMultiplexer {
3539 obs. block_submitted (
3640 slot_data,
3741 sealed_block,
42+ submit_block_request,
3843 built_block_trace,
3944 builder_name. clone ( ) ,
4045 best_bid_value,
Original file line number Diff line number Diff line change @@ -307,7 +307,7 @@ async fn run_submit_to_relays_job(
307307 & cancel,
308308 ) ;
309309
310- if let Some ( ( optimistic_signed_block, _) ) = optimistic_signed_block {
310+ let signed_block = if let Some ( ( optimistic_signed_block, _) ) = optimistic_signed_block {
311311 submit_block_to_relays (
312312 & config. chain_spec ,
313313 & optimistic_signed_block,
@@ -320,6 +320,7 @@ async fn run_submit_to_relays_job(
320320 & submission_span,
321321 & cancel,
322322 ) ;
323+ optimistic_signed_block
323324 } else {
324325 // non-optimistic submission to optimistic relays
325326 submit_block_to_relays (
@@ -334,18 +335,27 @@ async fn run_submit_to_relays_job(
334335 & submission_span,
335336 & cancel,
336337 ) ;
337- }
338+ normal_signed_block
339+ } ;
338340
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+ } ;
349359 }
350360}
351361
You can’t perform that action at this time.
0 commit comments