blockchainnearprotocolnear

Are chunk receipts reliable?


I am writing a block explorer in order to find deposits. I found out that there are two way for getting receipts.

  1. Receipts you get from chunk rpc call which have no status.
  2. Receipts you get from EXPERIMENTAL_tx_status which have status.

Can I end up with trouble if I consider first scenario valid? Do failed receipts stay on blockchain or not?

Unfortunately second scenario is slower, you have to query every tx of a block.

Thanks


Solution

  • The first scenario is legit unless you need a status. Receipts themselves cannot be successful or failed. The status is about the Execution of the receipt and only an ExecutionOutcome for a specific Receipt can have a status.

    In order to get just the Receipts is to grab them from chunk, but if you want to know statuses you'll need to come up with something else because there is no method to get the ExecutionOutcome through the RPC.

    You might want to consider writing an indexer