@@ -45,21 +45,26 @@ impl BuildingStage {
4545 // so worst case this will be lower by `max_batch_size`
4646 self . update_metrics ( ) . await ;
4747
48- info ! ( ?payloads, "Building transactions from payloads" ) ;
49- let tx_building_results = self . state . adapter . build_transactions ( & payloads) . await ;
48+ self . build_transactions ( & payloads) . await ;
49+ }
50+ }
51+
52+ #[ instrument( skip_all, fields( payload_and_message_ids = ?payloads. iter( ) . map( |p| ( p. details. uuid. to_string( ) , p. details. metadata. clone( ) ) ) . collect:: <Vec <_>>( ) ) ) ]
53+ async fn build_transactions ( & self , payloads : & Vec < FullPayload > ) {
54+ info ! ( ?payloads, "Building transactions from payloads" ) ;
55+ let tx_building_results = self . state . adapter . build_transactions ( payloads) . await ;
5056
51- for tx_building_result in tx_building_results {
52- // push payloads that failed to be processed (but didn't fail simulation)
53- // to the back of the queue
54- if let Err ( err) = self
55- . handle_tx_building_result ( tx_building_result. clone ( ) )
56- . await
57- {
58- error ! ( ?err, payloads=?tx_building_result. payloads, "Error handling tx building result" ) ;
59- let full_payloads =
60- get_full_payloads_from_details ( & payloads, & tx_building_result. payloads ) ;
61- self . queue . extend ( full_payloads) . await ;
62- }
57+ for tx_building_result in tx_building_results {
58+ // push payloads that failed to be processed (but didn't fail simulation)
59+ // to the back of the queue
60+ if let Err ( err) = self
61+ . handle_tx_building_result ( tx_building_result. clone ( ) )
62+ . await
63+ {
64+ error ! ( ?err, payloads=?tx_building_result. payloads, "Error handling tx building result" ) ;
65+ let full_payloads =
66+ get_full_payloads_from_details ( payloads, & tx_building_result. payloads ) ;
67+ self . queue . extend ( full_payloads) . await ;
6368 }
6469 }
6570 }
0 commit comments