Question about /block endpoint

description in the

When requesting a block by the hash component of the BlockIdentifier, this request MUST be idempotent: repeated invocations for the same hash-identified block must return the exact same block contents.

There is a situation, on the best chain, block A can be obtained at time A by block_hash_a, but at time B block A may not be obtained by block_hash_a (at time B the block with block_hash_a not on the best chain). What should we do with this situation? need to save forked blocks manually?

Another great question, @kingstone!

We will not attempt to re-fetch any blocks that have been orphaned during a re-org in the rosetta-cli or in any potential integration. This “idempotency” clarification was added for some teams that had questions about “idempotency” for blocks in the best chain.

If you want to save orphaned blocks for query, I think that would be awesome (reading orphaned blocks can be useful for some analysis)! However, it is ok if you error on requests for orphaned blocks.

1 Like

I got it very helpful, thanks.