Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store: Implement Tail method on Store interface #203

Open
renaynay opened this issue Jun 24, 2024 · 0 comments
Open

store: Implement Tail method on Store interface #203

renaynay opened this issue Jun 24, 2024 · 0 comments
Assignees
Labels

Comments

@renaynay
Copy link
Member

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 renaynay added the store label Jun 24, 2024
cristaloleg added a commit that referenced this issue Oct 4, 2024
## Overview

Add `.Tail` method to `header.Store[H]` and `store.Store[H]`
implementation. For now method tries to return genesis header. In the
future PRs method will start returning real tail of the store.

Updates #203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants