From dc23e6916403500e32421f7159331b64d3e61907 Mon Sep 17 00:00:00 2001 From: Jacob Kaufmann Date: Sat, 12 Aug 2023 14:19:00 -0600 Subject: [PATCH] feat: add tx pool to builder (#41) --- Cargo.lock | 143 ++++++++++++++++++++++++++++++++++++++----------- Cargo.toml | 1 + src/builder.rs | 107 +++++++++++++++++++++++++++++------- 3 files changed, 199 insertions(+), 52 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5dc06a0..6b66707 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,6 +96,20 @@ version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +[[package]] +name = "aquamarine" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +dependencies = [ + "include_dir", + "itertools 0.10.5", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "arrayvec" version = "0.7.4" @@ -354,7 +368,7 @@ dependencies = [ [[package]] name = "boa_ast" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#22b014d5d5ab9fba5dc467734227558e75c66d20" +source = "git+https://github.com/boa-dev/boa#a3b46545a2a09f9ac81fd83ac6b180934c728f61" dependencies = [ "bitflags 2.3.3", "boa_interner", @@ -367,7 +381,7 @@ dependencies = [ [[package]] name = "boa_engine" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#22b014d5d5ab9fba5dc467734227558e75c66d20" +source = "git+https://github.com/boa-dev/boa#a3b46545a2a09f9ac81fd83ac6b180934c728f61" dependencies = [ "bitflags 2.3.3", "boa_ast", @@ -405,7 +419,7 @@ dependencies = [ [[package]] name = "boa_gc" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#22b014d5d5ab9fba5dc467734227558e75c66d20" +source = "git+https://github.com/boa-dev/boa#a3b46545a2a09f9ac81fd83ac6b180934c728f61" dependencies = [ "boa_macros", "boa_profiler", @@ -416,7 +430,7 @@ dependencies = [ [[package]] name = "boa_icu_provider" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#22b014d5d5ab9fba5dc467734227558e75c66d20" +source = "git+https://github.com/boa-dev/boa#a3b46545a2a09f9ac81fd83ac6b180934c728f61" dependencies = [ "icu_collections", "icu_normalizer", @@ -429,7 +443,7 @@ dependencies = [ [[package]] name = "boa_interner" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#22b014d5d5ab9fba5dc467734227558e75c66d20" +source = "git+https://github.com/boa-dev/boa#a3b46545a2a09f9ac81fd83ac6b180934c728f61" dependencies = [ "boa_gc", "boa_macros", @@ -444,7 +458,7 @@ dependencies = [ [[package]] name = "boa_macros" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#22b014d5d5ab9fba5dc467734227558e75c66d20" +source = "git+https://github.com/boa-dev/boa#a3b46545a2a09f9ac81fd83ac6b180934c728f61" dependencies = [ "proc-macro2", "quote", @@ -455,7 +469,7 @@ dependencies = [ [[package]] name = "boa_parser" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#22b014d5d5ab9fba5dc467734227558e75c66d20" +source = "git+https://github.com/boa-dev/boa#a3b46545a2a09f9ac81fd83ac6b180934c728f61" dependencies = [ "bitflags 2.3.3", "boa_ast", @@ -475,7 +489,7 @@ dependencies = [ [[package]] name = "boa_profiler" version = "0.17.0" -source = "git+https://github.com/boa-dev/boa#22b014d5d5ab9fba5dc467734227558e75c66d20" +source = "git+https://github.com/boa-dev/boa#a3b46545a2a09f9ac81fd83ac6b180934c728f61" [[package]] name = "bs58" @@ -537,7 +551,7 @@ dependencies = [ [[package]] name = "c-kzg" version = "0.1.0" -source = "git+https://github.com/ethereum/c-kzg-4844#9d85ed8b194eee2a70380e58b6c45909f75933ea" +source = "git+https://github.com/ethereum/c-kzg-4844#3ce8f863415ac1b218bc7d63cc14778b570aa081" dependencies = [ "bindgen 0.64.0", "cc", @@ -646,7 +660,7 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "codecs-derive" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "convert_case 0.6.0", "parity-scale-codec", @@ -1006,6 +1020,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +[[package]] +name = "dyn-clone" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" + [[package]] name = "ecdsa" version = "0.16.7" @@ -1473,6 +1493,7 @@ dependencies = [ "reth-provider", "reth-revm", "reth-revm-primitives", + "reth-transaction-pool", "tokio", "tokio-stream", "tokio-util", @@ -2114,6 +2135,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indenter" version = "0.3.3" @@ -3169,7 +3209,7 @@ dependencies = [ [[package]] name = "reth-codecs" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "bytes", "codecs-derive", @@ -3179,7 +3219,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "reth-interfaces", "reth-primitives", @@ -3189,7 +3229,7 @@ dependencies = [ [[package]] name = "reth-db" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "bytes", "derive_more", @@ -3216,7 +3256,7 @@ dependencies = [ [[package]] name = "reth-ecies" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "aes", "block-padding", @@ -3247,7 +3287,7 @@ dependencies = [ [[package]] name = "reth-eth-wire" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "async-trait", "bytes", @@ -3272,7 +3312,7 @@ dependencies = [ [[package]] name = "reth-interfaces" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "async-trait", "auto_impl", @@ -3296,7 +3336,7 @@ dependencies = [ [[package]] name = "reth-libmdbx" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "bitflags 2.3.3", "byteorder", @@ -3311,7 +3351,7 @@ dependencies = [ [[package]] name = "reth-mdbx-sys" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "bindgen 0.65.1", "cc", @@ -3321,7 +3361,7 @@ dependencies = [ [[package]] name = "reth-metrics" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "metrics", "reth-metrics-derive", @@ -3330,7 +3370,7 @@ dependencies = [ [[package]] name = "reth-metrics-derive" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "once_cell", "proc-macro2", @@ -3342,7 +3382,7 @@ dependencies = [ [[package]] name = "reth-net-common" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "pin-project", "reth-primitives", @@ -3352,7 +3392,7 @@ dependencies = [ [[package]] name = "reth-network-api" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "async-trait", "reth-eth-wire", @@ -3366,7 +3406,7 @@ dependencies = [ [[package]] name = "reth-payload-builder" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "futures-util", "reth-interfaces", @@ -3386,7 +3426,7 @@ dependencies = [ [[package]] name = "reth-primitives" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "bytes", "c-kzg", @@ -3429,7 +3469,7 @@ dependencies = [ [[package]] name = "reth-provider" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "auto_impl", "derive_more", @@ -3449,7 +3489,7 @@ dependencies = [ [[package]] name = "reth-revm" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "reth-consensus-common", "reth-interfaces", @@ -3464,7 +3504,7 @@ dependencies = [ [[package]] name = "reth-revm-inspectors" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "boa_engine", "boa_gc", @@ -3481,7 +3521,7 @@ dependencies = [ [[package]] name = "reth-revm-primitives" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "reth-primitives", "revm", @@ -3490,7 +3530,7 @@ dependencies = [ [[package]] name = "reth-rlp" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "arrayvec", "auto_impl", @@ -3505,7 +3545,7 @@ dependencies = [ [[package]] name = "reth-rlp-derive" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "proc-macro2", "quote", @@ -3515,7 +3555,7 @@ dependencies = [ [[package]] name = "reth-rpc-types" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "itertools 0.11.0", "jsonrpsee-types", @@ -3526,10 +3566,49 @@ dependencies = [ "thiserror", ] +[[package]] +name = "reth-tasks" +version = "0.1.0-alpha.6" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" +dependencies = [ + "dyn-clone", + "futures-util", + "reth-metrics", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "reth-transaction-pool" +version = "0.1.0-alpha.6" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" +dependencies = [ + "aquamarine", + "async-trait", + "auto_impl", + "bitflags 1.3.2", + "fnv", + "futures-util", + "parking_lot", + "reth-interfaces", + "reth-metrics", + "reth-primitives", + "reth-provider", + "reth-rlp", + "reth-tasks", + "serde", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "reth-trie" version = "0.1.0-alpha.6" -source = "git+https://github.com/paradigmxyz/reth.git#500b0fac135fe07635d871d64467326599e2b27e" +source = "git+https://github.com/paradigmxyz/reth.git#1c23075edbdb2d49b3759935aa7bece792c2e3e4" dependencies = [ "derive_more", "hex", diff --git a/Cargo.toml b/Cargo.toml index eb781b6..b216eed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", package = " reth-provider = { git = "https://github.com/paradigmxyz/reth.git", package = "reth-provider", version = "0.1.0-alpha.6" } reth-revm = { git = "https://github.com/paradigmxyz/reth.git", package = "reth-revm", version = "0.1.0-alpha.6" } reth-revm-primitives = { git = "https://github.com/paradigmxyz/reth.git", package = "reth-revm-primitives", version = "0.1.0-alpha.6" } +reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", package = "reth-transaction-pool", version = "0.1.0-alpha.6" } tokio = "1.29.1" tokio-stream = { version = "0.1.14", features = ["sync"] } tokio-util = { version = "0.7.8", features = ["time"] } diff --git a/src/builder.rs b/src/builder.rs index 2d9add5..280e4d7 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1,5 +1,6 @@ use std::collections::{HashMap, HashSet, VecDeque}; use std::future::Future; +use std::matches; use std::ops::RangeInclusive; use std::pin::Pin; use std::sync::{Arc, Mutex}; @@ -14,8 +15,8 @@ use reth_payload_builder::{ }; use reth_primitives::{ constants::{BEACON_NONCE, EMPTY_OMMER_ROOT}, - proofs, Block, BlockNumber, ChainSpec, Header, Receipt, SealedBlock, SealedHeader, - TransactionSigned, TransactionSignedEcRecovered, U256, + proofs, Block, BlockNumber, ChainSpec, Header, IntoRecoveredTransaction, Receipt, SealedBlock, + SealedHeader, TransactionSigned, TransactionSignedEcRecovered, U256, }; use reth_provider::{ BlockReaderIdExt, CanonStateNotification, PostState, StateProvider, StateProviderFactory, @@ -29,10 +30,11 @@ use reth_revm::{ into_reth_log, revm::{ db::{CacheDB, DatabaseRef}, - primitives::{BlockEnv, CfgEnv, Env, ResultAndState, B160}, + primitives::{BlockEnv, CfgEnv, EVMError, Env, InvalidTransaction, ResultAndState, B160}, EVM, }, }; +use reth_transaction_pool::TransactionPool; use tokio::{ sync::{broadcast, mpsc, oneshot}, task, @@ -113,9 +115,10 @@ struct JobConfig { } /// a build job scoped to `config` -pub struct Job { +pub struct Job { config: JobConfig, client: Arc, + pool: Arc, bundles: HashMap, incoming: Fuse>, invalidated: Fuse>, @@ -123,10 +126,11 @@ pub struct Job { pending_payloads: VecDeque>>, } -impl Job { +impl Job { fn new>( config: JobConfig, client: Arc, + pool: Arc, bundles: I, incoming: Fuse>, invalidated: Fuse>, @@ -140,6 +144,7 @@ impl Job { Self { config, client, + pool, bundles, invalidated, incoming, @@ -149,9 +154,10 @@ impl Job { } } -impl Future for Job +impl Future for Job where Client: StateProviderFactory + 'static, + Pool: TransactionPool + 'static, { type Output = Result<(), PayloadBuilderError>; @@ -209,9 +215,10 @@ where } let client = Arc::clone(&this.client); + let pool = Arc::clone(&this.pool); let pending = task::spawn_blocking(move || { // TODO: come back to this - build(config, client, bundles.into_iter()) + build(config, client, pool, bundles.into_iter()) }); this.pending_payloads.push_back(pending); @@ -273,9 +280,10 @@ impl Future for PayloadTask { } } -impl PayloadJob for Job +impl PayloadJob for Job where Client: StateProviderFactory + Send + Sync + 'static, + Pool: TransactionPool + 'static, { type ResolvePayloadFuture = PayloadTask; @@ -287,6 +295,7 @@ where let empty = build( self.config.clone(), Arc::clone(&self.client), + Arc::clone(&self.pool), None.into_iter(), )?; Ok(empty.inner) @@ -300,8 +309,9 @@ where let (tx, rx) = oneshot::channel(); let config = self.config.clone(); let client = Arc::clone(&self.client); + let pool = Arc::clone(&self.pool); task::spawn_blocking(move || { - let payload = build(config, client, None.into_iter()); + let payload = build(config, client, pool, None.into_iter()); let _ = tx.send(payload); }); @@ -320,22 +330,25 @@ where } } -pub struct Builder { +pub struct Builder { chain: Arc, client: Arc, + pool: Arc, extra_data: u128, bundle_pool: Arc>, incoming: broadcast::Sender<(BundleId, BlockNumber, BundleCompact)>, invalidated: broadcast::Sender, } -impl Builder +impl Builder where Client: StateProviderFactory + Unpin, + Pool: TransactionPool + Unpin, { - pub fn new(chain: ChainSpec, extra_data: u128, client: Client) -> Self { + pub fn new(chain: ChainSpec, extra_data: u128, client: Client, pool: Pool) -> Self { let chain = Arc::new(chain); let client = Arc::new(client); + let pool = Arc::new(pool); let (incoming, _) = broadcast::channel(256); let (invalidated, _) = broadcast::channel(256); @@ -345,6 +358,7 @@ where Self { chain, client, + pool, extra_data, bundle_pool, incoming, @@ -413,11 +427,12 @@ where } } -impl PayloadJobGenerator for Builder +impl PayloadJobGenerator for Builder where Client: StateProviderFactory + BlockReaderIdExt + 'static, + Pool: TransactionPool + 'static, { - type Job = Job; + type Job = Job; fn new_payload_job( &self, @@ -459,6 +474,7 @@ where Ok(Job::new( config, Arc::clone(&self.client), + Arc::clone(&self.pool), bundles.into_iter(), incoming, invalidated, @@ -466,21 +482,33 @@ where } } -fn build>( +fn build( config: JobConfig, client: Arc, + pool: P, bundles: I, -) -> Result { +) -> Result +where + Client: StateProviderFactory, + P: TransactionPool, + I: Iterator, +{ let state = client.state_by_block_hash(config.parent.hash)?; let state = State::new(state); - build_on_state(config, state, bundles) + build_on_state(config, state, pool, bundles) } -fn build_on_state>( +fn build_on_state( config: JobConfig, state: State, + pool: P, bundles: I, -) -> Result { +) -> Result +where + S: StateProvider, + P: TransactionPool, + I: Iterator, +{ let state = Arc::new(state); let mut db = CacheDB::new(Arc::clone(&state)); @@ -490,6 +518,7 @@ fn build_on_state(); + let base_fee = block_env.basefee.to::(); let block_gas_limit: u64 = block_env.gas_limit.try_into().unwrap_or(u64::MAX); let mut coinbase_payment = U256::ZERO; @@ -497,6 +526,7 @@ fn build_on_state block_gas_limit { + continue; + } + + let recovered_tx = tx.to_recovered_transaction(); + + // NOTE: we do not need to clone the DB here as we do for bundle execution + match execute( + &mut db, + &cfg_env, + &block_env, + cumulative_gas_used, + Some(recovered_tx.clone()).into_iter(), + ) { + Ok(execution) => { + coinbase_payment += execution.coinbase_payment; + cumulative_gas_used = execution.cumulative_gas_used; + txs.push(recovered_tx); + post_state.extend(execution.post_state); + } + // if we have any transaction error other than the nonce being too low, then we mark + // the transaction invalid + Err(PayloadBuilderError::EvmExecutionError(EVMError::Transaction(err))) => { + if !matches!(err, InvalidTransaction::NonceTooLow { .. }) { + mempool_txs.mark_invalid(&tx); + } + } + // treat any other errors as fatal + Err(err) => return Err(err), + } + } + // NOTE: here we assume post-shanghai let balance_increments = post_block_withdrawals_balance_increments( &config.chain,