Rationale
eth_getTransactionByHash returns the transaction together with blockHash and blockNumber once it is mined, but it does not include the block timestamp.
As a result, clients must issue an additional RPC call (eth_getBlockByHash or eth_getBlockByNumber) to retrieve the timestamp, even though this information is already known by the node at that point.
This extra round-trip significantly increases latency and RPC load for a very common access pattern.
Use-cases include:
- Wallets displaying transaction history with timestamps
- NFT marketplaces and indexers tracking transfers
- Block explorers and analytics tools
- Mobile or high-latency clients where minimizing RPC calls is important
Including the timestamp directly would improve performance, simplify client code, and reduce unnecessary RPC traffic.
Implementation
A possible implementation would be to add an optional field to the eth_getTransaction* response, for example:
"blockTimestamp": "0x6565f1a0"
- Present only for mined transactions
null or omitted for pending transactions
- Encoded in the same hex format as block timestamps in
eth_getBlockBy*
This change would be fully backward-compatible, as it only adds a new field.
RPC methods affected:
eth_getTransactionByHash
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getBlockByHash
eth_getBlockByNumber
Orignally from ethereum/go-ethereum#33491
Rationale
eth_getTransactionByHashreturns the transaction together withblockHashandblockNumberonce it is mined, but it does not include the block timestamp.As a result, clients must issue an additional RPC call (
eth_getBlockByHashoreth_getBlockByNumber) to retrieve the timestamp, even though this information is already known by the node at that point.This extra round-trip significantly increases latency and RPC load for a very common access pattern.
Use-cases include:
Including the timestamp directly would improve performance, simplify client code, and reduce unnecessary RPC traffic.
Implementation
A possible implementation would be to add an optional field to the
eth_getTransaction*response, for example:nullor omitted for pending transactionseth_getBlockBy*This change would be fully backward-compatible, as it only adds a new field.
RPC methods affected:
eth_getTransactionByHasheth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_getBlockByHasheth_getBlockByNumberOrignally from ethereum/go-ethereum#33491