Skip to content

Commit

Permalink
chore: don't panic on missing l2 batch number
Browse files Browse the repository at this point in the history
  • Loading branch information
zeapoz committed Jul 29, 2024
1 parent 4c4211d commit 29a6e0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/processor/snapshot/exporter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::path::{Path, PathBuf};

use ethers::types::{U256, U64};
use eyre::Result;
use eyre::{OptionExt, Result};
use state_reconstruct_storage::{
snapshot::SnapshotDatabase,
snapshot_columns,
Expand Down Expand Up @@ -39,7 +39,7 @@ impl SnapshotExporter {
let l2_batch_number = self
.database
.get_latest_l2_batch_number()?
.expect("db contains no l2 batch number");
.ok_or_eyre("no latest l2 batch number in snapshot db")?;
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)
Expand Down

0 comments on commit 29a6e0a

Please sign in to comment.