Skip to content
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

eth, internal: add debug_getBlockReceipts #23277

Closed
wants to merge 1 commit into from

Conversation

tn606024
Copy link

Implements a new RPC API: debug_getBlockReceipts. It returns receipts by block hash.

eth/api.go Outdated Show resolved Hide resolved
eth/api.go Outdated Show resolved Hide resolved
@tn606024
Copy link
Author

@holiman Thanks for your review. The PR is updated.

@MariusVanDerWijden
Copy link
Member

Hey @tn606024 we've been discussing this PR internally today.
Basically what you're trying to do is possible (just really inefficient) today.
You can get all transaction hashes and then get the receipts for each transactions.
This of course increases the amount of RPC-Calls ~100 fold.
However since it is technically possible we are a bit reluctant to merge this.

There is now an initiative to standardize all RPC-calls over at https://github.com/ethereum/execution-apis.
Since we have a lot of RPC-Api's that are non-standard, we would like to only merge standardized APIs in the future.
So if you really need this API you should push to standardize it over at the execution-apis repo.
There's also a json-rpc-api channel on the ethereum R&D discord that you should join

@s1na
Copy link
Contributor

s1na commented Jan 13, 2022

You can get a much better performance by using graphql. I tried getting all receipts for 25 recent mainnet blocks via REST and graphql. The time difference was 22s vs 0.5s!

You can find my scripts here: https://gist.github.com/s1na/bc0ca056d00ede379c7e800bdd65af2c

To reproduce it add the --graphql flag to your node and do:

curl -X POST http://localhost:8545/graphql -H "Content-Type: application/json" --data '@block-receipts.query'

Closing the PR as in my opinion given that performance adding a new method is not warranted. Please feel free to re-open if you can't reproduce my results or this is somehow not applicable to your use-case.

@s1na s1na closed this Jan 13, 2022
@s1na s1na mentioned this pull request Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants