You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()
The text was updated successfully, but these errors were encountered:
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 Head() method until all headers below that height have also been written to the disk.
## 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
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: