diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs index f70c6423f055..62508a80cc48 100644 --- a/core/bin/external_node/src/config/mod.rs +++ b/core/bin/external_node/src/config/mod.rs @@ -391,8 +391,8 @@ pub(crate) struct OptionalENConfig { /// may be temporarily retained for other reasons; e.g., a batch cannot be pruned until it is executed on L1, /// which happens roughly 24 hours after its generation on the mainnet. Thus, in practice this value can specify /// the retention period greater than that implicitly imposed by other criteria (e.g., 7 or 30 days). - /// If not specified or set to 0, L1 batches will not be retained based on their timestamp. - #[serde(default)] + /// If set to 0, L1 batches will not be retained based on their timestamp. The default value is 1 hour. + #[serde(default = "OptionalENConfig::default_pruning_data_retention_sec")] pruning_data_retention_sec: u64, } @@ -541,6 +541,10 @@ impl OptionalENConfig { NonZeroU64::new(60).unwrap() } + fn default_pruning_data_retention_sec() -> u64 { + 3_600 // 1 hour + } + pub fn polling_interval(&self) -> Duration { Duration::from_millis(self.polling_interval) } diff --git a/core/tests/snapshot-recovery-test/tests/snapshot-recovery.test.ts b/core/tests/snapshot-recovery-test/tests/snapshot-recovery.test.ts index 2855f1d06d95..c3bf517cba03 100644 --- a/core/tests/snapshot-recovery-test/tests/snapshot-recovery.test.ts +++ b/core/tests/snapshot-recovery-test/tests/snapshot-recovery.test.ts @@ -354,7 +354,8 @@ describe('snapshot recovery', () => { const pruningParams = { EN_PRUNING_ENABLED: 'true', - EN_PRUNING_REMOVAL_DELAY_SEC: '3', + EN_PRUNING_REMOVAL_DELAY_SEC: '2', + EN_PRUNING_DATA_RETENTION_SEC: '0', // immediately prune executed batches EN_PRUNING_CHUNK_SIZE: '1' }; externalNodeEnv = { ...externalNodeEnv, ...pruningParams };