-
Notifications
You must be signed in to change notification settings - Fork 167
Description
Is your feature request related to a problem? Please describe.
Use of new JSON RPC API - eth_getBlockRecipts broke some scripts that worked before, especially for other chains that forked ethereum's execution clients (apparently geth) complying with most of JSON RPC specs but not very up-to-date. Tested on optimism & arbitrum, for official mainnet sequencer rpc endpoints.
$ cast rpc eth_getBlockReceipts 0x6A31748 --rpc-url https://mainnet.optimism.io
Error:
(code: -32001, message: rpc method is not whitelisted, data: None)
$ cast rpc eth_getBlockReceipts 0x896C1CB --rpc-url https://arb1.arbitrum.io/rpc
Error:
(code: -32601, message: the method eth_getBlockReceipts does not exist/is not available, data: None)
This problem occured after merge of #89 which was introduced to filter out reverted txs (#46). While this feature will be indeed crucial and very useful for majority of cryo users, I have some doubts about its current specification and implementation.
First, eth_getBlockReceipts was standarized recently. While almost every execution clients implement the method on ethereum, I found most of other evm-like chains and its execution clients do not have the method. The only chain I found implementing this method aside from ethereum was bnb.
Second, in terms of clarifying which data the user wants to extract, the status, gas_used and transaction_index etc. are actually properties of receipts, not txs. If only raw transaction data is needed for certain analysis, fetching receipts causes unnecessary overhead. (Still, I think there are very few analysis can be done with tx data without receipts) This is important because while there were receipt related properties on transaction schema before, it was considered optional, but current implementation for --exclude-failed seems to force fetching receipts and fails if fetching receipt errors whether the option is supplied or not.
Describe the solution you'd like
- implement workaround when
eth_getBlockReceiptserrors - iterating over transaction hashes and calleth_getTransactionReceipt. This will emit much more RPC calls than the original solution, but is considerable if it is better than failing. - When
eth_getBlockReceiptserrors leave receipt field None, and if--exclude-failedoption was supplied, panic ontransformstep
Also, this RPC method will have to be mentioned on README.md as used method for fetching txs data.
Describe alternatives you've considered
- separating
cryo txsfromcryo receipts- but this would not help much for users to overcome this issue but increase product's complexity.
Additional context
- eth_getBlockReceipts spec, merged on Aug 15, spec introduced on Mar 26
If specs are fixed, I would be happy if I can submit a PR to implement the fix.