Skip to content

Commit f10fcc5

Browse files
committed
fix: filter bundles on insertion
1 parent f53035e commit f10fcc5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/tasks/cache/task.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ impl CacheTask {
5555
}
5656
}
5757
Some(bundle) = self.bundles.recv() => {
58+
59+
let env_block = self.envs.borrow().as_ref().map(|e| e.rollup_env().number.to::<u64>()).unwrap_or_default();
60+
let bundle_block = bundle.bundle.block_number();
61+
62+
// Don't insert bundles for past blocks
63+
if env_block > bundle_block {
64+
debug!(env.block = env_block, bundle.block = bundle_block, "skipping bundle insert");
65+
continue;
66+
}
67+
5868
let res = cache.add_bundle(bundle.bundle, basefee);
5969
// Skip bundles that fail to be added to the cache
6070
if let Err(e) = res {

0 commit comments

Comments
 (0)