Wrap sidecar in arcs (#11554)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Kaushik Donthi
2024-10-30 09:06:37 -07:00
committed by GitHub
parent bb8da983b0
commit 755fac08dd
11 changed files with 84 additions and 46 deletions

View File

@ -13,6 +13,7 @@ use serde::{Deserialize, Serialize};
use std::{
collections::VecDeque,
pin::Pin,
sync::Arc,
task::{Context, Poll},
};
use thiserror::Error;
@ -110,9 +111,10 @@ where
match self.pool.get_all_blobs_exact(txs.iter().map(|(tx, _)| tx.hash()).collect()) {
Ok(blobs) => {
actions_to_queue.reserve_exact(txs.len());
for ((tx, _), sidecar) in txs.iter().zip(blobs.iter()) {
let transaction = BlobTransaction::try_from_signed(tx.clone(), sidecar.clone())
.expect("should not fail to convert blob tx if it is already eip4844");
for ((tx, _), sidecar) in txs.iter().zip(blobs.into_iter()) {
let transaction =
BlobTransaction::try_from_signed(tx.clone(), Arc::unwrap_or_clone(sidecar))
.expect("should not fail to convert blob tx if it is already eip4844");
let block_metadata = BlockMetadata {
block_hash: block.hash(),