diff --git a/Cargo.lock b/Cargo.lock
index 0525c086cc..9fea3582ca 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5045,6 +5045,7 @@ dependencies = [
"reth-tasks",
"reth-transaction-pool",
"revm",
+ "revm-primitives",
"schnellru",
"secp256k1",
"serde",
diff --git a/crates/rpc/rpc-builder/tests/it/http.rs b/crates/rpc/rpc-builder/tests/it/http.rs
index 2659660faa..dd0621fe01 100644
--- a/crates/rpc/rpc-builder/tests/it/http.rs
+++ b/crates/rpc/rpc-builder/tests/it/http.rs
@@ -98,7 +98,6 @@ where
// Unimplemented
assert!(is_unimplemented(EthApiClient::author(client).await.err().unwrap()));
- assert!(is_unimplemented(EthApiClient::transaction_receipt(client, hash).await.err().unwrap()));
assert!(is_unimplemented(EthApiClient::gas_price(client).await.err().unwrap()));
assert!(is_unimplemented(EthApiClient::max_priority_fee_per_gas(client).await.err().unwrap()));
assert!(is_unimplemented(EthApiClient::is_mining(client).await.err().unwrap()));
diff --git a/crates/rpc/rpc-types/src/eth/log.rs b/crates/rpc/rpc-types/src/eth/log.rs
index 06becfe555..68e370dea6 100644
--- a/crates/rpc/rpc-types/src/eth/log.rs
+++ b/crates/rpc/rpc-types/src/eth/log.rs
@@ -28,6 +28,24 @@ pub struct Log {
pub removed: bool,
}
+impl Log {
+ /// Creates a new rpc Log from a primitive log type from DB
+ pub fn from_primitive(log: reth_primitives::Log) -> Self {
+ Self {
+ address: log.address,
+ topics: log.topics,
+ data: log.data,
+ block_hash: None,
+ block_number: None,
+ transaction_hash: None,
+ transaction_index: None,
+ log_index: None,
+ transaction_log_index: None,
+ removed: false,
+ }
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;
diff --git a/crates/rpc/rpc-types/src/eth/transaction/receipt.rs b/crates/rpc/rpc-types/src/eth/transaction/receipt.rs
index 059556669e..a373d1b98e 100644
--- a/crates/rpc/rpc-types/src/eth/transaction/receipt.rs
+++ b/crates/rpc/rpc-types/src/eth/transaction/receipt.rs
@@ -1,4 +1,5 @@
-use reth_primitives::{rpc::Log, Address, Bloom, H256, U128, U256, U64};
+use crate::Log;
+use reth_primitives::{Address, Bloom, H256, U128, U256, U64};
use serde::{Deserialize, Serialize};
/// Transaction receipt
@@ -25,7 +26,7 @@ pub struct TransactionReceipt {
pub contract_address: Option
,
/// Logs emitted by this transaction.
pub logs: Vec,
- /// The state root
+ /// The post-transaction stateroot (pre Byzantium)
///
/// EIP98 makes this optional field, if it's missing then skip serializing it
#[serde(skip_serializing_if = "Option::is_none", rename = "root")]
diff --git a/crates/rpc/rpc/Cargo.toml b/crates/rpc/rpc/Cargo.toml
index 77ce298f54..30fe4953e7 100644
--- a/crates/rpc/rpc/Cargo.toml
+++ b/crates/rpc/rpc/Cargo.toml
@@ -27,6 +27,7 @@ reth-tasks = { path = "../../tasks" }
# eth
revm = { version = "3.0.0", features = ["optional_block_gas_limit"] }
ethers-core = { git = "https://github.com/gakonst/ethers-rs", features = ["eip712"] }
+revm-primitives = { version = "1.0", features = ["serde"] }
# rpc
diff --git a/crates/rpc/rpc/src/eth/api/server.rs b/crates/rpc/rpc/src/eth/api/server.rs
index b4451eb357..db5a3098e1 100644
--- a/crates/rpc/rpc/src/eth/api/server.rs
+++ b/crates/rpc/rpc/src/eth/api/server.rs
@@ -21,6 +21,7 @@ use reth_rpc_types::{
Work,
};
use reth_transaction_pool::TransactionPool;
+
use serde_json::Value;
use std::collections::BTreeMap;
use tracing::trace;
@@ -160,8 +161,9 @@ where
}
/// Handler for: `eth_getTransactionReceipt`
- async fn transaction_receipt(&self, _hash: H256) -> Result