File tree Expand file tree Collapse file tree 11 files changed +23
-2
lines changed
building/builders/parallel_builder Expand file tree Collapse file tree 11 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ impl<HttpClientType: ClientT> BlocksProcessorClient<HttpClientType> {
168168 eth_send_to_coinbase : U256 :: ZERO ,
169169 total_gas_used : res. inplace_sim . gas_used ( ) ,
170170 original_bundle : encode_bundle_for_blocks_processor ( bundle. clone ( ) ) ,
171- bundle_hash : bundle. hash ,
171+ bundle_hash : bundle. external_hash . unwrap_or ( bundle . hash ) ,
172172 } )
173173 } else {
174174 None
@@ -457,6 +457,7 @@ mod tests {
457457 refund_recipient : None ,
458458 refund_tx_hashes : None ,
459459 delayed_refund : None ,
460+ bundle_hash : None ,
460461 } ,
461462 txs : Vec :: new ( ) ,
462463 } ,
Original file line number Diff line number Diff line change @@ -208,6 +208,9 @@ pub struct Bundle {
208208
209209 /// Bundle refund data.
210210 pub refund : Option < BundleRefund > ,
211+
212+ /// Unique identifier for a bundle that was set by the sender of the bundle
213+ pub external_hash : Option < B256 > ,
211214}
212215
213216impl Bundle {
Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ impl BundleBuilder {
219219 dropping_tx_hashes,
220220 refund : self . refund ,
221221 version : LAST_BUNDLE_VERSION ,
222+ external_hash : None ,
222223 } ;
223224 bundle. hash_slow ( ) ;
224225 bundle
Original file line number Diff line number Diff line change @@ -153,6 +153,9 @@ pub struct RawBundleMetadata {
153153 /// delayedRefund (Optional) `Boolean`, A flag indicating whether the refund should be delayed.
154154 #[ serde( skip_serializing_if = "Option::is_none" ) ]
155155 pub delayed_refund : Option < bool > ,
156+ /// bundleHash, externally set unique identifier for the bundle
157+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
158+ pub bundle_hash : Option < B256 > ,
156159}
157160
158161impl RawBundleMetadata {
@@ -381,6 +384,7 @@ impl RawBundle {
381384 dropping_tx_hashes : metadata. dropping_tx_hashes ,
382385 refund,
383386 version,
387+ external_hash : metadata. bundle_hash ,
384388 } ;
385389 bundle. hash_slow ( ) ;
386390 Ok ( RawBundleDecodeResult :: NewBundle ( bundle) )
@@ -418,6 +422,7 @@ impl RawBundle {
418422 refund_tx_hashes : value. refund . as_ref ( ) . map ( |br| vec ! [ br. tx_hash] ) ,
419423 delayed_refund : value. refund . as_ref ( ) . map ( |br| br. delayed ) ,
420424 version : Some ( Self :: encode_version ( value. version ) ) ,
425+ bundle_hash : value. external_hash ,
421426 } ,
422427 }
423428 }
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ impl TestDataGenerator {
101101 dropping_tx_hashes : vec ! [ ] ,
102102 refund : None ,
103103 version : LAST_BUNDLE_VERSION ,
104+ external_hash : None ,
104105 } ;
105106 res. hash_slow ( ) ;
106107 res
@@ -166,6 +167,7 @@ impl TestDataGenerator {
166167 dropping_tx_hashes : Default :: default ( ) ,
167168 refund : None ,
168169 version : LAST_BUNDLE_VERSION ,
170+ external_hash : None ,
169171 } ;
170172 bundle. hash_slow ( ) ;
171173 bundle
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ impl<ConfigType: LiveBuilderConfig> SyntheticOrdersSource<ConfigType> {
101101 dropping_tx_hashes : Default :: default ( ) ,
102102 refund : None ,
103103 version : LAST_BUNDLE_VERSION ,
104+ external_hash : None ,
104105 } ;
105106 bundle. hash_slow ( ) ;
106107 orders. push ( OrdersWithTimestamp {
Original file line number Diff line number Diff line change @@ -557,7 +557,7 @@ fn split_orders_by_identities(
557557 for order in & block_data. available_orders {
558558 let id = order. order . id ( ) ;
559559 if let Order :: Bundle ( bundle) = & order. order {
560- bundle_hash_by_id. insert ( id, bundle. hash ) ;
560+ bundle_hash_by_id. insert ( id, bundle. external_hash . unwrap_or ( bundle . hash ) ) ;
561561 } ;
562562 order_sender_by_id. insert ( id, order_sender ( & order. order ) ) ;
563563 let address = match order_redistribution_address ( & order. order , protect_signers) {
Original file line number Diff line number Diff line change @@ -969,6 +969,7 @@ mod tests {
969969 refund : Default :: default ( ) ,
970970 refund_identity : None ,
971971 version : LAST_BUNDLE_VERSION ,
972+ external_hash : None ,
972973 } ) ;
973974 let expected = SimplifiedOrder :: new (
974975 OrderId :: Bundle ( uuid:: uuid!( "00000000-0000-0000-0000-ffff00000002" ) ) ,
@@ -1004,6 +1005,7 @@ mod tests {
10041005 } ) ,
10051006 refund_identity : None ,
10061007 version : LAST_BUNDLE_VERSION ,
1008+ external_hash : None ,
10071009 } ) ;
10081010 let expected = SimplifiedOrder :: new (
10091011 OrderId :: Bundle ( uuid:: uuid!( "00000000-0000-0000-0000-ffff00000002" ) ) ,
Original file line number Diff line number Diff line change @@ -752,6 +752,7 @@ mod test {
752752 delayed_refund: None ,
753753 refund_identity: None ,
754754 version: Some ( RawBundle :: encode_version( LAST_BUNDLE_VERSION ) ) ,
755+ bundle_hash: None ,
755756 } ,
756757 } ) ) ,
757758 }
Original file line number Diff line number Diff line change @@ -526,6 +526,7 @@ mod tests {
526526 refund : None ,
527527 refund_identity : None ,
528528 version : LAST_BUNDLE_VERSION ,
529+ external_hash : None ,
529530 } ;
530531
531532 Arc :: new ( SimulatedOrder {
You can’t perform that action at this time.
0 commit comments