Skip to content

Conversation

@gilcu3
Copy link
Contributor

@gilcu3 gilcu3 commented Nov 17, 2025

Closes #107

  • This removes the usage of non-determinism from the code-base, except from the integration tests. I believe using OsRng in these files is preferred, as currently they are the closest we have to usage examples.
  • It checks that the results of the main functions in the crate are deterministic, which covers all functions (albeit indirectly). I think this is good enough atm.
  • This PR is meant to be merged after the test_utils refactor Simon/test utils folder #217. It should not have any conflict with the snapshots Simon/snapshots #218
  • This PR had no choice but slightly breaking the API of test_utils, as some functions were using OsRng internally, and now expect the RNG as a parameter.

@gilcu3 gilcu3 linked an issue Nov 17, 2025 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 93.37979% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.20%. Comparing base (315a974) to head (aac3704).

Files with missing lines Patch % Lines
src/test_utils.rs 37.20% 27 Missing ⚠️
src/ecdsa/robust_ecdsa/test.rs 87.03% 0 Missing and 7 partials ⚠️
src/ecdsa/ot_based_ecdsa/test.rs 93.33% 0 Missing and 3 partials ⚠️
src/crypto/polynomials.rs 98.21% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #225      +/-   ##
==========================================
+ Coverage   88.03%   88.20%   +0.17%     
==========================================
  Files          41       41              
  Lines        9102     9372     +270     
  Branches     9102     9372     +270     
==========================================
+ Hits         8013     8267     +254     
- Misses        642      658      +16     
  Partials      447      447              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gilcu3 gilcu3 marked this pull request as ready for review November 18, 2025 10:17
@gilcu3 gilcu3 requested a review from netrome November 18, 2025 10:17
@gilcu3 gilcu3 mentioned this pull request Nov 19, 2025
@gilcu3 gilcu3 requested a review from DSharifi November 19, 2025 09:01
DSharifi
DSharifi previously approved these changes Nov 19, 2025
Copy link

@DSharifi DSharifi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for these changes! :)

Copy link
Contributor Author

@gilcu3 gilcu3 Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to address this ugliness (and lack of efficiency, as afaik we send this over the wire) here. The bad part is that this would be a breaking change :| (incompatible with nodes running other version type)

@gilcu3 gilcu3 force-pushed the 107-deterministic-unit-tests branch from d36be11 to aac3704 Compare November 19, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deterministic unit tests

5 participants