Skip to content

Commit 02ac09d

Browse files
committed
Revert checkpoints removal
1 parent 9ce8500 commit 02ac09d

2 files changed

Lines changed: 2 additions & 24 deletions

File tree

crates/l2/sequencer/l1_proof_sender.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
use std::{
2-
collections::{BTreeMap, HashMap},
3-
fs::remove_dir_all,
4-
path::PathBuf,
5-
};
1+
use std::collections::{BTreeMap, HashMap};
62

73
use ethrex_common::{Address, U256};
84
use ethrex_l2_common::{
@@ -74,8 +70,6 @@ pub struct L1ProofSender {
7470
l1_chain_id: u64,
7571
network: Network,
7672
fee_estimate: FeeEstimationType,
77-
/// Directory where checkpoints are stored.
78-
checkpoints_dir: PathBuf,
7973
aligned_mode: bool,
8074
}
8175

@@ -94,7 +88,6 @@ pub struct L1ProofSenderHealth {
9488
}
9589

9690
impl L1ProofSender {
97-
#[allow(clippy::too_many_arguments)]
9891
async fn new(
9992
cfg: &ProofCoordinatorConfig,
10093
committer_cfg: &CommitterConfig,
@@ -103,7 +96,6 @@ impl L1ProofSender {
10396
aligned_cfg: &AlignedConfig,
10497
rollup_store: StoreRollup,
10598
needed_proof_types: Vec<ProverType>,
106-
checkpoints_dir: PathBuf,
10799
) -> Result<Self, ProofSenderError> {
108100
let eth_client = EthClient::new_with_config(
109101
eth_cfg.rpc_url.clone(),
@@ -130,7 +122,6 @@ impl L1ProofSender {
130122
l1_chain_id,
131123
network: aligned_cfg.network.clone(),
132124
fee_estimate,
133-
checkpoints_dir,
134125
aligned_mode: aligned_cfg.aligned_mode,
135126
})
136127
}
@@ -140,7 +131,6 @@ impl L1ProofSender {
140131
sequencer_state: SequencerState,
141132
rollup_store: StoreRollup,
142133
needed_proof_types: Vec<ProverType>,
143-
checkpoints_dir: PathBuf,
144134
) -> Result<GenServerHandle<L1ProofSender>, ProofSenderError> {
145135
let state = Self::new(
146136
&cfg.proof_coordinator,
@@ -150,7 +140,6 @@ impl L1ProofSender {
150140
&cfg.aligned,
151141
rollup_store,
152142
needed_proof_types,
153-
checkpoints_dir,
154143
)
155144
.await?;
156145
let mut l1_proof_sender = L1ProofSender::start(state);
@@ -203,16 +192,6 @@ impl L1ProofSender {
203192
self.rollup_store
204193
.set_latest_sent_batch_proof(batch_to_send)
205194
.await?;
206-
let checkpoint_path = self
207-
.checkpoints_dir
208-
.join(format!("checkpoint_batch_{}", batch_to_send - 1));
209-
if checkpoint_path.exists() {
210-
let _ = remove_dir_all(&checkpoint_path).inspect_err(|e| {
211-
error!(
212-
"Failed to remove checkpoint directory at path {checkpoint_path:?}. Should be removed manually. Error: {}", e.to_string()
213-
)
214-
});
215-
}
216195
} else {
217196
let missing_proof_types: Vec<String> = missing_proof_types
218197
.iter()

crates/l2/sequencer/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub async fn start_l2(
110110
initial_checkpoint_store,
111111
initial_checkpoint_blockchain,
112112
genesis,
113-
checkpoints_dir.clone(),
113+
checkpoints_dir,
114114
)
115115
.await
116116
.inspect_err(|err| {
@@ -131,7 +131,6 @@ pub async fn start_l2(
131131
shared_state.clone(),
132132
rollup_store.clone(),
133133
needed_proof_types.clone(),
134-
checkpoints_dir,
135134
)
136135
.await
137136
.inspect_err(|err| {

0 commit comments

Comments
 (0)