diff --git a/Cargo.toml b/Cargo.toml index e56fc1b..29265c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,6 +77,9 @@ reth-prune-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" } reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" } reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" } +# adjacent reth revm inspectors +revm-inspectors = "0.17.0-alpha.1" + # Foundry periphery foundry-blob-explorers = "0.10" diff --git a/crates/rpc/Cargo.toml b/crates/rpc/Cargo.toml index 54e9833..d8f0c2d 100644 --- a/crates/rpc/Cargo.toml +++ b/crates/rpc/Cargo.toml @@ -23,6 +23,7 @@ reth-chainspec.workspace = true reth-evm-ethereum.workspace = true reth-node-api.workspace = true reth-rpc-eth-api.workspace = true +revm-inspectors.workspace = true axum = "0.8.1" dashmap = "6.1.0" diff --git a/crates/rpc/src/debug/endpoints.rs b/crates/rpc/src/debug/endpoints.rs new file mode 100644 index 0000000..b084880 --- /dev/null +++ b/crates/rpc/src/debug/endpoints.rs @@ -0,0 +1,29 @@ +use crate::{Pnt, RpcCtx}; +use ajj::HandlerCtx; +use alloy::{eips::BlockNumberOrTag, primitives::B256}; +use reth::rpc::types::trace::geth::GethDebugTracingOptions; +use reth_node_api::FullNodeComponents; + +pub(super) async fn trace_transaction( + _hctx: HandlerCtx, + (_tx_hash, _opts): (B256, GethDebugTracingOptions), + _ctx: RpcCtx, +) -> Result<(), String> +where + Host: FullNodeComponents, + Signet: Pnt, +{ + Ok(()) +} + +pub(super) async fn trace_block_by_number( + _hctx: HandlerCtx, + (_block, _opts): (BlockNumberOrTag, Option), + _ctx: RpcCtx, +) -> Result<(), String> +where + Host: FullNodeComponents, + Signet: Pnt, +{ + Ok(()) +} diff --git a/crates/rpc/src/debug/mod.rs b/crates/rpc/src/debug/mod.rs new file mode 100644 index 0000000..defbd8a --- /dev/null +++ b/crates/rpc/src/debug/mod.rs @@ -0,0 +1,16 @@ +mod endpoints; +use endpoints::*; +use reth_node_api::FullNodeComponents; + +use crate::{Pnt, RpcCtx}; + +/// Instantiate the debug router. +pub fn debug() -> ajj::Router> +where + Host: FullNodeComponents, + Signet: Pnt, +{ + ajj::Router::new() + .route("traceTransaction", trace_transaction) + .route("traceBlockByNumber", trace_block_by_number) +} diff --git a/crates/rpc/src/lib.rs b/crates/rpc/src/lib.rs index e64e99f..195f86f 100644 --- a/crates/rpc/src/lib.rs +++ b/crates/rpc/src/lib.rs @@ -60,6 +60,12 @@ pub use eth::{eth, CallErrorData, EthError}; mod signet; pub use signet::{error::SignetError, signet}; +mod debug; +pub use debug::debug; + +mod trace; +pub use trace::trace; + mod interest; pub mod receipts; @@ -80,5 +86,9 @@ where Host: FullNodeComponents, Signet: Pnt, { - ajj::Router::new().nest("eth", eth::()).nest("signet", signet::()) + ajj::Router::new() + .nest("eth", eth::()) + .nest("signet", signet::()) + .nest("debug", debug::()) + .nest("trace", trace::()) } diff --git a/crates/rpc/src/trace/endpoints.rs b/crates/rpc/src/trace/endpoints.rs new file mode 100644 index 0000000..e1a56aa --- /dev/null +++ b/crates/rpc/src/trace/endpoints.rs @@ -0,0 +1,29 @@ +use crate::{Pnt, RpcCtx}; +use ajj::HandlerCtx; +use alloy::{eips::BlockId, primitives::map::foldhash::HashSet}; +use reth::rpc::types::trace::parity::TraceType; +use reth_node_api::FullNodeComponents; + +pub(super) async fn trace_block( + _hctx: HandlerCtx, + _block_id: BlockId, + _ctx: RpcCtx, +) -> Result<(), String> +where + Host: FullNodeComponents, + Signet: Pnt, +{ + Ok(()) +} + +pub(super) async fn trace_replay_block_transactions( + _hctx: HandlerCtx, + (_block_id, _trace_types): (BlockId, HashSet), + _ctx: RpcCtx, +) -> Result<(), String> +where + Host: FullNodeComponents, + Signet: Pnt, +{ + Ok(()) +} diff --git a/crates/rpc/src/trace/mod.rs b/crates/rpc/src/trace/mod.rs new file mode 100644 index 0000000..c8ffc1a --- /dev/null +++ b/crates/rpc/src/trace/mod.rs @@ -0,0 +1,16 @@ +mod endpoints; +use endpoints::*; + +use crate::{ctx::RpcCtx, Pnt}; +use reth_node_api::FullNodeComponents; + +/// Instantiate the `trace` API router. +pub fn trace() -> ajj::Router> +where + Host: FullNodeComponents, + Signet: Pnt, +{ + ajj::Router::new() + .route("block", trace_block) + .route("replayBlockTransactions", trace_replay_block_transactions) +}