feat: make more block types generic (#12812)

This commit is contained in:
Arsenii Kulikov
2024-11-25 14:50:10 +04:00
committed by GitHub
parent 02824da4fc
commit dcaa06a01a
62 changed files with 534 additions and 333 deletions

View File

@@ -22,11 +22,11 @@ use reth_errors::RethResult;
use reth_evm::execute::{BlockExecutorProvider, Executor};
use reth_execution_types::ExecutionOutcome;
use reth_fs_util as fs;
use reth_node_api::{EngineApiMessageVersion, PayloadBuilderAttributes};
use reth_node_api::{BlockTy, EngineApiMessageVersion, PayloadBuilderAttributes};
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider};
use reth_primitives::{
BlobTransaction, PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, SealedHeader,
Transaction, TransactionSigned,
BlobTransaction, BlockExt, PooledTransactionsElement, SealedBlock, SealedBlockWithSenders,
SealedHeader, Transaction, TransactionSigned,
};
use reth_provider::{
providers::{BlockchainProvider, ProviderNodeTypes},
@@ -259,7 +259,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
let senders = block.senders().expect("sender recovery failed");
let block_with_senders =
SealedBlockWithSenders::new(block.clone(), senders).unwrap();
SealedBlockWithSenders::<BlockTy<N>>::new(block.clone(), senders).unwrap();
let db = StateProviderDatabase::new(blockchain_db.latest()?);
let executor =

View File

@@ -20,6 +20,7 @@ use reth_execution_types::ExecutionOutcome;
use reth_network::{BlockDownloaderProvider, NetworkHandle};
use reth_network_api::NetworkInfo;
use reth_node_ethereum::EthExecutorProvider;
use reth_primitives::BlockExt;
use reth_provider::{
providers::ProviderNodeTypes, writer::UnifiedStorageWriter, AccountExtReader,
ChainSpecProvider, HashingWriter, HeaderProvider, LatestStateProviderRef, OriginalValuesKnown,

View File

@@ -17,6 +17,7 @@ use reth_evm::execute::{BatchExecutor, BlockExecutorProvider};
use reth_network::{BlockDownloaderProvider, NetworkHandle};
use reth_network_api::NetworkInfo;
use reth_network_p2p::full_block::FullBlockClient;
use reth_node_api::BlockTy;
use reth_node_ethereum::EthExecutorProvider;
use reth_provider::{
providers::ProviderNodeTypes, writer::UnifiedStorageWriter, BlockNumReader, BlockWriter,
@@ -144,7 +145,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
for block in blocks.into_iter().rev() {
let block_number = block.number;
let sealed_block = block
.try_seal_with_senders()
.try_seal_with_senders::<BlockTy<N>>()
.map_err(|block| eyre::eyre!("Error sealing block with senders: {block:?}"))?;
trace!(target: "reth::cli", block_number, "Executing block");