diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 1f6c757c4aef..75354890a467 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -969,6 +969,7 @@ impl DatabaseProvider { let block_withdrawals = self.get_or_take::(range.clone())?; let block_requests = self.get_or_take::(range.clone())?; + let block_sidecars = self.get_or_take::(range.clone())?; let block_tx = self.get_take_block_transaction_range::(range.clone())?; @@ -993,9 +994,11 @@ impl DatabaseProvider { let mut block_ommers_iter = block_ommers.into_iter(); let mut block_withdrawals_iter = block_withdrawals.into_iter(); let mut block_requests_iter = block_requests.into_iter(); + let mut block_sidecars_iter = block_sidecars.into_iter(); let mut block_ommers = block_ommers_iter.next(); let mut block_withdrawals = block_withdrawals_iter.next(); let mut block_requests = block_requests_iter.next(); + let mut block_sidecars = block_sidecars_iter.next(); let mut blocks = Vec::new(); for ((main_block_number, header), (_, header_hash), (_, tx)) in @@ -1044,10 +1047,17 @@ impl DatabaseProvider { } // sidecars can be missing - let sidecars = if self.chain_spec.is_cancun_active_at_timestamp(header.timestamp) { - self.static_file_provider.sidecars(&header.hash())? + let cancun_is_active = self.chain_spec.is_cancun_active_at_timestamp(header.timestamp); + let mut sidecars = Some(BlobSidecars::default()); + if cancun_is_active { + if let Some((block_number, _)) = block_sidecars.as_ref() { + if *block_number == main_block_number { + sidecars = Some(block_sidecars.take().unwrap().1); + block_sidecars = block_sidecars_iter.next(); + } + } } else { - None + sidecars = None; }; blocks.push(SealedBlockWithSenders {