From f10fcc595ef0957090d6ffa9e90606e68b21d56d Mon Sep 17 00:00:00 2001 From: James Date: Tue, 25 Nov 2025 12:59:28 -0500 Subject: [PATCH] fix: filter bundles on insertion --- src/tasks/cache/task.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tasks/cache/task.rs b/src/tasks/cache/task.rs index ad2d7ae..294a1d1 100644 --- a/src/tasks/cache/task.rs +++ b/src/tasks/cache/task.rs @@ -55,6 +55,16 @@ impl CacheTask { } } Some(bundle) = self.bundles.recv() => { + + let env_block = self.envs.borrow().as_ref().map(|e| e.rollup_env().number.to::()).unwrap_or_default(); + let bundle_block = bundle.bundle.block_number(); + + // Don't insert bundles for past blocks + if env_block > bundle_block { + debug!(env.block = env_block, bundle.block = bundle_block, "skipping bundle insert"); + continue; + } + let res = cache.add_bundle(bundle.bundle, basefee); // Skip bundles that fail to be added to the cache if let Err(e) = res {