feat: add get blobs exact (#4482)

This commit is contained in:
Matthias Seitz
2023-09-05 15:07:49 +02:00
committed by GitHub
parent 843d5047b9
commit f6e5826dec
7 changed files with 59 additions and 6 deletions

View File

@ -790,13 +790,10 @@ where
// only determine cancun fields when active
if chain_spec.is_cancun_activated_at_timestamp(attributes.timestamp) {
// grab the blob sidecars from the executed txs
let blobs = pool.get_all_blobs(
blob_sidecars = pool.get_all_blobs_exact(
executed_txs.iter().filter(|tx| tx.is_eip4844()).map(|tx| tx.hash).collect(),
)?;
// map to just the sidecars
blob_sidecars = blobs.into_iter().map(|(_, sidecars)| sidecars).collect();
excess_blob_gas = if chain_spec.is_cancun_activated_at_timestamp(parent_block.timestamp) {
let parent_excess_blob_gas = parent_block.excess_blob_gas.unwrap_or_default();
let parent_blob_gas_used = parent_block.blob_gas_used.unwrap_or_default();