-
Notifications
You must be signed in to change notification settings - Fork 17
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: Head of store needs to be the *contiguous* head of the store #201
Comments
Needs a test on the store to ensure that an Append that occurs that is non-adjacent to the highest head written to disk would still be successfully written to the disk but NOT reflected in |
## Overview The main idea of this PR is to make `Store[H].Head` working properly, to be precise: returning head that was written to the disk (*). Along with that `heightSub.height` is increased monotonically to prevent bugs when we have store appends out of order. To test everything I'm adding 2 new tests: one that verifies out of order appends and another when which does this concurrently. Which helped to find 2 or even 3 edge cases during coding. Fixes #201
Reopening due to revert. |
After a yesterday's discussion with Hlib:
|
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 insideincomingNetHead
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, thehead
of the store should be the highest header that is contiguous all the way down to theTail().Height()
The text was updated successfully, but these errors were encountered: