From 8b2eb41cfc1ce3cb2da2871d640fd793a9570d18 Mon Sep 17 00:00:00 2001 From: zeapoz Date: Mon, 29 Jul 2024 13:08:58 +0200 Subject: [PATCH] chore: don't panic on missing l2 batch number --- src/processor/snapshot/exporter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/processor/snapshot/exporter.rs b/src/processor/snapshot/exporter.rs index 519f6bd..c961e55 100644 --- a/src/processor/snapshot/exporter.rs +++ b/src/processor/snapshot/exporter.rs @@ -39,7 +39,7 @@ impl SnapshotExporter { let l2_batch_number = self .database .get_latest_l2_batch_number()? - .expect("db contains no l2 batch number"); + .unwrap_or_default(); let l2_block_number = self.database.get_latest_l2_block_number()?.unwrap_or({ tracing::warn!("WARNING: the database contains no l2 block number entry and will not be compatible with the ZKSync External Node! To export a compatible snapshot, please let the prepare-snapshot command run until an l2 block number can be found."); U64::from(0)