diff --git a/Cargo.toml b/Cargo.toml index cd9d30f..743c9f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -119,68 +119,68 @@ priority-queue = "2.0.0" rand = "0.9" # Alloy dependencies -alloy-origin = { version = "1.0.41", package = "alloy", features = [ +alloy-origin = { version = "1.5.2", package = "alloy", features = [ "k256", "rpc-types-mev", ] } -alloy-evm = "0.23.0" -alloy-serde = "1.0.41" -alloy-json-rpc = "1.0.41" +alloy-evm = { version = "0.27.0", features = ["op"] } +alloy-serde = "1.5.2" +alloy-json-rpc = "1.5.2" # Reth dependencies -reth-origin = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", package = "reth" } -reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-rpc-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", features = [ +reth-origin = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", package = "reth" } +reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-rpc-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", features = [ "node", "evm", ] } -reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-metrics = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-ipc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-network = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-node-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } +reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-metrics = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-ipc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-network = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-node-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } +reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2" } # Revm dependencies -revm-database = "9.0" +revm-database = "10.0" # Reth-optimism dependencies (optional) -op-alloy = { version = "0.22.4", features = ["full"], optional = true } -op-alloy-rpc-types-engine = { version = "0.22.4", default-features = false, optional = true } +op-alloy = { version = "0.23.1", features = ["full"], optional = true } +op-alloy-rpc-types-engine = { version = "0.23.1", default-features = false, optional = true } op-alloy-flz = "0.13.1" -reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-optimism-txpool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } -reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true } +reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-optimism-txpool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } +reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.10.2", optional = true } # test-utils rblib-tests-macros = { path = "src/test_utils/macros", optional = true } jsonrpsee-core = { version = "0.26.0", optional = true, features = ["client"] } nanoid = { version = "0.4", optional = true } -alloy-genesis = { version = "1.0", default-features = false, optional = true } +alloy-genesis = { version = "1.5.2", default-features = false, optional = true } ctor = { version = "0.5", optional = true } tracing-subscriber = { version = "0.3.20", features = [ "env-filter", diff --git a/src/payload/exec.rs b/src/payload/exec.rs index d914d9d..a0f92c7 100644 --- a/src/payload/exec.rs +++ b/src/payload/exec.rs @@ -1,5 +1,5 @@ use { - crate::{alloy, prelude::*, reth}, + crate::{alloy, prelude::*, reth, revm::database::bal::EvmDatabaseError}, alloy::{ consensus::{crypto::RecoveryError, transaction::TxHashRef}, evm::revm::context::result::ExecutionResult as RevmExecutionResult, @@ -31,16 +31,18 @@ use { std::fmt::Debug, }; +type DbError = EvmDatabaseError; + #[derive(Debug, thiserror::Error)] pub enum ExecutionError { #[error("Invalid signature: {0}")] InvalidSignature(#[from] RecoveryError), #[error("Invalid transaction: {0}")] - InvalidTransaction(types::EvmError), + InvalidTransaction(types::EvmError), #[error("Invalid transaction {0} cannot be dropped from bundle: {1}")] - InvalidBundleTransaction(TxHash, types::EvmError), + InvalidBundleTransaction(TxHash, types::EvmError), #[error("Transaction {0} in the bundle is not allowed to revert.")] BundleTransactionReverted(TxHash, Option>), @@ -106,7 +108,7 @@ impl Executable

