celestiaorg / celestiaorg/go-header

store: Head of store needs to be the *contiguous* head of the store

Open
#201 4 comments 0 reactions 1 assignee Claimed by @cristaloleg View on GitHub
bug store
Dominant language
Go
Stars
21
Forks
33
Avg merge
5d 20h
Merged PRs (30d)
7

Description

Currently in main, the `head` of the store is updated when an Append is done (via #186) because the assumption was that the syncer only does contiguous Appends to the store. This is actually **not** true because the syncer can write to the store via Append inside `incomingNetHead` whereby a header that comes in through headersub (or via p2p.Exchange request) can be verified non-adjacently and then applied to the store if it passes the non-adjacent verification.

We need to fix this by ensuring that the store knows of its own highest header that is contiguous (meaning all headers below the `head` are adjacent).

_Note: once the `Tail()` method is implemented, the `head` of the store should be the highest header that is contiguous all the way down to the `Tail().Height()`_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.