⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
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
487 changes: 13 additions & 474 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ base-txpool = { path = "crates/client/txpool" }
base-flashblocks = { path = "crates/client/flashblocks" }

# reth
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-ipc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-exex = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
Expand Down
2 changes: 0 additions & 2 deletions crates/builder/op-rbuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ p2p = { path = "../p2p" }
base-bundles.workspace = true
base-flashtypes.workspace = true

reth.workspace = true
reth-optimism-node.workspace = true
reth-optimism-cli.workspace = true
reth-optimism-chainspec.workspace = true
Expand Down Expand Up @@ -184,7 +183,6 @@ jemalloc = [
jemalloc-prof = [
"jemalloc",
"reth-cli-util/jemalloc-prof",
"reth/jemalloc-prof",
"tikv-jemallocator?/profiling",
]

Expand Down
2 changes: 1 addition & 1 deletion crates/builder/op-rbuilder/src/builders/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use alloy_rpc_types_eth::Withdrawals;
use core::fmt::Debug;
use op_alloy_consensus::OpDepositReceipt;
use op_revm::OpSpecId;
use reth::payload::PayloadBuilderAttributes;
use reth_basic_payload_builder::PayloadConfig;
use reth_chainspec::{EthChainSpec, EthereumHardforks};
use reth_evm::{
Expand All @@ -30,6 +29,7 @@ use reth_optimism_txpool::{
interop::{MaybeInteropTransaction, is_valid_interop},
};
use reth_payload_builder::PayloadId;
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_primitives::SealedHeader;
use reth_primitives_traits::{InMemorySize, SignedTransaction};
use reth_revm::{State, context::Block};
Expand Down
3 changes: 2 additions & 1 deletion crates/builder/op-rbuilder/src/builders/flashblocks/p2p.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use alloy_primitives::U256;
use reth::{core::primitives::SealedBlock, payload::PayloadId};
use reth_optimism_payload_builder::OpBuiltPayload as RethOpBuiltPayload;
use reth_optimism_primitives::OpBlock;
use reth_payload_builder::PayloadId;
use reth_primitives_traits::SealedBlock;
use serde::{Deserialize, Serialize};

pub(super) const AGENT_VERSION: &str = "op-rbuilder/1.0.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use alloy_eips::{Encodable2718, eip7685::EMPTY_REQUESTS_HASH, merge::BEACON_NONC
use alloy_primitives::{Address, B256, U256, map::foldhash::HashMap};
use core::time::Duration;
use eyre::WrapErr as _;
use reth::payload::PayloadBuilderAttributes;
use reth_basic_payload_builder::BuildOutcome;
use reth_chain_state::ExecutedBlock;
use reth_chainspec::EthChainSpec;
Expand All @@ -30,11 +29,11 @@ use reth_optimism_evm::{OpEvmConfig, OpNextBlockEnvAttributes};
use reth_optimism_forks::OpHardforks;
use reth_optimism_node::{OpBuiltPayload, OpPayloadBuilderAttributes};
use reth_optimism_primitives::{OpPrimitives, OpReceipt, OpTransactionSigned};
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_payload_util::BestPayloadTransactions;
use reth_primitives_traits::RecoveredBlock;
use reth_provider::{
ExecutionOutcome, HashedPostStateProvider, ProviderError, StateRootProvider,
StorageRootProvider,
ExecutionOutcome, HashedPostStateProvider, ProviderError, StateProvider, StateRootProvider, StorageRootProvider
};
use reth_revm::{
State, database::StateProviderDatabase, db::states::bundle_state::BundleRetention,
Expand Down Expand Up @@ -601,7 +600,7 @@ where
ctx: &OpPayloadBuilderCtx<FlashblocksExtraCtx>,
info: &mut ExecutionInfo<FlashblocksExecutionInfo>,
state: &mut State<DB>,
state_provider: impl reth::providers::StateProvider + Clone,
state_provider: impl StateProvider + Clone,
best_txs: &mut NextBestFlashblocksTxs<Pool>,
block_cancel: &CancellationToken,
best_payload: &BlockCell<OpBuiltPayload>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use alloy_primitives::B64;
use base_flashtypes::FlashblocksPayloadV1;
use eyre::{WrapErr as _, bail};
use op_alloy_consensus::OpTxEnvelope;
use reth::revm::{State, database::StateProviderDatabase};
use reth_basic_payload_builder::PayloadConfig;
use reth_evm::FromRecoveredTx;
use reth_node_builder::Events;
Expand All @@ -20,6 +19,8 @@ use reth_optimism_node::{OpEngineTypes, OpPayloadBuilderAttributes};
use reth_optimism_payload_builder::OpBuiltPayload;
use reth_optimism_primitives::{OpReceipt, OpTransactionSigned};
use reth_payload_builder::EthPayloadBuilderAttributes;
use reth_primitives::SealedHeader;
use reth_revm::{State, cached::CachedReads, database::StateProviderDatabase};
use std::sync::Arc;
use tokio::sync::mpsc;
use tracing::warn;
Expand Down Expand Up @@ -140,14 +141,13 @@ where
Client: ClientBounds,
{
use alloy_consensus::BlockHeader as _;
use reth::primitives::SealedHeader;
use reth_evm::{ConfigureEvm as _, execute::BlockBuilder as _};

let start = tokio::time::Instant::now();

tracing::info!(header = ?payload.block().header(), "executing flashblock");

let mut cached_reads = reth::revm::cached::CachedReads::default();
let mut cached_reads = CachedReads::default();
let parent_hash = payload.block().sealed_header().parent_hash;
let parent_header = client
.header_by_id(parent_hash.into())
Expand Down
9 changes: 3 additions & 6 deletions crates/builder/op-rbuilder/src/builders/generator.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use alloy_primitives::B256;
use futures_util::{Future, FutureExt};
use reth::{
providers::{BlockReaderIdExt, StateProviderFactory},
tasks::TaskSpawner,
};
use reth_basic_payload_builder::{
BasicPayloadJobGeneratorConfig, HeaderForPayload, PayloadConfig, PrecachedState,
};
Expand All @@ -13,8 +9,9 @@ use reth_payload_builder::{
};
use reth_payload_primitives::BuiltPayload;
use reth_primitives_traits::HeaderTy;
use reth_provider::CanonStateNotification;
use reth_provider::{BlockReaderIdExt, CanonStateNotification, StateProviderFactory};
use reth_revm::cached::CachedReads;
use reth_tasks::TaskSpawner;
use std::{
sync::{Arc, Mutex},
time::{SystemTime, UNIX_EPOCH},
Expand Down Expand Up @@ -469,7 +466,7 @@ mod tests {
use alloy_eips::eip7685::Requests;
use alloy_primitives::U256;
use rand::rng;
use reth::tasks::TokioTaskExecutor;
use reth_tasks::TokioTaskExecutor;
use reth_chain_state::ExecutedBlock;
use reth_node_api::NodePrimitives;
use reth_optimism_payload_builder::{OpPayloadPrimitives, payload::OpPayloadBuilderAttributes};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use alloy_consensus::{
use alloy_eips::{eip7685::EMPTY_REQUESTS_HASH, merge::BEACON_NONCE};
use alloy_evm::Database;
use alloy_primitives::U256;
use reth::payload::PayloadBuilderAttributes;
use reth_basic_payload_builder::{BuildOutcome, BuildOutcomeKind, MissingPayloadBehaviour};
use reth_chain_state::ExecutedBlock;
use reth_evm::{ConfigureEvm, execute::BlockBuilder};
Expand All @@ -22,6 +21,7 @@ use reth_optimism_evm::{OpEvmConfig, OpNextBlockEnvAttributes};
use reth_optimism_forks::OpHardforks;
use reth_optimism_node::{OpBuiltPayload, OpPayloadBuilderAttributes};
use reth_optimism_primitives::OpTransactionSigned;
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_payload_util::{BestPayloadTransactions, NoopPayloadTransactions, PayloadTransactions};
use reth_primitives::RecoveredBlock;
use reth_primitives_traits::InMemorySize;
Expand Down
3 changes: 2 additions & 1 deletion crates/builder/op-rbuilder/src/launcher.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use eyre::Result;
use reth_node_builder::WithLaunchContext;
use reth_optimism_rpc::OpEthApiBuilder;

use crate::{
Expand All @@ -13,11 +14,11 @@ use crate::{
};
use core::fmt::Debug;
use moka::future::Cache;
use reth::builder::{NodeBuilder, WithLaunchContext};
use reth_cli_commands::launcher::Launcher;
use reth_db::mdbx::DatabaseEnv;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_cli::chainspec::OpChainSpecParser;
use reth_node_builder::NodeBuilder;
use reth_optimism_node::{
OpNode,
node::{OpAddOns, OpAddOnsBuilder, OpEngineValidatorBuilder, OpPoolBuilder},
Expand Down
2 changes: 1 addition & 1 deletion crates/builder/op-rbuilder/src/mock_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use alloy_eips::{
eip7702::SignedAuthorization,
};
use alloy_primitives::{Address, B256, Bytes, TxHash, TxKind, U256};
use reth::primitives::TransactionSigned;
use reth_primitives::TransactionSigned;
use reth_primitives_traits::{InMemorySize, SignedTransaction};
use reth_transaction_pool::{
EthBlobTransactionSidecar, EthPoolTransaction, PoolTransaction, TransactionOrigin,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! RPC component builder

use reth_node_api::AddOnsContext;
use reth_node_api::{AddOnsContext, NodeTypes};
use reth_node_builder::rpc::{EngineApiBuilder, PayloadValidatorBuilder};
use reth_node_core::version::{CLIENT_CODE, version_metadata};
use reth_optimism_node::OpEngineTypes;
Expand All @@ -22,7 +22,6 @@ use op_alloy_rpc_types_engine::{
OpExecutionPayloadEnvelopeV3, OpExecutionPayloadEnvelopeV4, OpExecutionPayloadV4,
OpPayloadAttributes, ProtocolVersion, SuperchainSignal,
};
use reth::builder::NodeTypes;
use reth_node_api::{EngineApiValidator, EngineTypes};
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_rpc::OpEngineApiServer;
Expand Down
2 changes: 1 addition & 1 deletion crates/builder/op-rbuilder/src/revert_protection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use jsonrpsee::{
proc_macros::rpc,
};
use moka::future::Cache;
use reth::rpc::api::eth::{RpcReceipt, helpers::FullEthApi};
use reth_optimism_txpool::{OpPooledTransaction, conditional::MaybeConditionalTransaction};
use reth_provider::StateProviderFactory;
use reth_rpc_api::eth::{RpcReceipt, helpers::FullEthApi};
use reth_rpc_eth_types::{EthApiError, utils::recover_raw_transaction};
use reth_transaction_pool::{PoolTransaction, TransactionOrigin, TransactionPool};
use tracing::error;
Expand Down
3 changes: 1 addition & 2 deletions crates/builder/op-rbuilder/src/tests/framework/apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ use super::DEFAULT_JWT_TOKEN;
use alloy_eips::{BlockNumberOrTag, eip7685::Requests};
use alloy_primitives::B256;

use alloy_rpc_types_engine::{ForkchoiceUpdated, PayloadStatus};
use alloy_rpc_types_engine::{ForkchoiceState, ForkchoiceUpdated, PayloadStatus};
use core::{future::Future, marker::PhantomData};
use jsonrpsee::{
core::{RpcResult, client::SubscriptionClientT},
proc_macros::rpc,
};
use op_alloy_rpc_types_engine::OpExecutionPayloadV4;
use reth::rpc::types::engine::ForkchoiceState;
use reth_node_api::{EngineTypes, PayloadTypes};
use reth_optimism_node::OpEngineTypes;
use reth_optimism_rpc::engine::OpEngineApiClient;
Expand Down
7 changes: 2 additions & 5 deletions crates/builder/op-rbuilder/src/tests/framework/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ use crate::{
use alloy_primitives::{Address, B256, Bytes, hex, keccak256};
use alloy_provider::{Identity, ProviderBuilder, RootProvider};
use clap::Parser;
use reth_node_core::{args::{DatadirArgs, NetworkArgs, RpcServerArgs}, exit::NodeExitFuture};
use reth_tasks::TaskManager;
use core::{
any::Any,
future::Future,
Expand All @@ -31,11 +33,6 @@ use moka::future::Cache;
use nanoid::nanoid;
use op_alloy_network::Optimism;
use parking_lot::Mutex;
use reth::{
args::{DatadirArgs, NetworkArgs, RpcServerArgs},
core::exit::NodeExitFuture,
tasks::TaskManager,
};
use reth_node_builder::{NodeBuilder, NodeConfig};
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_cli::commands::Commands;
Expand Down
2 changes: 1 addition & 1 deletion crates/builder/op-rbuilder/src/tests/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::tests::{
BlockTransactionsExt, ChainDriverExt, LocalInstance, ONE_ETH, default_node_config,
};
use macros::rb_test;
use reth::args::TxPoolArgs;
use reth_node_builder::NodeConfig;
use reth_node_core::args::TxPoolArgs;
use reth_optimism_chainspec::OpChainSpec;

/// This test ensures that pending pool custom limit is respected and priority tx would be included even when pool if full.
Expand Down
8 changes: 7 additions & 1 deletion crates/client/flashblocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ base-flashtypes.workspace = true
base-client-node.workspace = true

# reth
reth.workspace = true
reth-exex.workspace = true
reth-evm.workspace = true
reth-primitives.workspace = true
Expand All @@ -37,6 +36,10 @@ reth-optimism-rpc.workspace = true
reth-optimism-evm.workspace = true
reth-optimism-chainspec.workspace = true
reth-optimism-primitives.workspace = true
reth-provider.workspace = true
reth-chainspec.workspace = true
reth-revm.workspace = true
reth-rpc-eth-types.workspace = true

# alloy
alloy-eips.workspace = true
Expand All @@ -61,6 +64,9 @@ tokio-stream.workspace = true
# async
futures-util.workspace = true

# revm
revm.workspace = true

# rpc
jsonrpsee.workspace = true
jsonrpsee-types.workspace = true
Expand Down
8 changes: 3 additions & 5 deletions crates/client/flashblocks/benches/pending_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ use base_flashtypes::{
ExecutionPayloadBaseV1, ExecutionPayloadFlashblockDeltaV1, Flashblock, Metadata,
};
use criterion::{BatchSize, Criterion, Throughput, criterion_group, criterion_main};
use reth::{
chainspec::{ChainSpecProvider, EthChainSpec},
providers::BlockReader,
transaction_pool::test_utils::TransactionBuilder,
};
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
use reth_optimism_primitives::{OpBlock, OpTransactionSigned};
use reth_primitives_traits::{Block as BlockT, RecoveredBlock};
use reth_provider::BlockReader;
use reth_transaction_pool::test_utils::TransactionBuilder;
use tokio::{runtime::Runtime, time::sleep};
use tracing_subscriber::{EnvFilter, filter::LevelFilter};

Expand Down
3 changes: 2 additions & 1 deletion crates/client/flashblocks/src/pending_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ use arc_swap::Guard;
use base_flashtypes::Flashblock;
use op_alloy_network::Optimism;
use op_alloy_rpc_types::{OpTransactionReceipt, Transaction};
use reth::revm::{db::BundleState, state::EvmState};
use reth_revm::db::BundleState;
use reth_rpc_convert::RpcTransaction;
use reth_rpc_eth_api::{RpcBlock, RpcReceipt};
use revm::state::EvmState;

use crate::{BuildError, Metrics, PendingBlocksAPI, StateProcessorError};

Expand Down
8 changes: 3 additions & 5 deletions crates/client/flashblocks/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ use base_flashtypes::Flashblock;
use op_alloy_consensus::OpTxEnvelope;
use op_alloy_network::TransactionResponse;
use rayon::prelude::*;
use reth::{
chainspec::{ChainSpecProvider, EthChainSpec},
providers::{BlockReaderIdExt, StateProviderFactory},
revm::{State, database::StateProviderDatabase},
};
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
use reth_evm::ConfigureEvm;
use reth_optimism_chainspec::OpHardforks;
use reth_optimism_evm::{OpEvmConfig, OpNextBlockEnvAttributes};
use reth_optimism_primitives::OpBlock;
use reth_primitives::RecoveredBlock;
use reth_provider::{BlockReaderIdExt, StateProviderFactory};
use reth_revm::{State, database::StateProviderDatabase};
use revm_database::states::bundle_state::BundleRetention;
use tokio::sync::{Mutex, broadcast::Sender, mpsc::UnboundedReceiver};

Expand Down
7 changes: 3 additions & 4 deletions crates/client/flashblocks/src/rpc/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ use jsonrpsee::{
use jsonrpsee_types::{ErrorObjectOwned, error::INVALID_PARAMS_CODE};
use op_alloy_network::Optimism;
use op_alloy_rpc_types::OpTransactionRequest;
use reth::{
providers::CanonStateSubscriptions,
rpc::{eth::EthFilter, server_types::eth::EthApiError},
};
use reth_provider::CanonStateSubscriptions;
use reth_rpc::eth::EthFilter;
use reth_rpc_eth_api::{
EthApiTypes, EthFilterApiServer, RpcBlock, RpcReceipt, RpcTransaction,
helpers::{EthBlocks, EthCall, EthState, EthTransactions, FullEthApi},
};
use reth_rpc_eth_types::EthApiError;
use tokio::{sync::broadcast::error::RecvError, time};
use tokio_stream::{StreamExt, wrappers::BroadcastStream};
use tracing::{debug, trace, warn};
Expand Down
6 changes: 2 additions & 4 deletions crates/client/flashblocks/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ use std::sync::Arc;
use alloy_consensus::Header;
use arc_swap::{ArcSwapOption, Guard};
use base_flashtypes::Flashblock;
use reth::{
chainspec::{ChainSpecProvider, EthChainSpec},
providers::{BlockReaderIdExt, StateProviderFactory},
};
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
use reth_optimism_chainspec::OpHardforks;
use reth_optimism_primitives::OpBlock;
use reth_primitives::RecoveredBlock;
use reth_provider::{BlockReaderIdExt, StateProviderFactory};
use tokio::sync::{
Mutex,
broadcast::{self, Sender},
Expand Down
2 changes: 1 addition & 1 deletion crates/client/flashblocks/src/state_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use alloy_rpc_types::TransactionTrait;
use alloy_rpc_types_eth::state::StateOverride;
use op_alloy_consensus::{OpDepositReceipt, OpTxEnvelope};
use op_alloy_rpc_types::{OpTransactionReceipt, Transaction};
use reth::revm::{Database, DatabaseCommit, context::result::ResultAndState, state::EvmState};
use reth_evm::{
Evm, FromRecoveredTx, eth::receipt_builder::ReceiptBuilderCtx, op_revm::L1BlockInfo,
};
Expand All @@ -19,6 +18,7 @@ use reth_optimism_evm::OpRethReceiptBuilder;
use reth_optimism_primitives::OpPrimitives;
use reth_optimism_rpc::OpReceiptBuilder as OpRpcReceiptBuilder;
use reth_rpc_convert::transaction::ConvertReceiptInput;
use revm::{Database, DatabaseCommit, context::result::ResultAndState, state::EvmState};

use crate::{ExecutionError, PendingBlocks, StateProcessorError};

Expand Down
2 changes: 1 addition & 1 deletion crates/client/flashblocks/src/test_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use base_flashtypes::Flashblock;
use derive_more::Deref;
use eyre::Result;
use once_cell::sync::OnceCell;
use reth::providers::CanonStateSubscriptions;
use reth_optimism_chainspec::OpChainSpec;
use reth_provider::CanonStateSubscriptions;
use tokio::sync::{mpsc, oneshot};
use tokio_stream::StreamExt;

Expand Down
Loading
Loading