IntersectMBO / IntersectMBO/ouroboros-consensus

Chain DB: relax constraints on reader tests

Open
#690 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

In the q-s-m tests of the ChainDB, the model and implementation readers go out of sync when multiple future blocks have been processed between opening the reader and requesting the next instruction. The implementation processes these blocks one by one, possibly switching to a fork and then back to the previous chain (but extending it), whereas the implementation will pick the final chain right away, as it looks at all blocks together. The implementation reader will roll back, but the model reader won't.

We have disabled such cases by disallowing multiple future blocks with the same block number.

A better solution would be to replace the `ReaderInstruction` command with something like `ReaderFollow`, which asks for all instructions and applies them to a chain. We can then compare those two chains. In other words, we apply the diffs and compare the final results, instead of comparing the diffs. This would require storing the reader's chain together with the reader, so that we can apply the diffs to it.

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.