{ block: &BlockContext

, db: &DB, _ctx: &P::CheckpointContext, - ) -> Result, types::EvmError> + ) -> Result, types::EvmError> where DB: DatabaseRef + Debug, { diff --git a/src/payload/ext/cached_state.rs b/src/payload/ext/cached_state.rs index d957b26..aeb3791 100644 --- a/src/payload/ext/cached_state.rs +++ b/src/payload/ext/cached_state.rs @@ -46,6 +46,8 @@ pub struct CachedStateProvider { caches: ExecutionCache, } +unsafe impl Sync for CachedStateProvider {} + impl CachedStateProvider where S: StateProvider, diff --git a/src/platform/ethereum/mod.rs b/src/platform/ethereum/mod.rs index 9be5df7..07b4685 100644 --- a/src/platform/ethereum/mod.rs +++ b/src/platform/ethereum/mod.rs @@ -1,7 +1,7 @@ use { super::*, crate::{ - alloy::consensus::BlockHeader, + alloy::{consensus::BlockHeader, primitives::Bytes}, reth::{ ethereum::{evm::EthEvmConfig, node::EthereumNode}, evm::NextBlockEnvAttributes, @@ -56,6 +56,7 @@ impl Platform for Ethereum { gas_limit: EthereumBuilderConfig::new().gas_limit(parent.gas_limit()), parent_beacon_block_root: attributes.parent_beacon_block_root, withdrawals: Some(attributes.withdrawals.clone()), + extra_data: Bytes::default(), }) } diff --git a/src/platform/ethereum/pool.rs b/src/platform/ethereum/pool.rs index 6d9a5d2..21d7dbb 100644 --- a/src/platform/ethereum/pool.rs +++ b/src/platform/ethereum/pool.rs @@ -43,7 +43,7 @@ impl BestTransactions for FixedTransactions

{ fn set_skip_blobs(&mut self, _: bool) {} - fn mark_invalid(&mut self, tx: &Self::Item, _: InvalidPoolTransactionError) { + fn mark_invalid(&mut self, tx: &Self::Item, _: &InvalidPoolTransactionError) { match self.invalid.entry(tx.transaction_id.sender) { Entry::Vacant(e) => { e.insert(tx.transaction_id); diff --git a/src/pool/native.rs b/src/pool/native.rs index 4c083e7..f96632d 100644 --- a/src/pool/native.rs +++ b/src/pool/native.rs @@ -84,12 +84,6 @@ struct TransactionPoolVTable { ) -> Pin< Box>> + Send>, >, - add_transactions_with_origins: fn( - *const u8, - Vec<(TransactionOrigin, P::PooledTransaction)>, - ) -> Pin< - Box>> + Send>, - >, transaction_event_listener: fn(*const u8, TxHash) -> Option, all_transactions_event_listener: @@ -248,6 +242,11 @@ struct TransactionPoolVTable { *const u8, &[B256], ) -> Result>, BlobStoreError>, + get_blobs_for_versioned_hashes_v3: + fn( + *const u8, + &[B256], + ) -> Result>, BlobStoreError>, pending_and_queued_txn_count: fn(*const u8) -> (usize, usize), } @@ -289,10 +288,6 @@ impl TransactionPoolVTable

{ let pool = unsafe { &*self_ptr.cast::() }; pool.add_transactions(origin, txs).boxed() }, - add_transactions_with_origins: |self_ptr: *const u8, txs| { - let pool = unsafe { &*self_ptr.cast::() }; - pool.add_transactions_with_origins(txs).boxed() - }, transaction_event_listener: |self_ptr: *const u8, tx_hash| { let pool = unsafe { &*self_ptr.cast::() }; pool.transaction_event_listener(tx_hash) @@ -454,6 +449,11 @@ impl TransactionPoolVTable

{ let pool = unsafe { &*self_ptr.cast::() }; pool.get_blobs_for_versioned_hashes_v2(versioned_hashes) }, + get_blobs_for_versioned_hashes_v3: + |self_ptr: *const u8, versioned_hashes| { + let pool = unsafe { &*self_ptr.cast::() }; + pool.get_blobs_for_versioned_hashes_v3(versioned_hashes) + }, pending_and_queued_txn_count: |self_ptr: *const u8| { let pool = unsafe { &*self_ptr.cast::() }; pool.pending_and_queued_txn_count() @@ -531,21 +531,6 @@ impl RethTransactionPoolTrait for NativeTransactionPool

{ (self.vtable.add_transactions)(self.vtable.self_ptr, origin, transactions) } - /// Adds multiple _unvalidated_ transactions with individual origins. - /// - /// Each transaction can have its own [`TransactionOrigin`]. - /// - /// Consumer: RPC - fn add_transactions_with_origins( - &self, - transactions: Vec<(TransactionOrigin, Self::Transaction)>, - ) -> impl Future>> + Send { - (self.vtable.add_transactions_with_origins)( - self.vtable.self_ptr, - transactions, - ) - } - /// Returns a new transaction change event stream for the given transaction. /// /// Returns `None` if the transaction is not in the pool. @@ -1033,6 +1018,16 @@ impl RethTransactionPoolTrait for NativeTransactionPool

{ ) } + fn get_blobs_for_versioned_hashes_v3( + &self, + versioned_hashes: &[B256], + ) -> Result>, BlobStoreError> { + (self.vtable.get_blobs_for_versioned_hashes_v3)( + self.vtable.self_ptr, + versioned_hashes, + ) + } + /// Returns the number of transactions that are ready for inclusion in the /// next block and the number of transactions that are ready for inclusion in /// future blocks: `(pending, queued)`. diff --git a/src/test_utils/node.rs b/src/test_utils/node.rs index 7aba8f9..45edf60 100644 --- a/src/test_utils/node.rs +++ b/src/test_utils/node.rs @@ -487,6 +487,8 @@ where .parse() .expect("Failed to parse data dir path"), static_files_path: None, + pprof_dumps_path: None, + rocksdb_path: None, }; let db_path = datadir