diff --git a/crates/rpc/rpc-api/src/engine.rs b/crates/rpc/rpc-api/src/engine.rs index 986dd76b14ab..01451e4a9a84 100644 --- a/crates/rpc/rpc-api/src/engine.rs +++ b/crates/rpc/rpc-api/src/engine.rs @@ -13,7 +13,8 @@ use reth_rpc_types::{ ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, TransitionConfiguration, }, state::StateOverride, - BlockOverrides, Filter, Log, RichBlock, SyncStatus, TransactionRequest, + BlockOverrides, EIP1186AccountProofResponse, Filter, JsonStorageKey, Log, RichBlock, + 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. @@ -264,4 +265,14 @@ pub trait EngineEthApi { /// Returns logs matching given filter object. #[method(name = "getLogs")] async fn logs(&self, filter: Filter) -> RpcResult>; + + /// Returns the account and storage values of the specified account including the Merkle-proof. + /// This call can be used to verify that the data you are pulling from is not tampered with. + #[method(name = "getProof")] + async fn get_proof( + &self, + address: Address, + keys: Vec, + block_number: Option, + ) -> RpcResult; } diff --git a/crates/rpc/rpc/src/engine.rs b/crates/rpc/rpc/src/engine.rs index 63f3bfaab4b2..71d4ff94130e 100644 --- a/crates/rpc/rpc/src/engine.rs +++ b/crates/rpc/rpc/src/engine.rs @@ -4,7 +4,8 @@ use reth_rpc_api::{EngineEthApiServer, EthApiServer, EthFilterApiServer}; /// Re-export for convenience pub use reth_rpc_engine_api::EngineApi; use reth_rpc_types::{ - state::StateOverride, BlockOverrides, Filter, Log, RichBlock, SyncStatus, TransactionRequest, + state::StateOverride, BlockOverrides, EIP1186AccountProofResponse, Filter, JsonStorageKey, Log, + RichBlock, SyncStatus, TransactionRequest, }; use tracing_futures::Instrument; @@ -98,4 +99,14 @@ where async fn logs(&self, filter: Filter) -> Result> { self.eth_filter.logs(filter).instrument(engine_span!()).await } + + /// Handler for `eth_getProof` + async fn get_proof( + &self, + address: Address, + keys: Vec, + block_number: Option, + ) -> Result { + self.eth.get_proof(address, keys, block_number).instrument(engine_span!()).await + } }