IntersectMBO / IntersectMBO/ouroboros-consensus

Use a randomly generated security parameter in ChainDB q-s-m tests

Open
#1,682 0 comments 0 reactions 0 assignees View on GitHub
better-tests
Dominant language
Haskell
Stars
67
Forks
43
Avg merge
5d 13h
Merged PRs (30d)
43

Description

The ChainDB state machine tests currently use a hardcoded security parameter `k=2`. This hides potential bugs that only ocurr when `k > 2` -- see https://github.com/IntersectMBO/ouroboros-consensus/pull/1670.

Ideally, we would want to randomly generate `k` on the fly to gain more confidence on the implementation. For this, there are two concerns:

1. Deciding on a random distribution for `k`.
+ We could start with `choose (1, 15)` for now, but maybe using a gaussian distribution centered around 10 could yield better results (in terms of observed tags)
2. How to implement this in a good way.
+ `k` is part of a `TopLevelConfig`, so we could lift either a `SecurityParam` to be an input to the test property, or to lift the entire `TopLevelConfig` as an input in anticipation for any other parameter we could potentially want to randomly generate in the future.

NOTE: increasing this parameter has the caveat that any hypothetical counterexample showcasing a bug that relies, e.g., on immutable blocks, will now need to be larger -- even after shrinking.

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.