diff --git a/crates/starknet_batcher/src/batcher.rs b/crates/starknet_batcher/src/batcher.rs index b95b945c9b..1599fee826 100644 --- a/crates/starknet_batcher/src/batcher.rs +++ b/crates/starknet_batcher/src/batcher.rs @@ -112,10 +112,7 @@ impl Batcher { }); } - // Clear all the proposals from the previous height. - self.proposal_manager.reset().await; - self.propose_tx_streams.clear(); - self.validate_tx_streams.clear(); + self.abort_active_height().await; info!("Starting to work on height {}.", input.height); self.active_height = Some(input.height); @@ -234,6 +231,13 @@ impl Batcher { } } + /// Clear all the proposals from the previous height. + async fn abort_active_height(&mut self) { + self.proposal_manager.reset().await; + self.propose_tx_streams.clear(); + self.validate_tx_streams.clear(); + } + async fn handle_send_txs_request( &mut self, proposal_id: ProposalId,