perf: use ExecutionResult::into_logs (#2184)

This commit is contained in:
Matthias Seitz
2023-04-14 23:56:18 +02:00
committed by GitHub
parent 08ba35bcaa
commit 6be4be6b2a
8 changed files with 342 additions and 247 deletions

View File

@ -11,7 +11,7 @@ description = "revm inspector implementations used by reth"
reth-primitives = { path = "../../primitives" }
reth-rpc-types = { path = "../../rpc/rpc-types" }
revm = { version = "3.1.0" }
revm = { version = "3" }
# remove from reth and reexport from revm
hashbrown = "0.13"

View File

@ -10,4 +10,4 @@ description = "core reth specific revm utilities"
# reth
reth-primitives = { path = "../../primitives" }
revm = { version = "3.1.0" }
revm = { version = "3" }

View File

@ -9,7 +9,7 @@ use reth_consensus_common::calc;
use reth_executor::post_state::PostState;
use reth_interfaces::executor::Error;
use reth_primitives::{
Account, Address, Block, Bloom, Bytecode, ChainSpec, Hardfork, Header, Log, Receipt,
Account, Address, Block, Bloom, Bytecode, ChainSpec, Hardfork, Header, Receipt,
ReceiptWithBloom, TransactionSigned, Withdrawal, H256, U256,
};
use reth_provider::{BlockExecutor, StateProvider};
@ -241,9 +241,6 @@ where
// append gas used
cumulative_gas_used += result.gas_used();
// cast revm logs to reth logs
let logs: Vec<Log> = result.logs().into_iter().map(into_reth_log).collect();
// Push transaction changeset and calculate header bloom filter for receipt.
post_state.add_receipt(Receipt {
tx_type: transaction.tx_type(),
@ -251,7 +248,8 @@ where
// receipts`.
success: result.is_success(),
cumulative_gas_used,
logs,
// convert to reth log
logs: result.into_logs().into_iter().map(into_reth_log).collect(),
});
post_state.finish_transition();
}