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
Validation of the VolatileDB #1568
Conversation
4632ec2
to
0ecc3f1
Compare
tryCollectFile hasFS env@VolatileDBEnv{..} slot st@InternalState{..} | ||
(fileId, fileInfo) = |
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.
I would revert this change (so it's one line again) and use the following instead:
tryCollectFile ...
....
where
VolatileDBEnv { _dbErr, _tracer } = env
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.
This is not so easy because VolatileDBEnv
is Existential type, but I did the same for InternalState
to keep it a single line.
ouroboros-consensus/src/Ouroboros/Storage/ChainDB/Impl/VolDB.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/Ouroboros/Storage/ChainDB/Impl/VolDB.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/Ouroboros/Storage/ChainDB/Impl/VolDB.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/test-storage/Test/Ouroboros/Storage/VolatileDB/StateMachine.hs
Outdated
Show resolved
Hide resolved
checkBlockIntegrity :: TestBlock -> Bool | ||
checkBlockIntegrity testBlock = | ||
hashHeader (testHeader testBlock) == thHash (testHeader testBlock) | ||
|| not (tbIsValid (testBody testBlock)) | ||
|
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.
Isn't this the same as Test.Ouroboros.Storage.TestBlock.testBlockIsValid
?
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.
Almost yes, this also checkes tbIsValid
8784596
to
f04ff48
Compare
ouroboros-consensus/src/Ouroboros/Storage/ChainDB/Impl/VolDB.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/test-storage/Test/Ouroboros/Storage/VolatileDB/StateMachine.hs
Outdated
Show resolved
Hide resolved
1abf132
to
4b1e9eb
Compare
4b1e9eb
to
dda86df
Compare
dda86df
to
ba2a97a
Compare
This ready for merging. Thanks @kderme for the validation code. I cleaned up some bits and implemented part 1 of #1304 (comment). |
ba2a97a
to
6b60de3
Compare
bors r+ |
1568: Validation of the VolatileDB r=mrBliss a=kderme Addresses part 2 of #1304 (comment) and more: - there is an option to check if each parsed block is valid, while parsing. - the db now recovers when there is a duplicated slot and ignores invalid filenames. - added tests for this. - added traces. `readIncrementalOffsets` is no longer used anywhere. Worth keeping? 1640: demo chain sync -- cli args r=coot a=coot Co-authored-by: kderme <k.dermenz@gmail.com> Co-authored-by: Thomas Winant <thomas@well-typed.com> Co-authored-by: Marcin Szamotulski <profunctor@pm.me>
This PR was included in a batch that timed out, it will be automatically retried |
1568: Validation of the VolatileDB r=mrBliss a=kderme Addresses part 2 of #1304 (comment) and more: - there is an option to check if each parsed block is valid, while parsing. - the db now recovers when there is a duplicated slot and ignores invalid filenames. - added tests for this. - added traces. `readIncrementalOffsets` is no longer used anywhere. Worth keeping? Co-authored-by: kderme <k.dermenz@gmail.com> Co-authored-by: Thomas Winant <thomas@well-typed.com>
Addresses part 2 of #1304 (comment) and more:
readIncrementalOffsets
is no longer used anywhere. Worth keeping?