From 04af67879c6dac9a9984dedc0e512d16b8eebb1f Mon Sep 17 00:00:00 2001 From: Kero Date: Fri, 20 Dec 2024 16:30:41 +0800 Subject: [PATCH] chore: assert etl_config.file_size != 0 (#13435) --- crates/storage/db-common/src/init.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/storage/db-common/src/init.rs b/crates/storage/db-common/src/init.rs index 95b2a5d5c4a9..1c5ce30ce97f 100644 --- a/crates/storage/db-common/src/init.rs +++ b/crates/storage/db-common/src/init.rs @@ -373,6 +373,10 @@ where + StateWriter + AsRef, { + if etl_config.file_size == 0 { + return Err(eyre::eyre!("ETL file size cannot be zero")) + } + let block = provider_rw.last_block_number()?; let hash = provider_rw.block_hash(block)?.unwrap(); let expected_state_root = provider_rw