@@ -105,7 +105,11 @@ impl TestFixture {
105105 /// ```
106106 pub async fn shutdown_node ( & mut self , node_index : usize ) -> eyre:: Result < ( ) > {
107107 if node_index >= self . nodes . len ( ) {
108- return Err ( eyre:: eyre!( "Node index {} out of bounds (total nodes: {})" , node_index, self . nodes. len( ) ) ) ;
108+ return Err ( eyre:: eyre!(
109+ "Node index {} out of bounds (total nodes: {})" ,
110+ node_index,
111+ self . nodes. len( )
112+ ) ) ;
109113 }
110114
111115 if self . nodes [ node_index] . is_none ( ) {
@@ -115,7 +119,8 @@ impl TestFixture {
115119 tracing:: info!( "Shutting down node at index {}" , node_index) ;
116120
117121 // Step 1: Explicitly shutdown the ChainOrchestrator
118- // This sends a Shutdown command that will make the ChainOrchestrator exit its event loop immediately
122+ // This sends a Shutdown command that will make the ChainOrchestrator exit its event loop
123+ // immediately
119124 if let Some ( node) = & self . nodes [ node_index] {
120125 tracing:: info!( "Sending shutdown command to ChainOrchestrator..." ) ;
121126 if let Err ( e) = node. rollup_manager_handle . shutdown ( ) . await {
@@ -175,12 +180,13 @@ impl TestFixture {
175180 /// fixture.l1().sync().await?;
176181 /// fixture.expect_event().l1_synced().await?;
177182 /// ```
178- pub async fn start_node (
179- & mut self ,
180- node_index : usize ,
181- ) -> eyre:: Result < ( ) > {
183+ pub async fn start_node ( & mut self , node_index : usize ) -> eyre:: Result < ( ) > {
182184 if node_index >= self . nodes . len ( ) {
183- return Err ( eyre:: eyre!( "Node index {} out of bounds (total nodes: {})" , node_index, self . nodes. len( ) ) ) ;
185+ return Err ( eyre:: eyre!(
186+ "Node index {} out of bounds (total nodes: {})" ,
187+ node_index,
188+ self . nodes. len( )
189+ ) ) ;
184190 }
185191
186192 if self . nodes [ node_index] . is_some ( ) {
@@ -189,24 +195,17 @@ impl TestFixture {
189195
190196 tracing:: info!( "Starting node at index {} (reusing database)" , node_index) ;
191197
192- // Step 1: Prepare database for reuse
193- // Pass only the database for this specific node (preserves all state)
194- let node_dbs = if node_index < self . dbs . len ( ) {
195- vec ! [ self . dbs[ node_index] . clone( ) ]
196- } else {
197- Vec :: new ( ) // Should not happen, but handle gracefully
198- } ;
199-
200198 // Step 2: Create a new node instance with the existing database
201199 let ( mut new_nodes, _, _) = setup_engine (
202200 & self . tasks ,
203201 self . config . clone ( ) ,
204- 1 , // Create just one node
205- node_dbs , // Reuse the database (state is preserved)
202+ 1 ,
203+ Some ( self . dbs [ node_index ] . clone ( ) ) , // reuse provided database
206204 self . chain_spec . clone ( ) ,
207- true , // is_dev
208- false , // no_local_transactions_propagation
209- ) . await ?;
205+ true ,
206+ false ,
207+ )
208+ . await ?;
210209
211210 if new_nodes. is_empty ( ) {
212211 return Err ( eyre:: eyre!( "Failed to create new node" ) ) ;
@@ -240,9 +239,8 @@ impl TestFixture {
240239
241240 // Step 6: Initialize Engine with the restored ForkchoiceState
242241 let engine = Engine :: new ( Arc :: new ( engine_client) , fcs) ;
243- let chain_orchestrator_rx = new_node. inner . add_ons_handle . rollup_manager_handle
244- . get_event_listener ( )
245- . await ?;
242+ let chain_orchestrator_rx =
243+ new_node. inner . add_ons_handle . rollup_manager_handle . get_event_listener ( ) . await ?;
246244
247245 // Step 7: Determine node type (sequencer vs follower)
248246 let was_sequencer = self . config . sequencer_args . sequencer_enabled && node_index == 0 ;
@@ -267,4 +265,4 @@ impl TestFixture {
267265
268266 Ok ( ( ) )
269267 }
270- }
268+ }
0 commit comments