Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc: rm useless alloy_rpc_types_trace reexport #11096

Merged
merged 18 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/rpc/rpc-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ alloy-eips.workspace = true
alloy-json-rpc.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true
alloy-rpc-types-txpool.workspace = true

# misc
Expand Down
12 changes: 4 additions & 8 deletions crates/rpc/rpc-api/src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
use alloy_primitives::{Address, Bytes, B256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::geth::{
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{BlockId, BlockNumberOrTag};
use reth_rpc_types::{
debug::ExecutionWitness,
trace::geth::{
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace,
TraceResult,
},
Block, Bundle, StateContext,
};
use reth_rpc_types::{debug::ExecutionWitness, Block, Bundle, StateContext};

/// Debug rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "debug"))]
Expand Down
12 changes: 5 additions & 7 deletions crates/rpc/rpc-api/src/otterscan.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, Bytes, TxHash, B256};
use alloy_rpc_types_trace::otterscan::{
BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry,
TransactionsWithReceipts,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
use reth_rpc_types::{
trace::otterscan::{
BlockDetails, ContractCreator, InternalOperation, OtsBlockTransactions, TraceEntry,
TransactionsWithReceipts,
},
Header,
};
use reth_rpc_types::Header;

/// Otterscan rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "ots"))]
Expand Down
15 changes: 6 additions & 9 deletions crates/rpc/rpc-api/src/trace.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
parity::*,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
use reth_rpc_types::{
state::StateOverride,
trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
parity::*,
},
BlockOverrides, Index,
};
use reth_rpc_types::{state::StateOverride, BlockOverrides, Index};
use std::collections::HashSet;

/// Ethereum trace API
Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ reth-rpc-types-compat.workspace = true

alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true

tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
serde_json.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions crates/rpc/rpc-builder/tests/it/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use crate::utils::{launch_http, launch_http_ws, launch_ws};
use alloy_primitives::{hex_literal::hex, Address, Bytes, TxHash, B256, B64, U256, U64};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::filter::TraceFilter;
use jsonrpsee::{
core::{
client::{ClientT, SubscriptionClientT},
Expand All @@ -22,8 +23,8 @@ use reth_rpc_api::{
};
use reth_rpc_server_types::RethRpcModule;
use reth_rpc_types::{
trace::filter::TraceFilter, Block, FeeHistory, Filter, Index, Log,
PendingTransactionFilterKind, SyncStatus, Transaction, TransactionReceipt,
Block, FeeHistory, Filter, Index, Log, PendingTransactionFilterKind, SyncStatus, Transaction,
TransactionReceipt,
};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_json::Value;
Expand Down
2 changes: 2 additions & 0 deletions crates/rpc/rpc-testing-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ reth-rpc-api = { workspace = true, features = ["client"] }
# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true

# async
futures.workspace = true
Expand All @@ -35,3 +36,4 @@ similar-asserts.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "rt"] }
reth-rpc-eth-api.workspace = true
jsonrpsee-http-client.workspace = true
alloy-rpc-types-trace.workspace = true
14 changes: 6 additions & 8 deletions crates/rpc/rpc-testing-util/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@ use std::{

use alloy_primitives::{TxHash, B256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
common::TraceResult,
geth::{GethDebugTracerType, GethDebugTracingOptions, GethTrace},
};
use futures::{Stream, StreamExt};
use jsonrpsee::core::client::Error as RpcError;
use reth_primitives::{BlockId, Receipt};
use reth_rpc_api::{clients::DebugApiClient, EthApiClient};
use reth_rpc_types::{
trace::{
common::TraceResult,
geth::{GethDebugTracerType, GethDebugTracingOptions, GethTrace},
},
Block, Transaction,
};
use reth_rpc_types::{Block, Transaction};

const NOOP_TRACER: &str = include_str!("../assets/noop-tracer.js");
const JS_TRACER_TEMPLATE: &str = include_str!("../assets/tracer-template.js");
Expand Down Expand Up @@ -378,9 +376,9 @@ mod tests {
debug::{DebugApiExt, JsTracerBuilder, NoopJsTracer},
utils::parse_env_url,
};
use alloy_rpc_types_trace::geth::{CallConfig, GethDebugTracingOptions};
use futures::StreamExt;
use jsonrpsee::http_client::HttpClientBuilder;
use reth_rpc_types::trace::geth::{CallConfig, GethDebugTracingOptions};

// random tx <https://sepolia.etherscan.io/tx/0x5525c63a805df2b83c113ebcc8c7672a3b290673c4e81335b410cd9ebc64e085>
const TX_1: &str = "0x5525c63a805df2b83c113ebcc8c7672a3b290673c4e81335b410cd9ebc64e085";
Expand Down
16 changes: 7 additions & 9 deletions crates/rpc/rpc-testing-util/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@

use alloy_primitives::{Bytes, TxHash, B256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
filter::TraceFilter,
parity::{LocalizedTransactionTrace, TraceResults, TraceType},
tracerequest::TraceCallRequest,
};
use futures::{Stream, StreamExt};
use jsonrpsee::core::client::Error as RpcError;
use reth_primitives::BlockId;
use reth_rpc_api::clients::TraceApiClient;
use reth_rpc_types::{
trace::{
filter::TraceFilter,
parity::{LocalizedTransactionTrace, TraceResults, TraceType},
tracerequest::TraceCallRequest,
},
Index,
};
use reth_rpc_types::Index;
use std::{
collections::HashSet,
pin::Pin,
Expand Down Expand Up @@ -517,9 +515,9 @@ where
#[cfg(test)]
mod tests {
use super::*;
use alloy_rpc_types_trace::filter::TraceFilterMode;
use jsonrpsee::http_client::HttpClientBuilder;
use reth_primitives::BlockNumberOrTag;
use reth_rpc_types::trace::filter::TraceFilterMode;

const fn assert_is_stream<St: Stream>(_: &St) {}

Expand Down
8 changes: 4 additions & 4 deletions crates/rpc/rpc-testing-util/tests/it/trace.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//! Integration tests for the trace API.

use alloy_rpc_types_trace::{
filter::TraceFilter, parity::TraceType, tracerequest::TraceCallRequest,
};
use futures::StreamExt;
use jsonrpsee::http_client::HttpClientBuilder;
use jsonrpsee_http_client::HttpClient;
use reth_primitives::Receipt;
use reth_rpc_api_testing_util::{debug::DebugApiExt, trace::TraceApiExt, utils::parse_env_url};
use reth_rpc_eth_api::EthApiClient;
use reth_rpc_types::{
trace::{filter::TraceFilter, parity::TraceType, tracerequest::TraceCallRequest},
Block, Transaction,
};
use reth_rpc_types::{Block, Transaction};
use std::{collections::HashSet, time::Instant};

/// This is intended to be run locally against a running node.
Expand Down
1 change: 0 additions & 1 deletion crates/rpc/rpc-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ alloy-rpc-types-admin.workspace = true
alloy-rpc-types-anvil.workspace = true
alloy-rpc-types-beacon = { workspace = true, optional = true }
alloy-rpc-types-mev.workspace = true
alloy-rpc-types-trace.workspace = true
alloy-rpc-types-debug.workspace = true
alloy-serde.workspace = true
alloy-rpc-types-engine = { workspace = true, features = ["std", "serde", "jsonrpsee-types"], optional = true }
Expand Down
5 changes: 0 additions & 5 deletions crates/rpc/rpc-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ pub use alloy_rpc_types::*;
// Ethereum specific serde types coming from alloy.
pub use alloy_serde::*;

pub mod trace {
//! RPC types for trace endpoints and inspectors.
pub use alloy_rpc_types_trace::*;
}

// re-export admin
pub use alloy_rpc_types_admin as admin;

Expand Down
1 change: 1 addition & 0 deletions crates/rpc/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ alloy-network.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true
alloy-rpc-types-txpool.workspace = true
revm = { workspace = true, features = [
"optional_block_gas_limit",
Expand Down
13 changes: 6 additions & 7 deletions crates/rpc/rpc/src/debug.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_rlp::{Decodable, Encodable};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::geth::{
BlockTraceResult, FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerType,
GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, NoopFrame, TraceResult,
};
use async_trait::async_trait;
use jsonrpsee::core::RpcResult;
use reth_chainspec::{ChainSpec, EthereumHardforks};
Expand All @@ -22,13 +26,8 @@ use reth_rpc_eth_api::{
use reth_rpc_eth_types::{EthApiError, StateCacheDb};
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
use reth_rpc_types::{
debug::ExecutionWitness,
state::EvmOverrides,
trace::geth::{
BlockTraceResult, FourByteFrame, GethDebugBuiltInTracerType, GethDebugTracerType,
GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, NoopFrame, TraceResult,
},
Block as RpcBlock, BlockError, Bundle, StateContext,
debug::ExecutionWitness, state::EvmOverrides, Block as RpcBlock, BlockError, Bundle,
StateContext,
};
use reth_tasks::pool::BlockingTaskGuard;
use reth_trie::{HashedPostState, HashedStorage};
Expand Down
18 changes: 8 additions & 10 deletions crates/rpc/rpc/src/otterscan.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use alloy_network::{ReceiptResponse, TransactionResponse};
use alloy_primitives::{Address, Bytes, TxHash, B256, U256};
use alloy_rpc_types_trace::{
otterscan::{
BlockDetails, ContractCreator, InternalOperation, OperationType, OtsBlockTransactions,
OtsReceipt, OtsTransactionReceipt, TraceEntry, TransactionsWithReceipts,
},
parity::{Action, CreateAction, CreateOutput, TraceOutput},
};
use async_trait::async_trait;
use jsonrpsee::{core::RpcResult, types::ErrorObjectOwned};
use reth_primitives::{BlockId, BlockNumberOrTag};
Expand All @@ -10,16 +17,7 @@ use reth_rpc_eth_api::{
};
use reth_rpc_eth_types::{utils::binary_search, EthApiError};
use reth_rpc_server_types::result::internal_rpc_err;
use reth_rpc_types::{
trace::{
otterscan::{
BlockDetails, ContractCreator, InternalOperation, OperationType, OtsBlockTransactions,
OtsReceipt, OtsTransactionReceipt, TraceEntry, TransactionsWithReceipts,
},
parity::{Action, CreateAction, CreateOutput, TraceOutput},
},
BlockTransactions, Header, TransactionReceipt,
};
use reth_rpc_types::{BlockTransactions, Header, TransactionReceipt};
use revm_inspectors::{
tracing::{types::CallTraceNode, TracingInspectorConfig},
transfer::{TransferInspector, TransferKind},
Expand Down
12 changes: 6 additions & 6 deletions crates/rpc/rpc/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ use std::{collections::HashSet, sync::Arc};

use alloy_primitives::{Bytes, B256, U256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_rpc_types_trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
parity::*,
tracerequest::TraceCallRequest,
};
use async_trait::async_trait;
use jsonrpsee::core::RpcResult;
use reth_chainspec::{ChainSpec, EthereumHardforks};
Expand All @@ -20,12 +26,6 @@ use reth_rpc_eth_api::{
use reth_rpc_eth_types::{error::EthApiError, utils::recover_raw_transaction};
use reth_rpc_types::{
state::{EvmOverrides, StateOverride},
trace::{
filter::TraceFilter,
opcode::{BlockOpcodeGas, TransactionOpcodeGas},
parity::*,
tracerequest::TraceCallRequest,
},
BlockOverrides, Index,
};
use reth_tasks::pool::BlockingTaskGuard;
Expand Down
1 change: 1 addition & 0 deletions examples/txpool-tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ license.workspace = true
[dependencies]
reth.workspace = true
reth-node-ethereum.workspace = true
alloy-rpc-types-trace.workspace = true
clap = { workspace = true, features = ["derive"] }
futures-util.workspace = true
6 changes: 2 additions & 4 deletions examples/txpool-tracing/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@

#![cfg_attr(not(test), warn(unused_crate_dependencies))]

use alloy_rpc_types_trace::{parity::TraceType, tracerequest::TraceCallRequest};
use clap::Parser;
use futures_util::StreamExt;
use reth::{
args::utils::DefaultChainSpecParser,
builder::NodeHandle,
cli::Cli,
primitives::{Address, IntoRecoveredTransaction},
rpc::{
compat::transaction::transaction_to_call_request,
types::trace::{parity::TraceType, tracerequest::TraceCallRequest},
},
rpc::compat::transaction::transaction_to_call_request,
transaction_pool::TransactionPool,
};
use reth_node_ethereum::node::EthereumNode;
Expand Down
Loading