diff --git a/Cargo.lock b/Cargo.lock index 021d092ca744..77281acdc1c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9872,26 +9872,17 @@ dependencies = [ "alloy-rlp", "flate2", "futures-util", - "reth-beacon-consensus", "reth-chainspec", "reth-consensus", - "reth-engine-primitives", "reth-evm", "reth-execution-errors", - "reth-execution-types", - "reth-network-p2p", - "reth-network-peers", "reth-primitives", "reth-provider", "reth-revm", "reth-rpc-types", "reth-rpc-types-compat", - "reth-stages-api", - "reth-tokio-util", "reth-transaction-pool", - "taiko-reth-evm", "tokio", - "tokio-stream", "tracing", ] diff --git a/crates/taiko/consensus/consensus/src/lib.rs b/crates/taiko/consensus/consensus/src/lib.rs index 21533f784d7b..7d2ef9a931fc 100644 --- a/crates/taiko/consensus/consensus/src/lib.rs +++ b/crates/taiko/consensus/consensus/src/lib.rs @@ -8,7 +8,7 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -use reth_chainspec::{Chain, ChainSpec, Hardfork}; +use reth_chainspec::ChainSpec; use reth_consensus::{Consensus, ConsensusError, PostExecutionInput}; use reth_consensus_common::validation::{ validate_4844_header_standalone, validate_against_parent_4844, diff --git a/crates/taiko/consensus/proposer/Cargo.toml b/crates/taiko/consensus/proposer/Cargo.toml index ce1ccb41b803..41d3ae0b35f5 100644 --- a/crates/taiko/consensus/proposer/Cargo.toml +++ b/crates/taiko/consensus/proposer/Cargo.toml @@ -14,30 +14,20 @@ workspace = true [dependencies] # reth reth-chainspec.workspace = true -reth-beacon-consensus.workspace = true reth-primitives.workspace = true reth-execution-errors.workspace = true -reth-execution-types.workspace = true -reth-network-p2p.workspace = true reth-provider.workspace = true -reth-stages-api.workspace = true reth-revm.workspace = true reth-transaction-pool.workspace = true reth-evm.workspace = true -reth-engine-primitives.workspace = true reth-consensus.workspace = true reth-rpc-types.workspace = true -reth-network-peers.workspace = true -reth-tokio-util.workspace = true reth-rpc-types-compat.workspace = true -# taiko -taiko-reth-evm.workspace = true # async futures-util.workspace = true tokio = { workspace = true, features = ["sync", "time"] } -tokio-stream.workspace = true tracing.workspace = true # misc diff --git a/crates/taiko/consensus/proposer/src/client.rs b/crates/taiko/consensus/proposer/src/client.rs index 65958bbea892..e849027ec68c 100644 --- a/crates/taiko/consensus/proposer/src/client.rs +++ b/crates/taiko/consensus/proposer/src/client.rs @@ -1,6 +1,6 @@ //! This includes download client implementations for auto sealing miners. -use crate::{TriggerArgs, TriggerResult}; +use crate::{TaskArgs, TaskResult}; use reth_execution_errors::BlockExecutionError; use reth_primitives::Address; use std::fmt::Debug; @@ -13,11 +13,11 @@ use tokio::sync::{mpsc::UnboundedSender, oneshot}; /// blocks in memory. #[derive(Debug, Clone)] pub struct ProposerClient { - trigger_args_tx: UnboundedSender<TriggerArgs>, + trigger_args_tx: UnboundedSender<TaskArgs>, } impl ProposerClient { - pub(crate) const fn new(trigger_args_tx: UnboundedSender<TriggerArgs>) -> Self { + pub(crate) const fn new(trigger_args_tx: UnboundedSender<TaskArgs>) -> Self { Self { trigger_args_tx } } @@ -32,10 +32,10 @@ impl ProposerClient { local_accounts: Vec<Address>, max_transactions_lists: u64, min_tip: u64, - ) -> Result<Vec<TriggerResult>, BlockExecutionError> { + ) -> Result<Vec<TaskResult>, BlockExecutionError> { let (tx, rx) = oneshot::channel(); self.trigger_args_tx - .send(TriggerArgs { + .send(TaskArgs { beneficiary, base_fee, block_max_gas_limit, diff --git a/crates/taiko/consensus/proposer/src/lib.rs b/crates/taiko/consensus/proposer/src/lib.rs index 6d926da8c2a8..c57f12388a23 100644 --- a/crates/taiko/consensus/proposer/src/lib.rs +++ b/crates/taiko/consensus/proposer/src/lib.rs @@ -139,7 +139,7 @@ where /// Arguments for the trigger #[derive(Debug)] -pub struct TriggerArgs { +pub struct TaskArgs { /// Address of the beneficiary pub beneficiary: Address, /// Base fee @@ -155,12 +155,12 @@ pub struct TriggerArgs { /// Minimum tip pub min_tip: u64, - tx: oneshot::Sender<Result<Vec<TriggerResult>, BlockExecutionError>>, + tx: oneshot::Sender<Result<Vec<TaskResult>, BlockExecutionError>>, } /// Result of the trigger #[derive(Debug)] -pub struct TriggerResult { +pub struct TaskResult { /// Transactions pub txs: Vec<Transaction>, /// Estimated gas used @@ -266,7 +266,7 @@ impl Storage { max_bytes_per_tx_list: u64, max_transactions_lists: u64, base_fee: u64, - ) -> Result<Vec<TriggerResult>, BlockExecutionError> + ) -> Result<Vec<TaskResult>, BlockExecutionError> where Executor: BlockExecutorProvider, Provider: StateProviderFactory + BlockReaderIdExt, @@ -320,14 +320,14 @@ impl Storage { if idx - chunk_start >= max_transactions_lists as usize || compressed_buf.len() > max_bytes_per_tx_list as usize { - // the first transaction is too large, so we need to split it + // the first transaction in chunk is too large, so we need to skip it if idx == chunk_start { gas_used_start = receipts[idx].cumulative_gas_used; chunk_start += 1; None } else { - // next chunk if reach the max_transactions_lists or max_bytes_per_tx_list - // and use previous transaction's status + // current chunk reaches the max_transactions_lists or max_bytes_per_tx_list + // and use previous transaction's data let estimated_gas_used = receipts[idx - 1].cumulative_gas_used - gas_used_start; gas_used_start = receipts[idx - 1].cumulative_gas_used; @@ -340,7 +340,7 @@ impl Storage { None } } { - tx_lists.push(TriggerResult { + tx_lists.push(TaskResult { txs: body[txs_range] .iter() .cloned() diff --git a/crates/taiko/consensus/proposer/src/task.rs b/crates/taiko/consensus/proposer/src/task.rs index 0fa18fd5cfd0..a223b3afaf2b 100644 --- a/crates/taiko/consensus/proposer/src/task.rs +++ b/crates/taiko/consensus/proposer/src/task.rs @@ -1,4 +1,4 @@ -use crate::{Storage, TriggerArgs}; +use crate::{Storage, TaskArgs}; use futures_util::{future::BoxFuture, FutureExt}; use reth_chainspec::ChainSpec; use reth_evm::execute::BlockExecutorProvider; @@ -27,12 +27,12 @@ pub struct ProposerTask<Client, Pool: TransactionPool, Executor> { /// backlog of sets of transactions ready to be mined #[allow(clippy::type_complexity)] queued: VecDeque<( - TriggerArgs, + TaskArgs, Vec<Arc<ValidPoolTransaction<<Pool as TransactionPool>::Transaction>>>, )>, /// The type used for block execution block_executor: Executor, - trigger_args_rx: UnboundedReceiver<TriggerArgs>, + trigger_args_rx: UnboundedReceiver<TaskArgs>, } // === impl MiningTask === @@ -45,7 +45,7 @@ impl<Executor, Client, Pool: TransactionPool> ProposerTask<Client, Pool, Executo client: Client, pool: Pool, block_executor: Executor, - trigger_args_rx: UnboundedReceiver<TriggerArgs>, + trigger_args_rx: UnboundedReceiver<TaskArgs>, ) -> Self { Self { chain_spec, @@ -113,7 +113,7 @@ where .collect(); let ommers = vec![]; - let TriggerArgs { + let TaskArgs { tx, beneficiary, block_max_gas_limit, diff --git a/crates/taiko/evm/Cargo.toml b/crates/taiko/evm/Cargo.toml index 0d47615f6c0f..50fbb7f4b2a6 100644 --- a/crates/taiko/evm/Cargo.toml +++ b/crates/taiko/evm/Cargo.toml @@ -15,7 +15,7 @@ workspace = true reth-chainspec = { workspace = true, features = ["taiko"] } reth-evm.workspace = true reth-primitives = { workspace = true, features = ["taiko"] } -reth-revm.workspace = true +reth-revm = { workspace = true, features = ["taiko"] } reth-prune-types.workspace = true reth-execution-types.workspace = true diff --git a/crates/taiko/evm/src/execute.rs b/crates/taiko/evm/src/execute.rs index 8ef8a37c11d0..60a23713a4a1 100644 --- a/crates/taiko/evm/src/execute.rs +++ b/crates/taiko/evm/src/execute.rs @@ -10,7 +10,7 @@ use reth_evm::{ BatchExecutor, BlockExecutionError, BlockExecutionInput, BlockExecutionOutput, BlockExecutorProvider, BlockValidationError, Executor, ProviderError, }, - ConfigureEvm, ConfigureEvmEnv, + ConfigureEvm, }; use reth_execution_types::ExecutionOutcome; use reth_primitives::{