-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsonrpc: add eth_getBlockReceipt #393
Comments
This is very important feature for many explorers as well. Sorry for the tag guys, but can we get more attention to this problem? @lightclient @holiman @fjl |
I'm definitely in favor of adding this! |
It should be called |
Thanks, @fjl, so I'll implement it similarly to Erigon's. |
btw, Erigon has two RPCS
ref: cmd/rpcdaemon/README So I propose to add ONE RPC( |
Because of the lack of a standard here, the OP-Stack currently has to support 6 different receipt-fetching methods, to efficiently retrieve receipts from a L1 Ethereum node. +1 on requiring a blockhash argument. Erigon is a weird exception there currently we had to work around. Block-hash arguments allow RPC result caching of receipts. Note that individual receipts match a tx, but cannot be cached due to the block-inclusion metadata & tx-replay on reorgs. But full-block receipt fetching can be cached by blockhash very well. 👍 for defining a standard |
I think the issue can be closed, as the functionality implemented - ethereum/go-ethereum#27702 |
But was it added to the spec? |
Looks like this was added to the spec in #438, so closing this issue then. |
Motivation
Currently, the way we obtain complete information about all transactions in a block is as follows:
eth_getBlockBy{Number,Hash}
to retrieve all transaction data for a block;eth_getTransactionReceipt
to retrieve the receipt data for each transaction.This method is highly inefficient for obtaining large amounts of block and transaction data. To make it easier for users, we propose an RPC that returns all the receipt data for a block in one call.
Parity/OpenEthereum(DEPRECATED) has already implemented this method under the
parity
namespace(parity_getblockreceipts), and some node providers(eg: alchemy eth_getBlockReceipts) have provided similar solutions. If we can include this RPC in the standard, I believe it would be more consistent and user-friendly for users.Spec
Here is the spec for
eth_getBlockReceiptsBy{Number,Hash}
eth_getBlockReceiptsByNumber {#eth_getBlockReceiptsByNumber}
Returns information about a block receipts by block number.
Parameters
Quantity or Tag
- integer of a block number, or the string 'earliest', 'latest' or 'pending', as in the default block parameter.Returns
Array
- The list of Receipt object of the given block:eg:
eth_getBlockReceiptsByHash {#eth_getBlockReceiptsByHash}
Returns information about a block receipts by block hash.
Parameters
DATA
, 32 Bytes - hash of a blockReturns
Array
- The list of Receipt object of the given block:eg:
The text was updated successfully, but these errors were encountered: