The Mirror layer, sitting in front of the state machine, is already capable of tracking the network while the state machine is unresponsive or even absent.
Now we need to implement the path of the mirror replaying "old" (older than the most recently committed block) requests to the state machine.
This takes care of two primary usecases:
- Node is offline for a period
n blocks and needs to sync those block to rejoin consensus (live replay)
- Node is coming online for a live network and needs to sync all blocks from genesis to chain tip (live catchup)
Live catchup is akin to block sync in Comet terms. Starting from genesis or some previously saved state, the Mirror is many blocks behind the rest of the network, and simply observing the current consensus messages is insufficient to reach the current height.
We do not currently have an RPC or HTTP endpoint to serve old block headers nor those blocks' data (i.e. the transactions). There is a design decision to make about serving individual historical blocks, versus perhaps paging and compressing 100 or 1000 blocks at a time. This could mean, for example, at Height 750, heights 700-749 are retrievable individually, but you can only get the collections for 1-99, 100-199, etc.
Beyond the mechanism of transmitting historic block data, there is a secondary issue of host discovery. The two obvious options are 1) you have to know the address of a host who supports live catchup, and you provide their address(es) on the command line or to a config file, or 2) use a semi-centralized "rendezvous server" where "historic data hosts" can register as willing to host historic data to any client who needs it, and any client can perform a host lookup against that rendezvous server.
The first option is probably a subset of the second, so the first option is probably the appropriate choice for MVP.
Like live replay, live catchup is probably better implemented before data persistence. It can rely on in-memory storage to host data.
The Mirror layer, sitting in front of the state machine, is already capable of tracking the network while the state machine is unresponsive or even absent.
Now we need to implement the path of the mirror replaying "old" (older than the most recently committed block) requests to the state machine.
This takes care of two primary usecases:
nblocks and needs to sync those block to rejoin consensus (live replay)Live catchup is akin to block sync in Comet terms. Starting from genesis or some previously saved state, the Mirror is many blocks behind the rest of the network, and simply observing the current consensus messages is insufficient to reach the current height.
We do not currently have an RPC or HTTP endpoint to serve old block headers nor those blocks' data (i.e. the transactions). There is a design decision to make about serving individual historical blocks, versus perhaps paging and compressing 100 or 1000 blocks at a time. This could mean, for example, at Height 750, heights 700-749 are retrievable individually, but you can only get the collections for 1-99, 100-199, etc.
Beyond the mechanism of transmitting historic block data, there is a secondary issue of host discovery. The two obvious options are 1) you have to know the address of a host who supports live catchup, and you provide their address(es) on the command line or to a config file, or 2) use a semi-centralized "rendezvous server" where "historic data hosts" can register as willing to host historic data to any client who needs it, and any client can perform a host lookup against that rendezvous server.
The first option is probably a subset of the second, so the first option is probably the appropriate choice for MVP.
Like live replay, live catchup is probably better implemented before data persistence. It can rely on in-memory storage to host data.