From c00516c3f964c1435396e29e5ae71070ef43ccdc Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:49:50 +0200 Subject: [PATCH] rpc-types: rm `alloy-rpc-types-engine` reexport (#11206) --- Cargo.lock | 25 +++++++++++-------- crates/consensus/auto-seal/Cargo.toml | 2 +- crates/consensus/auto-seal/src/task.rs | 2 +- crates/consensus/beacon/Cargo.toml | 2 +- crates/consensus/beacon/src/engine/error.rs | 2 +- crates/consensus/beacon/src/engine/event.rs | 2 +- .../consensus/beacon/src/engine/forkchoice.rs | 2 +- crates/consensus/beacon/src/engine/handle.rs | 6 ++--- crates/consensus/beacon/src/engine/message.rs | 8 +++--- crates/consensus/beacon/src/engine/mod.rs | 12 ++++----- .../consensus/beacon/src/engine/test_utils.rs | 6 ++--- crates/consensus/debug-client/Cargo.toml | 2 +- crates/consensus/debug-client/src/client.rs | 9 +++---- crates/engine/local/Cargo.toml | 1 + crates/engine/local/src/service.rs | 4 +-- crates/engine/tree/Cargo.toml | 2 +- crates/engine/tree/src/tree/mod.rs | 11 +++----- crates/engine/util/Cargo.toml | 2 +- crates/engine/util/src/engine_store.rs | 5 +--- crates/engine/util/src/reorg.rs | 7 +++--- crates/engine/util/src/skip_new_payload.rs | 2 +- crates/ethereum/engine-primitives/Cargo.toml | 2 +- crates/ethereum/engine-primitives/src/lib.rs | 11 +++----- .../ethereum/engine-primitives/src/payload.rs | 8 +++--- crates/node/core/src/utils.rs | 2 +- crates/node/core/src/version.rs | 2 +- crates/optimism/node/Cargo.toml | 1 + crates/optimism/node/src/engine.rs | 2 +- crates/optimism/node/tests/e2e/p2p.rs | 2 +- crates/optimism/payload/Cargo.toml | 2 +- crates/optimism/payload/src/payload.rs | 2 +- crates/rpc/rpc-api/Cargo.toml | 2 +- crates/rpc/rpc-api/src/engine.rs | 10 ++++---- crates/rpc/rpc-builder/Cargo.toml | 1 + crates/rpc/rpc-builder/tests/it/auth.rs | 2 +- crates/rpc/rpc-builder/tests/it/utils.rs | 2 +- crates/rpc/rpc-engine-api/Cargo.toml | 1 + crates/rpc/rpc-engine-api/src/engine_api.rs | 14 +++++------ crates/rpc/rpc-engine-api/src/error.rs | 2 +- crates/rpc/rpc-engine-api/src/metrics.rs | 18 ++++++------- crates/rpc/rpc-engine-api/tests/it/payload.rs | 6 ++--- crates/rpc/rpc-server-types/Cargo.toml | 2 +- crates/rpc/rpc-server-types/src/result.rs | 2 +- crates/rpc/rpc-types-compat/Cargo.toml | 2 +- .../rpc-types-compat/src/engine/payload.rs | 16 ++++++------ crates/rpc/rpc-types/Cargo.toml | 6 ----- crates/rpc/rpc-types/src/eth/mod.rs | 4 --- crates/rpc/rpc-types/src/lib.rs | 7 ------ 48 files changed, 111 insertions(+), 134 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35301d322..a624c269a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6244,6 +6244,7 @@ name = "reth-auto-seal-consensus" version = "1.0.7" dependencies = [ "alloy-primitives", + "alloy-rpc-types-engine", "futures-util", "reth-beacon-consensus", "reth-chainspec", @@ -6257,7 +6258,6 @@ dependencies = [ "reth-primitives", "reth-provider", "reth-revm", - "reth-rpc-types", "reth-stages-api", "reth-tokio-util", "reth-transaction-pool", @@ -6297,6 +6297,7 @@ version = "1.0.7" dependencies = [ "alloy-genesis", "alloy-primitives", + "alloy-rpc-types-engine", "assert_matches", "futures", "itertools 0.13.0", @@ -6326,7 +6327,6 @@ dependencies = [ "reth-provider", "reth-prune", "reth-prune-types", - "reth-rpc-types", "reth-rpc-types-compat", "reth-stages", "reth-stages-api", @@ -6654,6 +6654,7 @@ dependencies = [ "alloy-eips", "alloy-provider", "alloy-rpc-types", + "alloy-rpc-types-engine", "auto_impl", "eyre", "futures", @@ -6662,7 +6663,6 @@ dependencies = [ "reth-node-core", "reth-rpc-api", "reth-rpc-builder", - "reth-rpc-types", "reth-tracing", "ringbuffer", "serde", @@ -6968,6 +6968,7 @@ name = "reth-engine-local" version = "1.0.7" dependencies = [ "alloy-primitives", + "alloy-rpc-types-engine", "eyre", "futures-util", "reth-beacon-consensus", @@ -7040,6 +7041,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", + "alloy-rpc-types-engine", "assert_matches", "futures", "metrics", @@ -7066,7 +7068,6 @@ dependencies = [ "reth-prune", "reth-prune-types", "reth-revm", - "reth-rpc-types", "reth-rpc-types-compat", "reth-stages", "reth-stages-api", @@ -7085,6 +7086,7 @@ name = "reth-engine-util" version = "1.0.7" dependencies = [ "alloy-primitives", + "alloy-rpc-types-engine", "eyre", "futures", "itertools 0.13.0", @@ -7099,7 +7101,6 @@ dependencies = [ "reth-primitives", "reth-provider", "reth-revm", - "reth-rpc-types", "reth-rpc-types-compat", "reth-trie", "revm-primitives", @@ -7212,12 +7213,12 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", + "alloy-rpc-types-engine", "reth-chain-state", "reth-chainspec", "reth-engine-primitives", "reth-payload-primitives", "reth-primitives", - "reth-rpc-types", "reth-rpc-types-compat", "serde", "serde_json", @@ -7960,6 +7961,7 @@ version = "1.0.7" dependencies = [ "alloy-genesis", "alloy-primitives", + "alloy-rpc-types-engine", "async-trait", "clap", "eyre", @@ -8106,6 +8108,7 @@ version = "1.0.7" dependencies = [ "alloy-primitives", "alloy-rlp", + "alloy-rpc-types-engine", "op-alloy-rpc-types-engine", "reth-basic-payload-builder", "reth-chain-state", @@ -8119,7 +8122,6 @@ dependencies = [ "reth-primitives", "reth-provider", "reth-revm", - "reth-rpc-types", "reth-rpc-types-compat", "reth-transaction-pool", "reth-trie", @@ -8490,6 +8492,7 @@ dependencies = [ "alloy-rpc-types-anvil", "alloy-rpc-types-beacon", "alloy-rpc-types-debug", + "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-rpc-types-mev", "alloy-rpc-types-trace", @@ -8500,7 +8503,6 @@ dependencies = [ "reth-network-peers", "reth-primitives", "reth-rpc-eth-api", - "reth-rpc-types", "serde_json", ] @@ -8530,6 +8532,7 @@ dependencies = [ "alloy-network", "alloy-primitives", "alloy-rpc-types", + "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-rpc-types-trace", "alloy-serde", @@ -8582,6 +8585,7 @@ dependencies = [ "alloy-eips", "alloy-primitives", "alloy-rlp", + "alloy-rpc-types-engine", "assert_matches", "async-trait", "jsonrpsee-core", @@ -8715,12 +8719,12 @@ name = "reth-rpc-server-types" version = "1.0.7" dependencies = [ "alloy-primitives", + "alloy-rpc-types-engine", "jsonrpsee-core", "jsonrpsee-types", "reth-errors", "reth-network-api", "reth-primitives", - "reth-rpc-types", "serde", "strum", ] @@ -8729,7 +8733,6 @@ dependencies = [ name = "reth-rpc-types" version = "1.0.7" dependencies = [ - "alloy-rpc-types-engine", "jsonrpsee-types", ] @@ -8740,10 +8743,10 @@ dependencies = [ "alloy-primitives", "alloy-rlp", "alloy-rpc-types", + "alloy-rpc-types-engine", "alloy-rpc-types-eth", "alloy-serde", "reth-primitives", - "reth-rpc-types", "reth-trie-common", "serde_json", ] diff --git a/crates/consensus/auto-seal/Cargo.toml b/crates/consensus/auto-seal/Cargo.toml index ca35937a4..d712071a1 100644 --- a/crates/consensus/auto-seal/Cargo.toml +++ b/crates/consensus/auto-seal/Cargo.toml @@ -26,7 +26,6 @@ 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-trie.workspace = true @@ -34,6 +33,7 @@ reth-trie.workspace = true # ethereum alloy-primitives.workspace = true revm-primitives.workspace = true +alloy-rpc-types-engine.workspace = true # async futures-util.workspace = true diff --git a/crates/consensus/auto-seal/src/task.rs b/crates/consensus/auto-seal/src/task.rs index 16c726c7a..8979428be 100644 --- a/crates/consensus/auto-seal/src/task.rs +++ b/crates/consensus/auto-seal/src/task.rs @@ -1,4 +1,5 @@ use crate::{mode::MiningMode, Storage}; +use alloy_rpc_types_engine::ForkchoiceState; use futures_util::{future::BoxFuture, FutureExt}; use reth_beacon_consensus::{BeaconEngineMessage, ForkchoiceStatus}; use reth_chainspec::{EthChainSpec, EthereumHardforks}; @@ -6,7 +7,6 @@ use reth_engine_primitives::EngineTypes; use reth_evm::execute::BlockExecutorProvider; use reth_primitives::IntoRecoveredTransaction; use reth_provider::{CanonChainTracker, StateProviderFactory}; -use reth_rpc_types::engine::ForkchoiceState; use reth_stages_api::PipelineEvent; use reth_tokio_util::EventStream; use reth_transaction_pool::{TransactionPool, ValidPoolTransaction}; diff --git a/crates/consensus/beacon/Cargo.toml b/crates/consensus/beacon/Cargo.toml index 6d3fc798c..f62c6fbf2 100644 --- a/crates/consensus/beacon/Cargo.toml +++ b/crates/consensus/beacon/Cargo.toml @@ -18,7 +18,6 @@ reth-primitives.workspace = true reth-stages-api.workspace = true reth-errors.workspace = true reth-provider.workspace = true -reth-rpc-types.workspace = true reth-tasks.workspace = true reth-payload-builder.workspace = true reth-payload-primitives.workspace = true @@ -32,6 +31,7 @@ reth-node-types.workspace = true # ethereum alloy-primitives.workspace = true +alloy-rpc-types-engine.workspace = true # async tokio = { workspace = true, features = ["sync"] } diff --git a/crates/consensus/beacon/src/engine/error.rs b/crates/consensus/beacon/src/engine/error.rs index 21c697473..4f58b7300 100644 --- a/crates/consensus/beacon/src/engine/error.rs +++ b/crates/consensus/beacon/src/engine/error.rs @@ -1,6 +1,6 @@ use crate::engine::hooks::EngineHookError; +use alloy_rpc_types_engine::ForkchoiceUpdateError; use reth_errors::{DatabaseError, RethError}; -use reth_rpc_types::engine::ForkchoiceUpdateError; use reth_stages_api::PipelineError; /// Beacon engine result. diff --git a/crates/consensus/beacon/src/engine/event.rs b/crates/consensus/beacon/src/engine/event.rs index d617ee4f2..975085a32 100644 --- a/crates/consensus/beacon/src/engine/event.rs +++ b/crates/consensus/beacon/src/engine/event.rs @@ -1,7 +1,7 @@ use crate::engine::forkchoice::ForkchoiceStatus; use alloy_primitives::B256; +use alloy_rpc_types_engine::ForkchoiceState; use reth_primitives::{SealedBlock, SealedHeader}; -use reth_rpc_types::engine::ForkchoiceState; use std::{ fmt::{Display, Formatter, Result}, sync::Arc, diff --git a/crates/consensus/beacon/src/engine/forkchoice.rs b/crates/consensus/beacon/src/engine/forkchoice.rs index f02b12003..975c2ee3b 100644 --- a/crates/consensus/beacon/src/engine/forkchoice.rs +++ b/crates/consensus/beacon/src/engine/forkchoice.rs @@ -1,5 +1,5 @@ use alloy_primitives::B256; -use reth_rpc_types::engine::{ForkchoiceState, PayloadStatusEnum}; +use alloy_rpc_types_engine::{ForkchoiceState, PayloadStatusEnum}; /// The struct that keeps track of the received forkchoice state and their status. #[derive(Debug, Clone, Default)] diff --git a/crates/consensus/beacon/src/engine/handle.rs b/crates/consensus/beacon/src/engine/handle.rs index aee554f82..65b7c38df 100644 --- a/crates/consensus/beacon/src/engine/handle.rs +++ b/crates/consensus/beacon/src/engine/handle.rs @@ -4,12 +4,12 @@ use crate::{ engine::message::OnForkChoiceUpdated, BeaconConsensusEngineEvent, BeaconEngineMessage, BeaconForkChoiceUpdateError, BeaconOnNewPayloadError, }; +use alloy_rpc_types_engine::{ + CancunPayloadFields, ExecutionPayload, ForkchoiceState, ForkchoiceUpdated, PayloadStatus, +}; use futures::TryFutureExt; use reth_engine_primitives::EngineTypes; use reth_errors::RethResult; -use reth_rpc_types::engine::{ - CancunPayloadFields, ExecutionPayload, ForkchoiceState, ForkchoiceUpdated, PayloadStatus, -}; use reth_tokio_util::{EventSender, EventStream}; use tokio::sync::{mpsc::UnboundedSender, oneshot}; diff --git a/crates/consensus/beacon/src/engine/message.rs b/crates/consensus/beacon/src/engine/message.rs index 435f8a313..fdaad0cc4 100644 --- a/crates/consensus/beacon/src/engine/message.rs +++ b/crates/consensus/beacon/src/engine/message.rs @@ -1,12 +1,12 @@ use crate::engine::{error::BeaconOnNewPayloadError, forkchoice::ForkchoiceStatus}; +use alloy_rpc_types_engine::{ + CancunPayloadFields, ExecutionPayload, ForkChoiceUpdateResult, ForkchoiceState, + ForkchoiceUpdateError, ForkchoiceUpdated, PayloadId, PayloadStatus, PayloadStatusEnum, +}; use futures::{future::Either, FutureExt}; use reth_engine_primitives::EngineTypes; use reth_errors::RethResult; use reth_payload_primitives::PayloadBuilderError; -use reth_rpc_types::engine::{ - CancunPayloadFields, ExecutionPayload, ForkChoiceUpdateResult, ForkchoiceState, - ForkchoiceUpdateError, ForkchoiceUpdated, PayloadId, PayloadStatus, PayloadStatusEnum, -}; use std::{ fmt::Display, future::Future, diff --git a/crates/consensus/beacon/src/engine/mod.rs b/crates/consensus/beacon/src/engine/mod.rs index 74515f6c3..3d16dfb65 100644 --- a/crates/consensus/beacon/src/engine/mod.rs +++ b/crates/consensus/beacon/src/engine/mod.rs @@ -1,4 +1,8 @@ use alloy_primitives::{BlockNumber, B256}; +use alloy_rpc_types_engine::{ + CancunPayloadFields, ExecutionPayload, ForkchoiceState, PayloadStatus, PayloadStatusEnum, + PayloadValidationError, +}; use futures::{stream::BoxStream, Future, StreamExt}; use itertools::Either; use reth_blockchain_tree_api::{ @@ -22,10 +26,6 @@ use reth_provider::{ providers::ProviderNodeTypes, BlockIdReader, BlockReader, BlockSource, CanonChainTracker, ChainSpecProvider, ProviderError, StageCheckpointReader, }; -use reth_rpc_types::engine::{ - CancunPayloadFields, ExecutionPayload, ForkchoiceState, PayloadStatus, PayloadStatusEnum, - PayloadValidationError, -}; use reth_stages_api::{ControlFlow, Pipeline, PipelineTarget, StageId}; use reth_tasks::TaskSpawner; use reth_tokio_util::EventSender; @@ -1984,10 +1984,10 @@ mod tests { test_utils::{spawn_consensus_engine, TestConsensusEngineBuilder}, BeaconForkChoiceUpdateError, }; + use alloy_rpc_types_engine::{ForkchoiceState, ForkchoiceUpdated, PayloadStatus}; use assert_matches::assert_matches; use reth_chainspec::{ChainSpecBuilder, MAINNET}; use reth_provider::{BlockWriter, ProviderFactory}; - use reth_rpc_types::engine::{ForkchoiceState, ForkchoiceUpdated, PayloadStatus}; use reth_rpc_types_compat::engine::payload::block_to_payload_v1; use reth_stages::{ExecOutput, PipelineError, StageError}; use reth_stages_api::StageCheckpoint; @@ -2180,11 +2180,11 @@ mod tests { mod fork_choice_updated { use super::*; use alloy_primitives::U256; + use alloy_rpc_types_engine::ForkchoiceUpdateError; use generators::BlockParams; use reth_db::{tables, test_utils::create_test_static_files_dir, Database}; use reth_db_api::transaction::DbTxMut; use reth_provider::{providers::StaticFileProvider, test_utils::MockNodeTypesWithDB}; - use reth_rpc_types::engine::ForkchoiceUpdateError; use reth_testing_utils::generators::random_block; #[tokio::test] diff --git a/crates/consensus/beacon/src/engine/test_utils.rs b/crates/consensus/beacon/src/engine/test_utils.rs index 44d1d0f05..4dfd9c87d 100644 --- a/crates/consensus/beacon/src/engine/test_utils.rs +++ b/crates/consensus/beacon/src/engine/test_utils.rs @@ -5,6 +5,9 @@ use crate::{ BeaconOnNewPayloadError, EthBeaconConsensus, MIN_BLOCKS_FOR_PIPELINE_RUN, }; use alloy_primitives::{BlockNumber, Sealable, B256}; +use alloy_rpc_types_engine::{ + CancunPayloadFields, ExecutionPayload, ForkchoiceState, ForkchoiceUpdated, PayloadStatus, +}; use reth_blockchain_tree::{ config::BlockchainTreeConfig, externals::TreeExternals, BlockchainTree, ShareableBlockchainTree, }; @@ -30,9 +33,6 @@ use reth_provider::{ }; use reth_prune::Pruner; use reth_prune_types::PruneModes; -use reth_rpc_types::engine::{ - CancunPayloadFields, ExecutionPayload, ForkchoiceState, ForkchoiceUpdated, PayloadStatus, -}; use reth_stages::{sets::DefaultStages, test_utils::TestStages, ExecOutput, Pipeline, StageError}; use reth_static_file::StaticFileProducer; use reth_tasks::TokioTaskExecutor; diff --git a/crates/consensus/debug-client/Cargo.toml b/crates/consensus/debug-client/Cargo.toml index 8a03c0527..74ea61da3 100644 --- a/crates/consensus/debug-client/Cargo.toml +++ b/crates/consensus/debug-client/Cargo.toml @@ -15,7 +15,6 @@ workspace = true reth-node-api.workspace = true reth-node-core.workspace = true reth-rpc-api.workspace = true -reth-rpc-types.workspace = true reth-rpc-builder.workspace = true reth-tracing.workspace = true @@ -24,6 +23,7 @@ alloy-consensus = { workspace = true, features = ["serde"] } alloy-eips.workspace = true alloy-provider = { workspace = true, features = ["ws"] } alloy-rpc-types.workspace = true +alloy-rpc-types-engine.workspace = true auto_impl.workspace = true futures.workspace = true diff --git a/crates/consensus/debug-client/src/client.rs b/crates/consensus/debug-client/src/client.rs index eec1b5b99..1acdd197b 100644 --- a/crates/consensus/debug-client/src/client.rs +++ b/crates/consensus/debug-client/src/client.rs @@ -1,13 +1,10 @@ use alloy_consensus::TxEnvelope; use alloy_eips::eip2718::Encodable2718; use alloy_rpc_types::{Block, BlockTransactions}; +use alloy_rpc_types_engine::{ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3}; use reth_node_api::EngineTypes; -use reth_node_core::{ - primitives::B256, - rpc::types::{ExecutionPayloadV2, ExecutionPayloadV3}, -}; +use reth_node_core::primitives::B256; use reth_rpc_builder::auth::AuthServerHandle; -use reth_rpc_types::ExecutionPayloadV1; use reth_tracing::tracing::warn; use ringbuffer::{AllocRingBuffer, RingBuffer}; use std::future::Future; @@ -133,7 +130,7 @@ impl DebugConsensusClient

{ continue; } }; - let state = reth_rpc_types::engine::ForkchoiceState { + let state = alloy_rpc_types_engine::ForkchoiceState { head_block_hash: block_hash, safe_block_hash, finalized_block_hash, diff --git a/crates/engine/local/Cargo.toml b/crates/engine/local/Cargo.toml index c43a97abd..286b9f836 100644 --- a/crates/engine/local/Cargo.toml +++ b/crates/engine/local/Cargo.toml @@ -23,6 +23,7 @@ reth-stages-api.workspace = true # alloy alloy-primitives.workspace = true +alloy-rpc-types-engine.workspace = true # async tokio.workspace = true diff --git a/crates/engine/local/src/service.rs b/crates/engine/local/src/service.rs index f9d2bd2aa..d276dc5c1 100644 --- a/crates/engine/local/src/service.rs +++ b/crates/engine/local/src/service.rs @@ -178,11 +178,11 @@ mod tests { struct TestPayloadAttributesBuilder; impl PayloadAttributesBuilder for TestPayloadAttributesBuilder { - type PayloadAttributes = reth_rpc_types::engine::PayloadAttributes; + type PayloadAttributes = alloy_rpc_types_engine::PayloadAttributes; type Error = Infallible; fn build(&self) -> Result { - Ok(reth_rpc_types::engine::PayloadAttributes { + Ok(alloy_rpc_types_engine::PayloadAttributes { timestamp: 0, prev_randao: Default::default(), suggested_fee_recipient: Default::default(), diff --git a/crates/engine/tree/Cargo.toml b/crates/engine/tree/Cargo.toml index 4697e7fb8..91c9cd542 100644 --- a/crates/engine/tree/Cargo.toml +++ b/crates/engine/tree/Cargo.toml @@ -29,7 +29,6 @@ reth-primitives.workspace = true reth-provider.workspace = true reth-prune.workspace = true reth-revm.workspace = true -reth-rpc-types.workspace = true reth-stages-api.workspace = true reth-tasks.workspace = true reth-trie.workspace = true @@ -38,6 +37,7 @@ reth-trie-parallel.workspace = true # alloy alloy-primitives.workspace = true alloy-eips.workspace = true +alloy-rpc-types-engine.workspace = true # common futures.workspace = true diff --git a/crates/engine/tree/src/tree/mod.rs b/crates/engine/tree/src/tree/mod.rs index e3d6c7356..3dd736cdc 100644 --- a/crates/engine/tree/src/tree/mod.rs +++ b/crates/engine/tree/src/tree/mod.rs @@ -6,6 +6,10 @@ use crate::{ }; use alloy_eips::BlockNumHash; use alloy_primitives::{BlockNumber, B256, U256}; +use alloy_rpc_types_engine::{ + CancunPayloadFields, ExecutionPayload, ForkchoiceState, PayloadStatus, PayloadStatusEnum, + PayloadValidationError, +}; use reth_beacon_consensus::{ BeaconConsensusEngineEvent, BeaconEngineMessage, ForkchoiceStateTracker, InvalidHeaderCache, OnForkChoiceUpdated, MIN_BLOCKS_FOR_PIPELINE_RUN, @@ -34,13 +38,6 @@ use reth_provider::{ TransactionVariant, }; use reth_revm::database::StateProviderDatabase; -use reth_rpc_types::{ - engine::{ - CancunPayloadFields, ForkchoiceState, PayloadStatus, PayloadStatusEnum, - PayloadValidationError, - }, - ExecutionPayload, -}; use reth_stages_api::ControlFlow; use reth_trie::{updates::TrieUpdates, HashedPostState, TrieInput}; use reth_trie_parallel::async_root::{AsyncStateRoot, AsyncStateRootError}; diff --git a/crates/engine/util/Cargo.toml b/crates/engine/util/Cargo.toml index 768176942..20a0acb8d 100644 --- a/crates/engine/util/Cargo.toml +++ b/crates/engine/util/Cargo.toml @@ -15,7 +15,6 @@ workspace = true reth-primitives.workspace = true reth-errors.workspace = true reth-fs-util.workspace = true -reth-rpc-types.workspace = true reth-rpc-types-compat.workspace = true reth-engine-primitives.workspace = true reth-beacon-consensus.workspace = true @@ -29,6 +28,7 @@ reth-trie.workspace = true # alloy alloy-primitives.workspace = true +alloy-rpc-types-engine.workspace = true # async tokio = { workspace = true, default-features = false } diff --git a/crates/engine/util/src/engine_store.rs b/crates/engine/util/src/engine_store.rs index a897be741..1f3445199 100644 --- a/crates/engine/util/src/engine_store.rs +++ b/crates/engine/util/src/engine_store.rs @@ -1,13 +1,10 @@ //! Stores engine API messages to disk for later inspection and replay. +use alloy_rpc_types_engine::{CancunPayloadFields, ExecutionPayload, ForkchoiceState}; use futures::{Stream, StreamExt}; use reth_beacon_consensus::BeaconEngineMessage; use reth_engine_primitives::EngineTypes; use reth_fs_util as fs; -use reth_rpc_types::{ - engine::{CancunPayloadFields, ForkchoiceState}, - ExecutionPayload, -}; use serde::{Deserialize, Serialize}; use std::{ collections::BTreeMap, diff --git a/crates/engine/util/src/reorg.rs b/crates/engine/util/src/reorg.rs index 8b7b2c036..b3fc8cbd8 100644 --- a/crates/engine/util/src/reorg.rs +++ b/crates/engine/util/src/reorg.rs @@ -1,6 +1,9 @@ //! Stream wrapper that simulates reorgs. use alloy_primitives::U256; +use alloy_rpc_types_engine::{ + CancunPayloadFields, ExecutionPayload, ForkchoiceState, PayloadStatus, +}; use futures::{stream::FuturesUnordered, Stream, StreamExt, TryFutureExt}; use itertools::Either; use reth_beacon_consensus::{BeaconEngineMessage, BeaconOnNewPayloadError, OnForkChoiceUpdated}; @@ -17,10 +20,6 @@ use reth_revm::{ state_change::post_block_withdrawals_balance_increments, DatabaseCommit, }; -use reth_rpc_types::{ - engine::{CancunPayloadFields, ForkchoiceState, PayloadStatus}, - ExecutionPayload, -}; use reth_rpc_types_compat::engine::payload::block_to_payload; use reth_trie::HashedPostState; use revm_primitives::{ diff --git a/crates/engine/util/src/skip_new_payload.rs b/crates/engine/util/src/skip_new_payload.rs index f4ed8a543..d2450711e 100644 --- a/crates/engine/util/src/skip_new_payload.rs +++ b/crates/engine/util/src/skip_new_payload.rs @@ -1,9 +1,9 @@ //! Stream wrapper that skips specified number of new payload messages. +use alloy_rpc_types_engine::{PayloadStatus, PayloadStatusEnum}; use futures::{Stream, StreamExt}; use reth_beacon_consensus::BeaconEngineMessage; use reth_engine_primitives::EngineTypes; -use reth_rpc_types::engine::{PayloadStatus, PayloadStatusEnum}; use std::{ pin::Pin, task::{ready, Context, Poll}, diff --git a/crates/ethereum/engine-primitives/Cargo.toml b/crates/ethereum/engine-primitives/Cargo.toml index cfeac2853..e9bcd4256 100644 --- a/crates/ethereum/engine-primitives/Cargo.toml +++ b/crates/ethereum/engine-primitives/Cargo.toml @@ -16,7 +16,6 @@ reth-chainspec.workspace = true reth-primitives.workspace = true reth-engine-primitives.workspace = true reth-payload-primitives.workspace = true -reth-rpc-types.workspace = true reth-rpc-types-compat.workspace = true alloy-rlp.workspace = true reth-chain-state.workspace = true @@ -24,6 +23,7 @@ reth-chain-state.workspace = true # alloy alloy-primitives.workspace = true alloy-eips.workspace = true +alloy-rpc-types-engine.workspace = true # misc serde.workspace = true diff --git a/crates/ethereum/engine-primitives/src/lib.rs b/crates/ethereum/engine-primitives/src/lib.rs index 92243d729..69d73a021 100644 --- a/crates/ethereum/engine-primitives/src/lib.rs +++ b/crates/ethereum/engine-primitives/src/lib.rs @@ -11,6 +11,10 @@ mod payload; use std::sync::Arc; +pub use alloy_rpc_types_engine::{ + ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4, + ExecutionPayloadV1, PayloadAttributes as EthPayloadAttributes, +}; pub use payload::{EthBuiltPayload, EthPayloadBuilderAttributes}; use reth_chainspec::ChainSpec; use reth_engine_primitives::{EngineTypes, EngineValidator}; @@ -18,13 +22,6 @@ use reth_payload_primitives::{ validate_version_specific_fields, EngineApiMessageVersion, EngineObjectValidationError, PayloadOrAttributes, PayloadTypes, }; -pub use reth_rpc_types::{ - engine::{ - ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4, - PayloadAttributes as EthPayloadAttributes, - }, - ExecutionPayloadV1, -}; /// The types used in the default mainnet ethereum beacon consensus engine. #[derive(Debug, Default, Clone, serde::Deserialize, serde::Serialize)] diff --git a/crates/ethereum/engine-primitives/src/payload.rs b/crates/ethereum/engine-primitives/src/payload.rs index e22012b6c..dd0b7b405 100644 --- a/crates/ethereum/engine-primitives/src/payload.rs +++ b/crates/ethereum/engine-primitives/src/payload.rs @@ -3,13 +3,13 @@ use alloy_eips::eip4844::BlobTransactionSidecar; use alloy_primitives::{Address, B256, U256}; use alloy_rlp::Encodable; -use reth_chain_state::ExecutedBlock; -use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes}; -use reth_primitives::{SealedBlock, Withdrawals}; -use reth_rpc_types::engine::{ +use alloy_rpc_types_engine::{ ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4, ExecutionPayloadV1, PayloadAttributes, PayloadId, }; +use reth_chain_state::ExecutedBlock; +use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes}; +use reth_primitives::{SealedBlock, Withdrawals}; use reth_rpc_types_compat::engine::payload::{ block_to_payload_v1, block_to_payload_v3, block_to_payload_v4, convert_block_to_payload_field_v2, diff --git a/crates/node/core/src/utils.rs b/crates/node/core/src/utils.rs index ae9b1f021..a64d12114 100644 --- a/crates/node/core/src/utils.rs +++ b/crates/node/core/src/utils.rs @@ -2,6 +2,7 @@ //! blocks from the network. use alloy_primitives::Sealable; +use alloy_rpc_types_engine::{JwtError, JwtSecret}; use eyre::Result; use reth_chainspec::ChainSpec; use reth_consensus_common::validation::validate_block_pre_execution; @@ -11,7 +12,6 @@ use reth_network_p2p::{ priority::Priority, }; use reth_primitives::{BlockHashOrNumber, SealedBlock, SealedHeader}; -use reth_rpc_types::engine::{JwtError, JwtSecret}; use std::{ env::VarError, path::{Path, PathBuf}, diff --git a/crates/node/core/src/version.rs b/crates/node/core/src/version.rs index 683c30564..84fcf3f0f 100644 --- a/crates/node/core/src/version.rs +++ b/crates/node/core/src/version.rs @@ -1,6 +1,6 @@ //! Version information for reth. +use alloy_rpc_types_engine::ClientCode; use reth_db::ClientVersion; -use reth_rpc_types::engine::ClientCode; /// The client code for Reth pub const CLIENT_CODE: ClientCode = ClientCode::RH; diff --git a/crates/optimism/node/Cargo.toml b/crates/optimism/node/Cargo.toml index d4d9ba7af..30e3fde89 100644 --- a/crates/optimism/node/Cargo.toml +++ b/crates/optimism/node/Cargo.toml @@ -45,6 +45,7 @@ reth-optimism-forks.workspace = true # ethereum alloy-primitives.workspace = true op-alloy-rpc-types-engine.workspace = true +alloy-rpc-types-engine.workspace = true # async async-trait.workspace = true diff --git a/crates/optimism/node/src/engine.rs b/crates/optimism/node/src/engine.rs index bc5880034..06059083f 100644 --- a/crates/optimism/node/src/engine.rs +++ b/crates/optimism/node/src/engine.rs @@ -1,5 +1,6 @@ use std::sync::Arc; +use alloy_rpc_types_engine::{ExecutionPayloadEnvelopeV2, ExecutionPayloadV1}; use op_alloy_rpc_types_engine::{ OptimismExecutionPayloadEnvelopeV3, OptimismExecutionPayloadEnvelopeV4, OptimismPayloadAttributes, @@ -15,7 +16,6 @@ use reth_node_api::{ }; use reth_optimism_forks::OptimismHardfork; use reth_optimism_payload_builder::{OptimismBuiltPayload, OptimismPayloadBuilderAttributes}; -use reth_rpc_types::{engine::ExecutionPayloadEnvelopeV2, ExecutionPayloadV1}; /// The types used in the optimism beacon consensus engine. #[derive(Debug, Default, Clone, serde::Deserialize, serde::Serialize)] diff --git a/crates/optimism/node/tests/e2e/p2p.rs b/crates/optimism/node/tests/e2e/p2p.rs index e4993e8f3..ebd35cc8a 100644 --- a/crates/optimism/node/tests/e2e/p2p.rs +++ b/crates/optimism/node/tests/e2e/p2p.rs @@ -1,6 +1,6 @@ use crate::utils::{advance_chain, setup}; +use alloy_rpc_types_engine::PayloadStatusEnum; use reth::blockchain_tree::error::BlockchainTreeError; -use reth_rpc_types::engine::PayloadStatusEnum; use std::sync::Arc; use tokio::sync::Mutex; diff --git a/crates/optimism/payload/Cargo.toml b/crates/optimism/payload/Cargo.toml index 8fba06f22..e64b72610 100644 --- a/crates/optimism/payload/Cargo.toml +++ b/crates/optimism/payload/Cargo.toml @@ -18,7 +18,6 @@ reth-primitives.workspace = true reth-revm.workspace = true reth-transaction-pool.workspace = true reth-provider.workspace = true -reth-rpc-types.workspace = true reth-rpc-types-compat.workspace = true reth-evm.workspace = true reth-execution-types.workspace = true @@ -38,6 +37,7 @@ alloy-primitives.workspace = true alloy-rlp.workspace = true op-alloy-rpc-types-engine.workspace = true revm-primitives.workspace = true +alloy-rpc-types-engine.workspace = true # misc tracing.workspace = true diff --git a/crates/optimism/payload/src/payload.rs b/crates/optimism/payload/src/payload.rs index 28618026f..67eddb8e1 100644 --- a/crates/optimism/payload/src/payload.rs +++ b/crates/optimism/payload/src/payload.rs @@ -4,6 +4,7 @@ use alloy_primitives::{Address, B256, U256}; use alloy_rlp::Encodable; +use alloy_rpc_types_engine::{ExecutionPayloadEnvelopeV2, ExecutionPayloadV1, PayloadId}; /// Re-export for use in downstream arguments. pub use op_alloy_rpc_types_engine::OptimismPayloadAttributes; use op_alloy_rpc_types_engine::{ @@ -16,7 +17,6 @@ use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes}; use reth_primitives::{ transaction::WithEncoded, BlobTransactionSidecar, SealedBlock, TransactionSigned, Withdrawals, }; -use reth_rpc_types::engine::{ExecutionPayloadEnvelopeV2, ExecutionPayloadV1, PayloadId}; use reth_rpc_types_compat::engine::payload::{ block_to_payload_v1, block_to_payload_v3, block_to_payload_v4, convert_block_to_payload_field_v2, diff --git a/crates/rpc/rpc-api/Cargo.toml b/crates/rpc/rpc-api/Cargo.toml index 08a23c8e8..6e9e469ec 100644 --- a/crates/rpc/rpc-api/Cargo.toml +++ b/crates/rpc/rpc-api/Cargo.toml @@ -14,7 +14,6 @@ workspace = true [dependencies] # reth reth-primitives.workspace = true -reth-rpc-types.workspace = true reth-rpc-eth-api.workspace = true reth-engine-primitives.workspace = true reth-network-peers.workspace = true @@ -33,6 +32,7 @@ alloy-rpc-types-txpool.workspace = true alloy-rpc-types-admin.workspace = true alloy-serde.workspace = true alloy-rpc-types-beacon.workspace = true +alloy-rpc-types-engine.workspace = true # misc jsonrpsee = { workspace = true, features = ["server", "macros"] } diff --git a/crates/rpc/rpc-api/src/engine.rs b/crates/rpc/rpc-api/src/engine.rs index 5bd54ff02..d489d0dd7 100644 --- a/crates/rpc/rpc-api/src/engine.rs +++ b/crates/rpc/rpc-api/src/engine.rs @@ -9,15 +9,15 @@ use alloy_primitives::{Address, BlockHash, Bytes, B256, U256, U64}; use alloy_rpc_types::{ state::StateOverride, BlockOverrides, EIP1186AccountProofResponse, Filter, Log, SyncStatus, }; -use alloy_rpc_types_eth::transaction::TransactionRequest; -use alloy_serde::JsonStorageKey; -use jsonrpsee::{core::RpcResult, proc_macros::rpc}; -use reth_engine_primitives::EngineTypes; -use reth_rpc_types::engine::{ +use alloy_rpc_types_engine::{ ClientVersionV1, ExecutionPayloadBodiesV1, ExecutionPayloadBodiesV2, ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3, ExecutionPayloadV4, ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, TransitionConfiguration, }; +use alloy_rpc_types_eth::transaction::TransactionRequest; +use alloy_serde::JsonStorageKey; +use jsonrpsee::{core::RpcResult, proc_macros::rpc}; +use reth_engine_primitives::EngineTypes; // NOTE: We can't use associated types in the `EngineApi` trait because of jsonrpsee, so we use a // generic here. It would be nice if the rpc macro would understand which types need to have serde. // By default, if the trait has a generic, the rpc macro will add e.g. `Engine: DeserializeOwned` to diff --git a/crates/rpc/rpc-builder/Cargo.toml b/crates/rpc/rpc-builder/Cargo.toml index 04e1a281e..a77e9b61b 100644 --- a/crates/rpc/rpc-builder/Cargo.toml +++ b/crates/rpc/rpc-builder/Cargo.toml @@ -72,6 +72,7 @@ reth-rpc-types-compat.workspace = true alloy-primitives.workspace = true alloy-rpc-types-eth.workspace = true alloy-rpc-types-trace.workspace = true +alloy-rpc-types-engine.workspace = true tokio = { workspace = true, features = ["rt", "rt-multi-thread"] } serde_json.workspace = true diff --git a/crates/rpc/rpc-builder/tests/it/auth.rs b/crates/rpc/rpc-builder/tests/it/auth.rs index 79a42d121..71e8bf39f 100644 --- a/crates/rpc/rpc-builder/tests/it/auth.rs +++ b/crates/rpc/rpc-builder/tests/it/auth.rs @@ -2,12 +2,12 @@ use crate::utils::launch_auth; use alloy_primitives::U64; +use alloy_rpc_types_engine::{ForkchoiceState, PayloadId, TransitionConfiguration}; use jsonrpsee::core::client::{ClientT, SubscriptionClientT}; use reth_ethereum_engine_primitives::EthEngineTypes; use reth_primitives::Block; use reth_rpc_api::clients::EngineApiClient; use reth_rpc_layer::JwtSecret; -use reth_rpc_types::engine::{ForkchoiceState, PayloadId, TransitionConfiguration}; use reth_rpc_types_compat::engine::payload::{ block_to_payload_v1, convert_block_to_payload_input_v2, }; diff --git a/crates/rpc/rpc-builder/tests/it/utils.rs b/crates/rpc/rpc-builder/tests/it/utils.rs index dbdd2407f..847de9956 100644 --- a/crates/rpc/rpc-builder/tests/it/utils.rs +++ b/crates/rpc/rpc-builder/tests/it/utils.rs @@ -1,5 +1,6 @@ use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; +use alloy_rpc_types_engine::{ClientCode, ClientVersionV1}; use reth_beacon_consensus::BeaconConsensusEngineHandle; use reth_chainspec::MAINNET; use reth_ethereum_engine_primitives::{EthEngineTypes, EthereumEngineValidator}; @@ -15,7 +16,6 @@ use reth_rpc_builder::{ use reth_rpc_engine_api::{capabilities::EngineCapabilities, EngineApi}; use reth_rpc_layer::JwtSecret; use reth_rpc_server_types::RpcModuleSelection; -use reth_rpc_types::engine::{ClientCode, ClientVersionV1}; use reth_tasks::TokioTaskExecutor; use reth_transaction_pool::{ noop::NoopTransactionPool, diff --git a/crates/rpc/rpc-engine-api/Cargo.toml b/crates/rpc/rpc-engine-api/Cargo.toml index 57f0832b5..2e5ec0af8 100644 --- a/crates/rpc/rpc-engine-api/Cargo.toml +++ b/crates/rpc/rpc-engine-api/Cargo.toml @@ -30,6 +30,7 @@ reth-transaction-pool.workspace = true # ethereum alloy-eips.workspace = true alloy-primitives.workspace = true +alloy-rpc-types-engine = { workspace = true, features = ["jsonrpsee-types"] } # async tokio = { workspace = true, features = ["sync"] } diff --git a/crates/rpc/rpc-engine-api/src/engine_api.rs b/crates/rpc/rpc-engine-api/src/engine_api.rs index 2b37f9d15..907297de1 100644 --- a/crates/rpc/rpc-engine-api/src/engine_api.rs +++ b/crates/rpc/rpc-engine-api/src/engine_api.rs @@ -3,6 +3,12 @@ use crate::{ }; use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::{BlockHash, BlockNumber, B256, U64}; +use alloy_rpc_types_engine::{ + CancunPayloadFields, ClientVersionV1, ExecutionPayload, ExecutionPayloadBodiesV1, + ExecutionPayloadBodiesV2, ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3, + ExecutionPayloadV4, ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, + TransitionConfiguration, +}; use async_trait::async_trait; use jsonrpsee_core::RpcResult; use reth_beacon_consensus::BeaconConsensusEngineHandle; @@ -16,12 +22,6 @@ use reth_payload_primitives::{ }; use reth_primitives::{Block, BlockHashOrNumber, EthereumHardfork}; use reth_rpc_api::EngineApiServer; -use reth_rpc_types::engine::{ - CancunPayloadFields, ClientVersionV1, ExecutionPayload, ExecutionPayloadBodiesV1, - ExecutionPayloadBodiesV2, ExecutionPayloadInputV2, ExecutionPayloadV1, ExecutionPayloadV3, - ExecutionPayloadV4, ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, - TransitionConfiguration, -}; use reth_rpc_types_compat::engine::payload::{ convert_payload_input_v2_to_payload, convert_to_payload_body_v1, convert_to_payload_body_v2, }; @@ -948,6 +948,7 @@ where #[cfg(test)] mod tests { use super::*; + use alloy_rpc_types_engine::{ClientCode, ClientVersionV1}; use assert_matches::assert_matches; use reth_beacon_consensus::{BeaconConsensusEngineEvent, BeaconEngineMessage}; use reth_chainspec::{ChainSpec, MAINNET}; @@ -955,7 +956,6 @@ mod tests { use reth_payload_builder::test_utils::spawn_test_payload_service; use reth_primitives::SealedBlock; use reth_provider::test_utils::MockEthProvider; - use reth_rpc_types::engine::{ClientCode, ClientVersionV1}; use reth_rpc_types_compat::engine::payload::execution_payload_from_sealed_block; use reth_tasks::TokioTaskExecutor; use reth_testing_utils::generators::random_block; diff --git a/crates/rpc/rpc-engine-api/src/error.rs b/crates/rpc/rpc-engine-api/src/error.rs index b0ba93d6e..8e86af4c9 100644 --- a/crates/rpc/rpc-engine-api/src/error.rs +++ b/crates/rpc/rpc-engine-api/src/error.rs @@ -195,7 +195,7 @@ impl From for jsonrpsee_types::error::ErrorObject<'static> { #[cfg(test)] mod tests { use super::*; - use reth_rpc_types::engine::ForkchoiceUpdateError; + use alloy_rpc_types_engine::ForkchoiceUpdateError; #[track_caller] fn ensure_engine_rpc_error( diff --git a/crates/rpc/rpc-engine-api/src/metrics.rs b/crates/rpc/rpc-engine-api/src/metrics.rs index 0ae97768b..2c4216664 100644 --- a/crates/rpc/rpc-engine-api/src/metrics.rs +++ b/crates/rpc/rpc-engine-api/src/metrics.rs @@ -1,9 +1,9 @@ use std::time::Duration; use crate::EngineApiError; +use alloy_rpc_types_engine::{ForkchoiceUpdated, PayloadStatus, PayloadStatusEnum}; use metrics::{Counter, Histogram}; use reth_metrics::Metrics; -use reth_rpc_types::engine::{ForkchoiceUpdated, PayloadStatus, PayloadStatusEnum}; /// All beacon consensus engine metrics #[derive(Default)] @@ -61,16 +61,16 @@ pub(crate) struct ForkchoiceUpdatedResponseMetrics { /// The total count of forkchoice updated messages received. pub(crate) forkchoice_updated_messages: Counter, /// The total count of forkchoice updated messages that we responded to with - /// [Invalid](reth_rpc_types::engine::PayloadStatusEnum#Invalid). + /// [`Invalid`](alloy_rpc_types_engine::PayloadStatusEnum#Invalid). pub(crate) forkchoice_updated_invalid: Counter, /// The total count of forkchoice updated messages that we responded to with - /// [Valid](reth_rpc_types::engine::PayloadStatusEnum#Valid). + /// [`Valid`](alloy_rpc_types_engine::PayloadStatusEnum#Valid). pub(crate) forkchoice_updated_valid: Counter, /// The total count of forkchoice updated messages that we responded to with - /// [Syncing](reth_rpc_types::engine::PayloadStatusEnum#Syncing). + /// [`Syncing`](alloy_rpc_types_engine::PayloadStatusEnum#Syncing). pub(crate) forkchoice_updated_syncing: Counter, /// The total count of forkchoice updated messages that we responded to with - /// [Accepted](reth_rpc_types::engine::PayloadStatusEnum#Accepted). + /// [`Accepted`](alloy_rpc_types_engine::PayloadStatusEnum#Accepted). pub(crate) forkchoice_updated_accepted: Counter, /// The total count of forkchoice updated messages that were unsuccessful, i.e. we responded /// with an error type that is not a [`PayloadStatusEnum`]. @@ -84,16 +84,16 @@ pub(crate) struct NewPayloadStatusResponseMetrics { /// The total count of new payload messages received. pub(crate) new_payload_messages: Counter, /// The total count of new payload messages that we responded to with - /// [Invalid](reth_rpc_types::engine::PayloadStatusEnum#Invalid). + /// [Invalid](alloy_rpc_types_engine::PayloadStatusEnum#Invalid). pub(crate) new_payload_invalid: Counter, /// The total count of new payload messages that we responded to with - /// [Valid](reth_rpc_types::engine::PayloadStatusEnum#Valid). + /// [Valid](alloy_rpc_types_engine::PayloadStatusEnum#Valid). pub(crate) new_payload_valid: Counter, /// The total count of new payload messages that we responded to with - /// [Syncing](reth_rpc_types::engine::PayloadStatusEnum#Syncing). + /// [Syncing](alloy_rpc_types_engine::PayloadStatusEnum#Syncing). pub(crate) new_payload_syncing: Counter, /// The total count of new payload messages that we responded to with - /// [Accepted](reth_rpc_types::engine::PayloadStatusEnum#Accepted). + /// [Accepted](alloy_rpc_types_engine::PayloadStatusEnum#Accepted). pub(crate) new_payload_accepted: Counter, /// The total count of new payload messages that were unsuccessful, i.e. we responded with an /// error type that is not a [`PayloadStatusEnum`]. diff --git a/crates/rpc/rpc-engine-api/tests/it/payload.rs b/crates/rpc/rpc-engine-api/tests/it/payload.rs index ccb6878e9..e98f585c0 100644 --- a/crates/rpc/rpc-engine-api/tests/it/payload.rs +++ b/crates/rpc/rpc-engine-api/tests/it/payload.rs @@ -2,14 +2,14 @@ use alloy_primitives::{Bytes, U256}; use alloy_rlp::{Decodable, Error as RlpError}; +use alloy_rpc_types_engine::{ + ExecutionPayload, ExecutionPayloadBodyV1, ExecutionPayloadV1, PayloadError, +}; use assert_matches::assert_matches; use reth_primitives::{ alloy_primitives::Sealable, proofs, Block, SealedBlock, SealedHeader, TransactionSigned, Withdrawals, }; -use reth_rpc_types::engine::{ - ExecutionPayload, ExecutionPayloadBodyV1, ExecutionPayloadV1, PayloadError, -}; use reth_rpc_types_compat::engine::payload::{ block_to_payload, block_to_payload_v1, convert_to_payload_body_v1, try_into_sealed_block, try_payload_v1_to_block, diff --git a/crates/rpc/rpc-server-types/Cargo.toml b/crates/rpc/rpc-server-types/Cargo.toml index e908af0af..08ecd3947 100644 --- a/crates/rpc/rpc-server-types/Cargo.toml +++ b/crates/rpc/rpc-server-types/Cargo.toml @@ -15,10 +15,10 @@ workspace = true reth-errors.workspace = true reth-network-api.workspace = true reth-primitives.workspace = true -reth-rpc-types.workspace = true # ethereum alloy-primitives.workspace = true +alloy-rpc-types-engine.workspace = true # rpc jsonrpsee-core.workspace = true diff --git a/crates/rpc/rpc-server-types/src/result.rs b/crates/rpc/rpc-server-types/src/result.rs index 3dc76f0d8..78e643664 100644 --- a/crates/rpc/rpc-server-types/src/result.rs +++ b/crates/rpc/rpc-server-types/src/result.rs @@ -2,9 +2,9 @@ use std::fmt; +use alloy_rpc_types_engine::PayloadError; use jsonrpsee_core::RpcResult; use reth_primitives::BlockId; -use reth_rpc_types::engine::PayloadError; /// Helper trait to easily convert various `Result` types into [`RpcResult`] pub trait ToRpcResult: Sized { diff --git a/crates/rpc/rpc-types-compat/Cargo.toml b/crates/rpc/rpc-types-compat/Cargo.toml index bf569ec56..1213e33ba 100644 --- a/crates/rpc/rpc-types-compat/Cargo.toml +++ b/crates/rpc/rpc-types-compat/Cargo.toml @@ -14,7 +14,6 @@ workspace = true [dependencies] # reth reth-primitives.workspace = true -reth-rpc-types.workspace = true reth-trie-common.workspace = true # ethereum @@ -23,6 +22,7 @@ alloy-rlp.workspace = true alloy-rpc-types.workspace = true alloy-rpc-types-eth = { workspace = true, default-features = false, features = ["serde"] } alloy-serde.workspace = true +alloy-rpc-types-engine.workspace = true [dev-dependencies] serde_json.workspace = true diff --git a/crates/rpc/rpc-types-compat/src/engine/payload.rs b/crates/rpc/rpc-types-compat/src/engine/payload.rs index f4e9dc6c7..37b1a33f2 100644 --- a/crates/rpc/rpc-types-compat/src/engine/payload.rs +++ b/crates/rpc/rpc-types-compat/src/engine/payload.rs @@ -2,16 +2,16 @@ //! Ethereum's Engine use alloy_primitives::{B256, U256}; +use alloy_rpc_types_engine::{ + payload::{ExecutionPayloadBodyV1, ExecutionPayloadFieldV2, ExecutionPayloadInputV2}, + ExecutionPayload, ExecutionPayloadBodyV2, ExecutionPayloadV1, ExecutionPayloadV2, + ExecutionPayloadV3, ExecutionPayloadV4, PayloadError, +}; use reth_primitives::{ constants::{EMPTY_OMMER_ROOT_HASH, MAXIMUM_EXTRA_DATA_SIZE}, proofs::{self}, Block, BlockBody, Header, Request, SealedBlock, TransactionSigned, Withdrawals, }; -use reth_rpc_types::engine::{ - payload::{ExecutionPayloadBodyV1, ExecutionPayloadFieldV2, ExecutionPayloadInputV2}, - ExecutionPayload, ExecutionPayloadBodyV2, ExecutionPayloadV1, ExecutionPayloadV2, - ExecutionPayloadV3, ExecutionPayloadV4, PayloadError, -}; /// Converts [`ExecutionPayloadV1`] to [`Block`] pub fn try_payload_v1_to_block(payload: ExecutionPayloadV1) -> Result { @@ -443,9 +443,9 @@ mod tests { validate_block_hash, }; use alloy_primitives::{b256, hex, Bytes, U256}; - use reth_rpc_types::{ - engine::{CancunPayloadFields, ExecutionPayloadV3, ExecutionPayloadV4}, - ExecutionPayload, ExecutionPayloadV1, ExecutionPayloadV2, + use alloy_rpc_types_engine::{ + CancunPayloadFields, ExecutionPayload, ExecutionPayloadV1, ExecutionPayloadV2, + ExecutionPayloadV3, ExecutionPayloadV4, }; #[test] diff --git a/crates/rpc/rpc-types/Cargo.toml b/crates/rpc/rpc-types/Cargo.toml index 54840490b..f53c7c753 100644 --- a/crates/rpc/rpc-types/Cargo.toml +++ b/crates/rpc/rpc-types/Cargo.toml @@ -12,10 +12,6 @@ description = "Reth RPC types" workspace = true [dependencies] - -# ethereum -alloy-rpc-types-engine = { workspace = true, features = ["std", "serde", "jsonrpsee-types"], optional = true } - # misc jsonrpsee-types = { workspace = true, optional = true } @@ -25,6 +21,4 @@ jsonrpsee-types = { workspace = true, optional = true } default = ["jsonrpsee-types"] jsonrpsee-types = [ "dep:jsonrpsee-types", - "dep:alloy-rpc-types-engine", - "alloy-rpc-types-engine/jsonrpsee-types", ] \ No newline at end of file diff --git a/crates/rpc/rpc-types/src/eth/mod.rs b/crates/rpc/rpc-types/src/eth/mod.rs index 0db9f0e41..52d003284 100644 --- a/crates/rpc/rpc-types/src/eth/mod.rs +++ b/crates/rpc/rpc-types/src/eth/mod.rs @@ -1,7 +1,3 @@ //! Ethereum related types pub(crate) mod error; - -// re-export -#[cfg(feature = "jsonrpsee-types")] -pub use alloy_rpc_types_engine as engine; diff --git a/crates/rpc/rpc-types/src/lib.rs b/crates/rpc/rpc-types/src/lib.rs index 591969901..dc7f65c8d 100644 --- a/crates/rpc/rpc-types/src/lib.rs +++ b/crates/rpc/rpc-types/src/lib.rs @@ -15,10 +15,3 @@ mod eth; // Ethereum specific rpc types related to typed transaction requests and the engine API. #[cfg(feature = "jsonrpsee-types")] pub use eth::error::ToRpcError; -#[cfg(feature = "jsonrpsee-types")] -pub use eth::{ - engine, - engine::{ - ExecutionPayload, ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3, PayloadError, - }, -};