hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Tune snapshot generation in TxTrace tests

Open ch1bo opened this issue 1 year ago • 1 comments
trafficstars

Follow-up of #1057

Why

When implementing incremental decommits in #1344, we significantly increased the complexity of snapshots used in the TxTrace tests and switched from a "ahead of time" to a "just in time" generation of snapshots to decrement, close and contest a head with.

This resulted in complicated generation and lots of filtering through preconditions, making the tests less efficient and hard to maintain.

Also, the generated traces are not covering all "interesting" situations within reasonable max successes and we needed to disable checkCoverage on prop_traces.

What

  • Have less actions discarded than actually tested: currently 1.6k discards on 100 runs with only 790 valid actions tested.
  • Ensure interesting cases are generated with lower sizes in prop_traces, re-enable checkCoverage and use the same number of tests in the prop_runActions
  • Reduce "number of moving pieces" and improve maintainability where possible

How

  • Generate snapshots separate from using them, i.e. Decrement, Close and Contest just pick from an available list of snapshots in the model
  • Try to get rid of most predicates that are in both, precondition and validFailingAction -> this reduces discards

ch1bo avatar Jul 23 '24 08:07 ch1bo