diff --git a/crates/rpc/rpc-api/src/engine.rs b/crates/rpc/rpc-api/src/engine.rs index f78b8349be86..22dbc822ddfb 100644 --- a/crates/rpc/rpc-api/src/engine.rs +++ b/crates/rpc/rpc-api/src/engine.rs @@ -221,10 +221,12 @@ pub trait EngineApi { /// A subset of the ETH rpc interface: /// +/// This also includes additional eth functions required by optimism. +/// /// Specifically for the engine auth server: #[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))] #[cfg_attr(feature = "client", rpc(server, client, namespace = "eth"))] -pub trait EngineEthApi { +pub trait EngineEthApi { /// Returns an object with data about the sync status or false. #[method(name = "syncing")] fn syncing(&self) -> RpcResult; @@ -259,10 +261,18 @@ pub trait EngineEthApi { #[method(name = "getBlockByNumber")] async fn block_by_number(&self, number: BlockNumberOrTag, full: bool) -> RpcResult>; + /// Returns all transaction receipts for a given block. + #[method(name = "getBlockReceipts")] + async fn block_receipts(&self, block_id: BlockId) -> RpcResult>>; + /// Sends signed transaction, returning its hash. #[method(name = "sendRawTransaction")] async fn send_raw_transaction(&self, bytes: Bytes) -> RpcResult; + /// Returns the receipt of a transaction by transaction hash. + #[method(name = "getTransactionReceipt")] + async fn transaction_receipt(&self, hash: B256) -> RpcResult>; + /// Returns logs matching given filter object. #[method(name = "getLogs")] async fn logs(&self, filter: Filter) -> RpcResult>; diff --git a/crates/rpc/rpc/src/engine.rs b/crates/rpc/rpc/src/engine.rs index a9c316571acd..a398aad05f02 100644 --- a/crates/rpc/rpc/src/engine.rs +++ b/crates/rpc/rpc/src/engine.rs @@ -34,7 +34,7 @@ impl EngineEthApi { } #[async_trait::async_trait] -impl EngineEthApiServer> +impl EngineEthApiServer, RpcReceipt> for EngineEthApi where Eth: EthApiServer< @@ -103,11 +103,25 @@ where self.eth.block_by_number(number, full).instrument(engine_span!()).await } + async fn block_receipts( + &self, + block_id: BlockId, + ) -> Result>>> { + self.eth.block_receipts(block_id).instrument(engine_span!()).await + } + /// Handler for: `eth_sendRawTransaction` async fn send_raw_transaction(&self, bytes: Bytes) -> Result { self.eth.send_raw_transaction(bytes).instrument(engine_span!()).await } + async fn transaction_receipt( + &self, + hash: B256, + ) -> Result>> { + self.eth.transaction_receipt(hash).instrument(engine_span!()).await + } + /// Handler for `eth_getLogs` async fn logs(&self, filter: Filter) -> Result> { self.eth_filter.logs(filter).instrument(engine_span!()).await