Skip to content

About use of eth_getBlockReceipts JSON RPC for cryo txs #93

@cool-mestorf

Description

@cool-mestorf

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

  1. implement workaround when eth_getBlockReceipts errors - iterating over transaction hashes and call eth_getTransactionReceipt. This will emit much more RPC calls than the original solution, but is considerable if it is better than failing.
  2. When eth_getBlockReceipts errors leave receipt field None, and if --exclude-failed option was supplied, panic on transform step

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 txs from cryo receipts - but this would not help much for users to overcome this issue but increase product's complexity.

Additional context

If specs are fixed, I would be happy if I can submit a PR to implement the fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions