diff --git a/Cargo.lock b/Cargo.lock index 759665b1f0d2..c4bc15c7c63c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8428,6 +8428,7 @@ dependencies = [ name = "reth-rpc-engine-api" version = "1.0.7" dependencies = [ + "alloy-eips", "alloy-primitives", "alloy-rlp", "assert_matches", @@ -8569,7 +8570,6 @@ dependencies = [ name = "reth-rpc-types" version = "1.0.7" dependencies = [ - "alloy-eips", "alloy-primitives", "alloy-rpc-types", "alloy-rpc-types-admin", @@ -8586,7 +8586,6 @@ dependencies = [ "op-alloy-rpc-types", "op-alloy-rpc-types-engine", "rand 0.8.5", - "serde", ] [[package]] @@ -8817,6 +8816,7 @@ dependencies = [ name = "reth-transaction-pool" version = "1.0.7" dependencies = [ + "alloy-eips", "alloy-primitives", "alloy-rlp", "aquamarine", @@ -8840,7 +8840,6 @@ dependencies = [ "reth-metrics", "reth-primitives", "reth-provider", - "reth-rpc-types", "reth-storage-api", "reth-tasks", "reth-tracing", diff --git a/crates/rpc/rpc-api/Cargo.toml b/crates/rpc/rpc-api/Cargo.toml index 480d06f997ed..bd51ac9975cd 100644 --- a/crates/rpc/rpc-api/Cargo.toml +++ b/crates/rpc/rpc-api/Cargo.toml @@ -20,8 +20,8 @@ reth-engine-primitives.workspace = true reth-network-peers.workspace = true # ethereum -alloy-json-rpc.workspace = true alloy-eips.workspace = true +alloy-json-rpc.workspace = true alloy-primitives.workspace = true # misc diff --git a/crates/rpc/rpc-api/src/engine.rs b/crates/rpc/rpc-api/src/engine.rs index 73a6b35fbb5b..750c88cdc2ff 100644 --- a/crates/rpc/rpc-api/src/engine.rs +++ b/crates/rpc/rpc-api/src/engine.rs @@ -3,7 +3,7 @@ //! This contains the `engine_` namespace and the subset of the `eth_` namespace that is exposed to //! the consensus client. -use alloy_eips::{BlockId, BlockNumberOrTag}; +use alloy_eips::{eip4844::BlobAndProofV1, BlockId, BlockNumberOrTag}; use alloy_json_rpc::RpcObject; use alloy_primitives::{Address, BlockHash, Bytes, B256, U256, U64}; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; @@ -15,8 +15,8 @@ use reth_rpc_types::{ ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, TransitionConfiguration, }, state::StateOverride, - BlobAndProofV1, BlockOverrides, EIP1186AccountProofResponse, Filter, JsonStorageKey, Log, - SyncStatus, TransactionRequest, + BlockOverrides, EIP1186AccountProofResponse, Filter, JsonStorageKey, Log, SyncStatus, + TransactionRequest, }; // 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. diff --git a/crates/rpc/rpc-engine-api/Cargo.toml b/crates/rpc/rpc-engine-api/Cargo.toml index 228e0a1fc6cb..57f0832b5ff6 100644 --- a/crates/rpc/rpc-engine-api/Cargo.toml +++ b/crates/rpc/rpc-engine-api/Cargo.toml @@ -28,6 +28,7 @@ reth-evm.workspace = true reth-transaction-pool.workspace = true # ethereum +alloy-eips.workspace = true alloy-primitives.workspace = true # async diff --git a/crates/rpc/rpc-engine-api/src/engine_api.rs b/crates/rpc/rpc-engine-api/src/engine_api.rs index b2f95fea5f74..a09ef8661901 100644 --- a/crates/rpc/rpc-engine-api/src/engine_api.rs +++ b/crates/rpc/rpc-engine-api/src/engine_api.rs @@ -1,6 +1,7 @@ use crate::{ capabilities::EngineCapabilities, metrics::EngineApiMetrics, EngineApiError, EngineApiResult, }; +use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::{BlockHash, BlockNumber, B256, U64}; use async_trait::async_trait; use jsonrpsee_core::RpcResult; @@ -15,14 +16,11 @@ 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, - }, - BlobAndProofV1, +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, diff --git a/crates/rpc/rpc-types/Cargo.toml b/crates/rpc/rpc-types/Cargo.toml index 24217a28469b..67c18e841294 100644 --- a/crates/rpc/rpc-types/Cargo.toml +++ b/crates/rpc/rpc-types/Cargo.toml @@ -14,7 +14,6 @@ workspace = true [dependencies] # ethereum -alloy-eips.workspace = true alloy-primitives = { workspace = true, features = ["rand", "rlp", "serde"] } alloy-rpc-types.workspace = true alloy-rpc-types-admin.workspace = true @@ -33,7 +32,6 @@ op-alloy-rpc-types-engine.workspace = true # misc jsonrpsee-types = { workspace = true, optional = true } -serde.workspace = true [dev-dependencies] # misc diff --git a/crates/rpc/rpc-types/src/lib.rs b/crates/rpc/rpc-types/src/lib.rs index 03c681a8b8a4..dc0eb3dec5c9 100644 --- a/crates/rpc/rpc-types/src/lib.rs +++ b/crates/rpc/rpc-types/src/lib.rs @@ -61,18 +61,6 @@ pub use eth::{ }, }; -use alloy_eips::eip4844::{Blob, Bytes48}; -use serde::{Deserialize, Serialize}; - -/// Blob type returned in responses to `engine_getBlobsV1`: -#[derive(Debug, Serialize, Deserialize, Clone)] -pub struct BlobAndProofV1 { - /// The blob data. - pub blob: Box, - /// The KZG proof for the blob. - pub proof: Bytes48, -} - /// Optimism specific rpc types. pub mod optimism { pub use op_alloy_rpc_types::*; diff --git a/crates/transaction-pool/Cargo.toml b/crates/transaction-pool/Cargo.toml index 1daa6b4b2149..a0720c037ace 100644 --- a/crates/transaction-pool/Cargo.toml +++ b/crates/transaction-pool/Cargo.toml @@ -18,15 +18,15 @@ reth-chainspec.workspace = true reth-eth-wire-types.workspace = true reth-primitives = { workspace = true, features = ["c-kzg", "secp256k1"] } reth-execution-types.workspace = true -reth-rpc-types.workspace = true reth-fs-util.workspace = true reth-storage-api.workspace = true reth-tasks.workspace = true revm.workspace = true # ethereum -alloy-rlp.workspace = true +alloy-eips.workspace = true alloy-primitives.workspace = true +alloy-rlp.workspace = true # async/futures futures-util.workspace = true diff --git a/crates/transaction-pool/src/blobstore/disk.rs b/crates/transaction-pool/src/blobstore/disk.rs index 94b200590f55..96119a0f8170 100644 --- a/crates/transaction-pool/src/blobstore/disk.rs +++ b/crates/transaction-pool/src/blobstore/disk.rs @@ -1,11 +1,11 @@ //! A simple diskstore for blobs use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize}; +use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::{TxHash, B256}; use alloy_rlp::{Decodable, Encodable}; use parking_lot::{Mutex, RwLock}; use reth_primitives::BlobTransactionSidecar; -use reth_rpc_types::BlobAndProofV1; use schnellru::{ByLength, LruMap}; use std::{collections::HashSet, fmt, fs, io, path::PathBuf, sync::Arc}; use tracing::{debug, trace}; diff --git a/crates/transaction-pool/src/blobstore/mem.rs b/crates/transaction-pool/src/blobstore/mem.rs index ebde21fb4dab..15160c2c3fad 100644 --- a/crates/transaction-pool/src/blobstore/mem.rs +++ b/crates/transaction-pool/src/blobstore/mem.rs @@ -1,9 +1,9 @@ use crate::blobstore::{ BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobStoreSize, BlobTransactionSidecar, }; +use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::B256; use parking_lot::RwLock; -use reth_rpc_types::BlobAndProofV1; use std::{collections::HashMap, sync::Arc}; /// An in-memory blob store. diff --git a/crates/transaction-pool/src/blobstore/mod.rs b/crates/transaction-pool/src/blobstore/mod.rs index 3f38b41f4cb0..d127b3e8e67d 100644 --- a/crates/transaction-pool/src/blobstore/mod.rs +++ b/crates/transaction-pool/src/blobstore/mod.rs @@ -1,11 +1,11 @@ //! Storage for blob data of EIP4844 transactions. +use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::B256; pub use disk::{DiskFileBlobStore, DiskFileBlobStoreConfig, OpenDiskFileBlobStore}; pub use mem::InMemoryBlobStore; pub use noop::NoopBlobStore; use reth_primitives::BlobTransactionSidecar; -use reth_rpc_types::BlobAndProofV1; use std::{ fmt, sync::atomic::{AtomicUsize, Ordering}, diff --git a/crates/transaction-pool/src/blobstore/noop.rs b/crates/transaction-pool/src/blobstore/noop.rs index e8d2931730ca..0e99858bd627 100644 --- a/crates/transaction-pool/src/blobstore/noop.rs +++ b/crates/transaction-pool/src/blobstore/noop.rs @@ -1,6 +1,6 @@ use crate::blobstore::{BlobStore, BlobStoreCleanupStat, BlobStoreError, BlobTransactionSidecar}; +use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::B256; -use reth_rpc_types::BlobAndProofV1; /// A blobstore implementation that does nothing #[derive(Clone, Copy, Debug, PartialOrd, PartialEq, Eq, Default)] diff --git a/crates/transaction-pool/src/lib.rs b/crates/transaction-pool/src/lib.rs index bd734e18b31a..2af1a025c734 100644 --- a/crates/transaction-pool/src/lib.rs +++ b/crates/transaction-pool/src/lib.rs @@ -151,12 +151,12 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] use crate::{identifier::TransactionId, pool::PoolInner}; +use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::{Address, TxHash, B256, U256}; use aquamarine as _; use reth_eth_wire_types::HandleMempoolData; use reth_execution_types::ChangedAccount; use reth_primitives::{BlobTransactionSidecar, PooledTransactionsElement}; -use reth_rpc_types::BlobAndProofV1; use reth_storage_api::StateProviderFactory; use std::{collections::HashSet, sync::Arc}; use tokio::sync::mpsc::Receiver; diff --git a/crates/transaction-pool/src/noop.rs b/crates/transaction-pool/src/noop.rs index e4055bd5225b..9ca639427b63 100644 --- a/crates/transaction-pool/src/noop.rs +++ b/crates/transaction-pool/src/noop.rs @@ -16,10 +16,10 @@ use crate::{ PooledTransactionsElement, PropagatedTransactions, TransactionEvents, TransactionOrigin, TransactionPool, TransactionValidationOutcome, TransactionValidator, ValidPoolTransaction, }; +use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::{Address, TxHash, B256, U256}; use reth_eth_wire_types::HandleMempoolData; use reth_primitives::BlobTransactionSidecar; -use reth_rpc_types::BlobAndProofV1; use std::{collections::HashSet, marker::PhantomData, sync::Arc}; use tokio::sync::{mpsc, mpsc::Receiver}; diff --git a/crates/transaction-pool/src/traits.rs b/crates/transaction-pool/src/traits.rs index c0e5fae154a0..0f4ca5d96c1a 100644 --- a/crates/transaction-pool/src/traits.rs +++ b/crates/transaction-pool/src/traits.rs @@ -7,6 +7,7 @@ use crate::{ validate::ValidPoolTransaction, AllTransactionsEvents, }; +use alloy_eips::eip4844::BlobAndProofV1; use alloy_primitives::{Address, TxHash, TxKind, B256, U256}; use futures_util::{ready, Stream}; use reth_eth_wire_types::HandleMempoolData; @@ -17,7 +18,6 @@ use reth_primitives::{ PooledTransactionsElementEcRecovered, SealedBlock, Transaction, TransactionSignedEcRecovered, EIP1559_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID, }; -use reth_rpc_types::BlobAndProofV1; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use std::{