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

567
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ reth-consensus-common = { path = "../../consensus/common" }
reth-revm-primitives = { path = "../../revm/revm-primitives" }
## ethereum
revm-primitives = "1"
revm-primitives = "1.1"
## async
tokio = { version = "1", features = ["sync"] }

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();
}

View File

@ -13,7 +13,7 @@ bytes = { version = "1", default-features = false }
ethnum = { version = "1", default-features = false, optional = true }
smol_str = { version = "0.1", default-features = false, optional = true }
ethereum-types = { version = "0.14", features = ["codec"], optional = true }
revm-primitives = { version = "1.1.0", features = ["serde"] }
revm-primitives = { version = "1.1", features = ["serde"] }
reth-rlp-derive = { version = "0.1", path = "./rlp-derive", optional = true }
[dev-dependencies]

View File

@ -25,7 +25,7 @@ reth-revm = { path = "../../revm" }
reth-tasks = { path = "../../tasks" }
# eth
revm = { version = "3.1.0", features = ["optional_block_gas_limit", "optional_eip3607", "optional_no_base_fee"] }
revm = { version = "3", features = ["optional_block_gas_limit", "optional_eip3607", "optional_no_base_fee"] }
ethers-core = { git = "https://github.com/gakonst/ethers-rs", features = ["eip712"] }
revm-primitives = { version = "1.1", features = ["serde"] }

View File

@ -23,7 +23,7 @@ arbitrary = [
[dependencies]
bytes = "1.4"
codecs-derive = { version = "0.1.0", path = "./derive", default-features = false }
revm-primitives = { version = "1.1.0", features = ["serde"] }
revm-primitives = { version = "1.1", features = ["serde"] }
# arbitrary utils
arbitrary = { version = "1.1.7", features = ["derive"], optional = true }
@ -31,7 +31,7 @@ proptest = { version = "1.0", optional = true }
proptest-derive = { version = "0.3", optional = true }
[dev-dependencies]
revm-primitives = {version = "1.1.0", features = [
revm-primitives = { version = "1.1", features = [
"serde",
"arbitrary"
] }