Tail should track the "lowest" header height written to the Store that is contiguous to the head of the store.
This means everything between store.Head and store.Tail should be adjacent and written to the store.
For now, since syncer is still forward-syncing and the genesis header is requested first, Tail should always be == genesis (height 1).
Once backwards sync is implemented inside the syncer, Tail will actually need to track store writes to ensure that it is the lowest (oldest) contiguous header written to the disk.
Implementation detail (potentially to be discussed if needed): Nothing should be written to the store that is below the Tail().Height(), so store should short-circuit if there is an Append that is attempted for a height that is less than Tail().Height()-1.
Tail should track the "lowest" header height written to the Store that is contiguous to the
head
of the store.This means everything between store.Head and store.Tail should be adjacent and written to the store.
For now, since syncer is still forward-syncing and the genesis header is requested first, Tail should always be == genesis (height 1).
Once backwards sync is implemented inside the syncer, Tail will actually need to track store writes to ensure that it is the lowest (oldest) contiguous header written to the disk.
Implementation detail (potentially to be discussed if needed): Nothing should be written to the store that is below the
Tail().Height()
, so store should short-circuit if there is an Append that is attempted for a height that is less thanTail().Height()-1
.