axelarnetwork / tofn

A threshold cryptography library in Rust
Apache License 2.0
112 stars 23 forks source link

Improve test coverage to more parameter combinations #156

Closed milapsheth closed 4 months ago

milapsheth commented 3 years ago

tofn's integration tests and some of the unit tests (including malicious tests) are only run for a specific choice of parameters (specific keygen, sign party count and threshold). We can improve the test coverage by having a set of test cases that use varying parameter combinations, including various edge cases that all tests can reuse. The malicious tests might require some changes to work with this.

One concern is that this will significantly increase testing time for local testing and PR reviews. Few potential solutions to look into are:

  1. Add a feature to enable the long running tests and locally run the tests every now and then.
  2. Configure the github actions to run the full suite of tests in a nightly build, while the PR reviews can still just the most important tests.
  3. Reduce the unsafe keygen RSA modulus size to 1024/512 bits for faster operations and testing.
  4. Take the hit in testing time. Maybe it's not too bad?
ggutoski commented 3 years ago

This issue might be a good opportunity to reinstate use of strum in tofn to iterate over enum variants for malicious behaviour. https://docs.rs/strum

milapsheth commented 3 years ago

@ggutoski mentioned that we could leverage the end-to-end testing architecture for axelar-core to run any long running tests we might have. Along with more test parameters, we can also setup our tests to run in debug mode to run debug_asserts for sanity.

milapsheth commented 3 years ago

Long running tests should also use safe primes for some tests, to get more coverage (for e.g. #190).