refactor: simplify Receipts implementation (#8710)

This commit is contained in:
Thomas Coratger
2024-06-10 14:26:44 +02:00
committed by GitHub
parent e5832d5189
commit 76a1a3d005
16 changed files with 66 additions and 91 deletions

View File

@ -26,7 +26,7 @@ use reth_primitives::{
constants::eip4844::{LoadKzgSettingsError, MAINNET_KZG_TRUSTED_SETUP},
revm_primitives::KzgSettings,
stage::StageId,
Address, BlobTransaction, BlobTransactionSidecar, Bytes, PooledTransactionsElement, Receipts,
Address, BlobTransaction, BlobTransactionSidecar, Bytes, PooledTransactionsElement,
SealedBlock, SealedBlockWithSenders, Transaction, TransactionSigned, TxEip4844, B256, U256,
};
use reth_provider::{
@ -273,11 +273,7 @@ impl Command {
let BlockExecutionOutput { state, receipts, .. } =
executor.execute((&block_with_senders.clone().unseal(), U256::MAX).into())?;
let state = BundleStateWithReceipts::new(
state,
Receipts::from_block_receipt(receipts),
block.number,
);
let state = BundleStateWithReceipts::new(state, receipts.into(), block.number);
debug!(target: "reth::cli", ?state, "Executed block");
let hashed_state = state.hash_state_slow();

View File

@ -15,7 +15,7 @@ use reth_errors::BlockValidationError;
use reth_evm::execute::{BlockExecutionOutput, BlockExecutorProvider, Executor};
use reth_network::NetworkHandle;
use reth_network_api::NetworkInfo;
use reth_primitives::{stage::StageId, BlockHashOrNumber, Receipts};
use reth_primitives::{stage::StageId, BlockHashOrNumber};
use reth_provider::{
AccountExtReader, BundleStateWithReceipts, ChainSpecProvider, HashingWriter, HeaderProvider,
LatestStateProviderRef, OriginalValuesKnown, ProviderFactory, StageCheckpointReader,
@ -146,11 +146,7 @@ impl Command {
)
.into(),
)?;
let block_state = BundleStateWithReceipts::new(
state,
Receipts::from_block_receipt(receipts),
block.number,
);
let block_state = BundleStateWithReceipts::new(state, receipts.into(), block.number);
// Unpacked `BundleState::state_root_slow` function
let (in_memory_state_root, in_memory_updates) =