Skip to content

Commit

Permalink
chore: reduce revm scope in txpool
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Dec 10, 2024
1 parent 4c39b98 commit 37cd874
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ reth-zstd-compressors = { path = "crates/storage/zstd-compressors", default-feat
revm = { version = "18.0.0", features = ["std"], default-features = false }
revm-inspectors = "0.12.0"
revm-primitives = { version = "14.0.0", default-features = false }
revm-interpreter = { version = "14.0.0", default-features = false }

# eth
alloy-chains = { version = "0.1.32", default-features = false }
Expand Down
12 changes: 7 additions & 5 deletions crates/transaction-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ reth-execution-types.workspace = true
reth-fs-util.workspace = true
reth-storage-api.workspace = true
reth-tasks.workspace = true
revm.workspace = true
revm-primitives.workspace = true
revm-interpreter.workspace = true

# ethereum
alloy-eips.workspace = true
alloy-eips = { workspace = true, features = ["kzg"] }
alloy-primitives.workspace = true
alloy-rlp.workspace = true
alloy-consensus.workspace = true
Expand Down Expand Up @@ -85,9 +86,10 @@ serde = [
"bitflags/serde",
"parking_lot/serde",
"rand?/serde",
"revm/serde",
"smallvec/serde",
"reth-primitives-traits/serde",
"revm-interpreter/serde",
"revm-primitives/serde"
]
test-utils = [
"rand",
Expand All @@ -97,7 +99,6 @@ test-utils = [
"reth-chainspec/test-utils",
"reth-primitives/test-utils",
"reth-provider/test-utils",
"revm/test-utils",
"reth-primitives-traits/test-utils",
]
arbitrary = [
Expand All @@ -110,9 +111,10 @@ arbitrary = [
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"bitflags/arbitrary",
"revm/arbitrary",
"reth-primitives-traits/arbitrary",
"smallvec/arbitrary",
"revm-interpreter/arbitrary",
"revm-primitives/arbitrary"
]

[[bench]]
Expand Down
9 changes: 3 additions & 6 deletions crates/transaction-pool/src/validate/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ use alloy_consensus::{
},
BlockHeader,
};
use alloy_eips::eip4844::MAX_BLOBS_PER_BLOCK;
use alloy_eips::eip4844::{env_settings::EnvKzgSettings, MAX_BLOBS_PER_BLOCK};
use reth_chainspec::{ChainSpec, EthereumHardforks};
use reth_primitives::{InvalidTransactionError, SealedBlock};
use reth_primitives_traits::GotExpected;
use reth_storage_api::{AccountReader, StateProviderFactory};
use reth_tasks::TaskSpawner;
use revm::{
interpreter::gas::validate_initial_tx_gas,
primitives::{EnvKzgSettings, SpecId},
};
use std::{
marker::PhantomData,
sync::{atomic::AtomicBool, Arc},
Expand Down Expand Up @@ -807,6 +803,7 @@ pub fn ensure_intrinsic_gas<T: EthPoolTransaction>(
transaction: &T,
fork_tracker: &ForkTracker,
) -> Result<(), InvalidPoolTransactionError> {
use revm_primitives::SpecId;
let spec_id = if fork_tracker.is_prague_activated() {
SpecId::PRAGUE
} else if fork_tracker.is_shanghai_activated() {
Expand All @@ -815,7 +812,7 @@ pub fn ensure_intrinsic_gas<T: EthPoolTransaction>(
SpecId::MERGE
};

let gas_after_merge = validate_initial_tx_gas(
let gas_after_merge = revm_interpreter::gas::validate_initial_tx_gas(
spec_id,
transaction.input(),
transaction.is_create(),
Expand Down

0 comments on commit 37cd874

Please sign in to comment.