Follow archive callbacks when reading ICRC-3 blocks
One icrc3_get_blocks request can span an archive boundary. An indexer must process the returned callback descriptors alongside inline blocks.
Track requested block IDs
Suppose the requested range starts at 980 and has length 40. If the ledger returns the last twenty blocks inline, follow the archived_blocks descriptors with their provided ranges and callback methods for the earlier portion. Associate each returned block with its declared ID before merging results.
requested: start 980, length 40
archive callback range: 980..999
inline block IDs: 1000..1019
Advance only past contiguous data
A callback timeout can leave block 999 missing while block 1019 is already present. Persist the gap and advance the durable cursor only when preceding IDs are complete. Retrieving all IDs establishes coverage. Cryptographic verification additionally requires checking the ledger's certified tip and block chain.