IntersectMBO / IntersectMBO/ouroboros-consensus
Benchmark out of order validation
- Dominant language
- Haskell
- Stars
- 67
- Forks
- 43
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 43
Description
Adding blocks in order, each fitting on the tip of the chain, is the fast path for the ChainDB. The BlockFetch client might not always add them in this order, certainly when fetching from multiple peers concurrently.
When two blocks are added out of order, the first one will be ignored (so no validation required). Adding the second one will require reading and deserialising the first from disk, after which both blocks will be validated by the ledger. So the obvious extra cost of adding them out of order is the reading and deserialising of the first block. To make sure that this is indeed the only extra cost (and that the other differences are negligible), we should benchmark this.
We can build further upon input-output-hk/ouroboros-network#2347 and use step 5 as a baseline. Compare that with applying all blocks pairwise out of order (add blocks 1, 0, 3, 2, 5, 4, etc.). This can be generalised to batches of size `n` (for `n = 3`: add blocks 3, 4, 5, 0, 1, 2).
Contributor guide
Assessment
This issue has not been assessed yet.