@@ -6,10 +6,7 @@ use crate::{
66 tasks:: { block:: sim:: SimResult , submit:: SubmitPrep } ,
77} ;
88use alloy:: {
9- consensus:: TxEnvelope ,
10- eips:: Encodable2718 ,
11- primitives:: { Bytes , TxHash } ,
12- providers:: ext:: MevApi ,
9+ consensus:: TxEnvelope , eips:: Encodable2718 , primitives:: TxHash , providers:: ext:: MevApi ,
1310 rpc:: types:: mev:: EthSendBundle ,
1411} ;
1512use init4_bin_base:: { deps:: metrics:: counter, utils:: signer:: LocalOrAws } ;
@@ -84,7 +81,7 @@ impl FlashbotsTask {
8481 let tx_bytes = block_tx. encoded_2718 ( ) . into ( ) ;
8582
8683 // Build the bundle body with the block_tx bytes as the last transaction in the bundle.
87- let txs = self . build_bundle_body ( sim_result , tx_bytes) ;
84+ let txs = sim_result . build_bundle_body ( tx_bytes) ;
8885
8986 // Create the MEV bundle (valid only in the specific host block)
9087 Ok ( EthSendBundle {
@@ -132,26 +129,6 @@ impl FlashbotsTask {
132129 }
133130 }
134131
135- /// Constructs the MEV bundle body from host transactions and the submission transaction.
136- ///
137- /// Combines all host transactions from the rollup block with the prepared rollup block
138- /// submission transaction, wrapping each as a non-revertible bundle item.
139- ///
140- /// The rollup block transaction is placed last in the bundle.
141- fn build_bundle_body (
142- & self ,
143- sim_result : & SimResult ,
144- tx_bytes : alloy:: primitives:: Bytes ,
145- ) -> Vec < Bytes > {
146- sim_result
147- . block
148- . host_transactions ( )
149- . iter ( )
150- . map ( |tx| tx. encoded_2718 ( ) . into ( ) )
151- . chain ( std:: iter:: once ( tx_bytes) )
152- . collect ( )
153- }
154-
155132 /// Main task loop that processes simulation results and submits bundles to Flashbots.
156133 ///
157134 /// Receives `SimResult`s from the inbound channel, prepares MEV bundles, and submits
0 commit comments