rpc-types: rm alloy-rpc-types-engine reexport (#11206)

This commit is contained in:
Thomas Coratger
2024-09-25 16:49:50 +02:00
committed by GitHub
parent 3d034519af
commit c00516c3f9
48 changed files with 111 additions and 134 deletions

25
Cargo.lock generated
View File

@ -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",
]

View File

@ -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

View File

@ -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};

View File

@ -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"] }

View File

@ -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.

View File

@ -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,

View File

@ -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)]

View File

@ -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};

View File

@ -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,

View File

@ -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]

View File

@ -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;

View File

@ -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

View File

@ -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<P: BlockProvider + Clone> DebugConsensusClient<P> {
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,

View File

@ -23,6 +23,7 @@ reth-stages-api.workspace = true
# alloy
alloy-primitives.workspace = true
alloy-rpc-types-engine.workspace = true
# async
tokio.workspace = true

View File

@ -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<Self::PayloadAttributes, Self::Error> {
Ok(reth_rpc_types::engine::PayloadAttributes {
Ok(alloy_rpc_types_engine::PayloadAttributes {
timestamp: 0,
prev_randao: Default::default(),
suggested_fee_recipient: Default::default(),

View File

@ -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

View File

@ -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};

View File

@ -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 }

View File

@ -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,

View File

@ -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::{

View File

@ -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},

View File

@ -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

View File

@ -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)]

View File

@ -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,

View File

@ -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},

View File

@ -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;

View File

@ -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

View File

@ -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)]

View File

@ -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;

View File

@ -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

View File

@ -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,

View File

@ -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"] }

View File

@ -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

View File

@ -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

View File

@ -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,
};

View File

@ -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,

View File

@ -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"] }

View File

@ -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;

View File

@ -195,7 +195,7 @@ impl From<EngineApiError> 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(

View File

@ -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`].

View File

@ -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,

View File

@ -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

View File

@ -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<Ok, Err>: Sized {

View File

@ -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

View File

@ -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<Block, PayloadError> {
@ -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]

View File

@ -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",
]

View File

@ -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;

View File

@ -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,
},
};