-
Notifications
You must be signed in to change notification settings - Fork 22
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
187-4 Add a consistency check for the tezos-specific fork detector #899
187-4 Add a consistency check for the tezos-specific fork detector #899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
8ea45fd
to
f33e0bb
Compare
83e56d1
to
96f73fd
Compare
f33e0bb
to
6fc5578
Compare
681938b
to
ff8d4ee
Compare
* consistent results. | ||
* It might happen that network calls to both services were not fast enough, to the | ||
* point that the fork on which the reference node was at the time of detection changed | ||
* during the algorthm execution. This might be a reasonable expectation in a highly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Algorithm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, and I additionally rephrased the "locally consistent" definition, trying to make it easier to understand.
|
||
/** Here we verify the properties of the [[ConsistentForkDetector]] implementation. | ||
* This spec works essentially in the same way as | ||
* the [[tech.cryptonomic.conseil.indexer.ForkDetectorSpec]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package name is incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
abe65cc
to
ce17921
Compare
f1aaf4c
to
72affdd
Compare
* correct all database types for level as bigint * correct all code modeling levels to use the new alias * give an explicit class to BlockReference for better matching * simplify the node operator tests and add explanatory comments * add test case for loading blocks not indexed in db
* add some log about random generation results during tests * fix an incorrect test
* correct all database types for level as bigint * correct all code modeling levels to use the new alias * give an explicit class to BlockReference for better matching * simplify the node operator tests and add explanatory comments * add test case for loading blocks not indexed in db
* add a checker to match the fork level block predecessor with the one stored by the indexer * define a property spec similar to the generic detector
72affdd
to
ae1917b
Compare
Kudos, SonarCloud Quality Gate passed!
|
Related to #42 and #187
The currently available detector works under the assumption that the search for the fork level will be fast enough for the node to remain "stable".
That means that if the node "jumps" to a different fork while the detector is executing the search, we might get in serious trouble.
For Tezos is sounds reasonable that this might occur, even if only by a remote chance.
To handle the situation a more robust detector is defined to use with tezos specifically (since it involved data that is block-specific), which does a double-check before committing to the identified fork level.
NOTE This is part of a long-running streak of PRs to define the overall fork handling strategy.
Before merging it we need to merge the previous PRs #896 #898 and rebase on the new
master
branch, after which thedraft
tag could be removed.