IntersectMBO / IntersectMBO/ouroboros-consensus
Chain DB: relax constraints on reader tests
- 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
Assessment
This issue has not been assessed yet.