I’ll expand a bit on the Bogdan’s answer:
The main ledger canister only stores 1-2K of blocks and everything else is sent to “ledger archive” canisters.
The client is supposed to
- Fetch the assignment of blocks to canisters.
- Route block fetch requests appropriately.
The issue is that the assignment of the most recent blocks might change while the step (2) is being executed. This interface is error prone and hard to use.
One part of the initiative to allow canisters transfer ICPs is to provide a stable, properly designed Candid interface for ledger. The first version of the interface will only contain
account_balance methods, but we’re planning to extend it to expose all capabilities of ledger.
We’ll later add a block syncing interface that doesn’t use the error-prone communication pattern mentioned above. It will be a single method (something like
fetch_blocks_since : (Height, Limit) -> (FetchBlocksResponse) query).
The result will contain
- The tip of the chain (with optional certification).
- Blocks in the specified range stored by the Ledger.
- If some blocks are archived, the result will contain a mapping from block ranges to functions that fetch them.
Unfortunately, I don’t have an ETA for the block fetching interface now.