Skip to content

Commit 046f9f1

Browse files
committed
apollo_l1_provider: add reset_bootstrapper function
1 parent c4630be commit 046f9f1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

crates/apollo_l1_provider/src/l1_provider.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use starknet_api::executable_transaction::L1HandlerTransaction;
2121
use starknet_api::transaction::TransactionHash;
2222
use tracing::{debug, error, info, instrument, trace, warn};
2323

24-
use crate::bootstrapper::Bootstrapper;
24+
use crate::bootstrapper::{Bootstrapper, SyncTaskHandle};
2525
use crate::transaction_manager::TransactionManager;
2626
use crate::L1ProviderConfig;
2727

@@ -72,6 +72,13 @@ impl L1Provider {
7272
start_height: None,
7373
}
7474
}
75+
pub fn reset_bootstrapper(&mut self) {
76+
self.bootstrapper = Bootstrapper::new(
77+
self.bootstrapper.l1_provider_client.clone(),
78+
self.bootstrapper.sync_client.clone(),
79+
self.config.startup_sync_sleep_retry_interval_seconds,
80+
);
81+
}
7582
// Functions Called by the scraper.
7683

7784
// Start the provider, get first-scrape events, start L2 sync.
@@ -437,6 +444,7 @@ impl L1Provider {
437444
);
438445

439446
self.state = ProviderState::Pending;
447+
self.reset_bootstrapper();
440448
}
441449

442450
Ok(())

0 commit comments

Comments
 (0)