go-header icon indicating copy to clipboard operation
go-header copied to clipboard

store: Implement `Tail` method on Store interface

Open renaynay opened this issue 8 months ago • 0 comments

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.

Screenshot 2024-06-24 at 16 58 37

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.

renaynay avatar Jun 24 '24 15:06 renaynay