Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 6 additions & 4 deletions src/payload/exec.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -31,16 +31,18 @@ use {
std::fmt::Debug,
};

type DbError = EvmDatabaseError<ProviderError>;

#[derive(Debug, thiserror::Error)]
pub enum ExecutionError<P: Platform> {
#[error("Invalid signature: {0}")]
InvalidSignature(#[from] RecoveryError),

#[error("Invalid transaction: {0}")]
InvalidTransaction(types::EvmError<P, ProviderError>),
InvalidTransaction(types::EvmError<P, DbError>),

#[error("Invalid transaction {0} cannot be dropped from bundle: {1}")]
InvalidBundleTransaction(TxHash, types::EvmError<P, ProviderError>),
InvalidBundleTransaction(TxHash, types::EvmError<P, DbError>),

#[error("Transaction {0} in the bundle is not allowed to revert.")]
BundleTransactionReverted(TxHash, Option<types::EvmHaltReason<P>>),
Expand Down Expand Up @@ -106,7 +108,7 @@ impl<P: Platform> Executable<P> {
block: &BlockContext<P>,
db: &DB,
_ctx: &P::CheckpointContext,
) -> Result<ExecutionResult<P>, types::EvmError<P, ProviderError>>
) -> Result<ExecutionResult<P>, types::EvmError<P, DbError>>
where
DB: DatabaseRef<Error = ProviderError> + Debug,
{
Expand Down
2 changes: 2 additions & 0 deletions src/payload/ext/cached_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ pub struct CachedStateProvider<S> {
caches: ExecutionCache,
}

unsafe impl<S: Send> Sync for CachedStateProvider<S> {}

impl<S> CachedStateProvider<S>
where
S: StateProvider,
Expand Down
3 changes: 2 additions & 1 deletion src/platform/ethereum/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use {
super::*,
crate::{
alloy::consensus::BlockHeader,
alloy::{consensus::BlockHeader, primitives::Bytes},
reth::{
ethereum::{evm::EthEvmConfig, node::EthereumNode},
evm::NextBlockEnvAttributes,
Expand Down Expand Up @@ -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(),
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform/ethereum/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl<P: Platform> BestTransactions for FixedTransactions<P> {

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);
Expand Down
45 changes: 20 additions & 25 deletions src/pool/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ struct TransactionPoolVTable<P: Platform> {
) -> Pin<
Box<dyn Future<Output = Vec<PoolResult<AddedTransactionOutcome>>> + Send>,
>,
add_transactions_with_origins: fn(
*const u8,
Vec<(TransactionOrigin, P::PooledTransaction)>,
) -> Pin<
Box<dyn Future<Output = Vec<PoolResult<AddedTransactionOutcome>>> + Send>,
>,
transaction_event_listener:
fn(*const u8, TxHash) -> Option<TransactionEvents>,
all_transactions_event_listener:
Expand Down Expand Up @@ -248,6 +242,11 @@ struct TransactionPoolVTable<P: Platform> {
*const u8,
&[B256],
) -> Result<Option<Vec<BlobAndProofV2>>, BlobStoreError>,
get_blobs_for_versioned_hashes_v3:
fn(
*const u8,
&[B256],
) -> Result<Vec<Option<BlobAndProofV2>>, BlobStoreError>,
pending_and_queued_txn_count: fn(*const u8) -> (usize, usize),
}

Expand Down Expand Up @@ -289,10 +288,6 @@ impl<P: Platform> TransactionPoolVTable<P> {
let pool = unsafe { &*self_ptr.cast::<Pool>() };
pool.add_transactions(origin, txs).boxed()
},
add_transactions_with_origins: |self_ptr: *const u8, txs| {
let pool = unsafe { &*self_ptr.cast::<Pool>() };
pool.add_transactions_with_origins(txs).boxed()
},
transaction_event_listener: |self_ptr: *const u8, tx_hash| {
let pool = unsafe { &*self_ptr.cast::<Pool>() };
pool.transaction_event_listener(tx_hash)
Expand Down Expand Up @@ -454,6 +449,11 @@ impl<P: Platform> TransactionPoolVTable<P> {
let pool = unsafe { &*self_ptr.cast::<Pool>() };
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>() };
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>() };
pool.pending_and_queued_txn_count()
Expand Down Expand Up @@ -531,21 +531,6 @@ impl<P: Platform> RethTransactionPoolTrait for NativeTransactionPool<P> {
(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<Output = Vec<PoolResult<AddedTransactionOutcome>>> + 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.
Expand Down Expand Up @@ -1033,6 +1018,16 @@ impl<P: Platform> RethTransactionPoolTrait for NativeTransactionPool<P> {
)
}

fn get_blobs_for_versioned_hashes_v3(
&self,
versioned_hashes: &[B256],
) -> Result<Vec<Option<BlobAndProofV2>>, 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)`.
Expand Down
2 changes: 2 additions & 0 deletions src/test_utils/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading