Skip to content

Turmoil simulation tests for AVSS, FPMul, FPDiv, RanSha and batch reconstruction#94

Merged
hdvanegasm merged 37 commits into
devfrom
feature/sto-579-add-turmoil-into-avss-module
Jun 4, 2026
Merged

Turmoil simulation tests for AVSS, FPMul, FPDiv, RanSha and batch reconstruction#94
hdvanegasm merged 37 commits into
devfrom
feature/sto-579-add-turmoil-into-avss-module

Conversation

@hdvanegasm

@hdvanegasm hdvanegasm commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Turmoil-based deterministic simulation tests for several MPC protocols, covering both the happy path and a range of adverse network conditions. Also includes a Shamir secret-sharing sanity check against known Trail of Bits findings and a couple of HoneyBadger lint fixes.

Tests added

Protocols covered: AVSS, FPMul, FPDiv, RanSha, and batch reconstruction.

Beyond the happy path, the tests exercise:

  • A single node with extreme delay
  • Multiple slow nodes
  • A node that joins the network late
  • Network partitions (RanSha)
  • Varying hold times (RanSha)

Other changes

  • feat(shamir): verified that the Trail of Bits Shamir interpolation pitfalls do not apply here, since our nterpolation points are roots of unity.
  • fix(honeybadger): resolved Clippy warnings.

Issues addressed

  • STO-579 — Add Turmoil into AVSS module
  • STO-580 — Add Turmoil tests for FPMul
  • STO-581 — Add Turmoil tests for FPDiv
  • STO-652 — Add Turmoil tests for MPC protocols

Mikerah and others added 23 commits April 7, 2026 23:01
Applied cargo fmt and cargo clippy fixes across the codebase to ensure
clean CI builds. Updated CI workflow to use targeted test command that
runs only the stoffelmpc-mpc library tests.

Changes:
- CI: Updated test command from `cargo test` to `cargo test -p stoffelmpc-mpc --lib`
- Formatting: Applied cargo fmt to 33 files across mpc/ and network/ crates
- Linting: Fixed clippy warnings including unused imports, style issues
- Added crate-level lint allows in mpc/src/lib.rs for acceptable style patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- implemented Pedersen commitments with basic tests.
- Avss and Random share generation with avss
- Rand() function added
- Implement missing `rand` trait method in HoneyBadgerMPCNode
- Update SubProtocolCounters to use Mutex<Option<u8>> type
- Add async .await to get_next() counter calls
- Fix unused imports in pedersen.rs test module with #[cfg(test)]
- Add LimitError variant to RandBitError enum
- Update get_or_create_storage to return Result for session limits
- Fix Box::from_raw to use drop() for proper memory freeing
- Prefix unused sessionid variable with underscore
- Fix test to properly check session storage limit

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace fixed 500ms sleep with a polling loop that waits for specific
conditions to be met. This fixes intermittent CI failures caused by
the sleep not being long enough on slower machines.

The polling loop checks every 50ms with a 10 second timeout, ensuring
the test is both fast on fast machines and reliable on slow ones.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added a new mpc protocol for ADKG

- Added triple generation, removed unnecessary traits, redefined feldman shares for avss mpc

- Added multiplication for avss, tests,removed unused imports
- Added session ID trait, protocol specific message wrappers and corressponding changes
This change improves concurrency safety and robustness across async MPC subprotocols.
- Replace indefinite channel waits with explicit wait_for_result functions
- Add configurable and increased timeouts for protocol phases
- Fix race conditions in PRandBit, truncation, triple generation,AVSS multiplication, etc
- Remove session-ending treated as errors in RBC
- Remove blocking wait_for_ok phase
- Improve message ordering and async flow guarantees under concurrent execution
- Implements distributed input and output handling for the AVSS MPC protocol using Feldman-committed shares
- Renames Adkg* types to AvssMPC* for consistency across the codebase
- Adds AvssInputServer and AvssInputClient with ProtocolType::Input routing in AvssMPCNode::process()
- Adds AvssOutputServer and AvssOutputClient with ProtocolType::Output routing
- Introduces AvssMPCClient for client-side participation in AVSS protocols
- Wires new protocol variants (ProtocolType::Input, ProtocolType::Output) and message variants (AvssWrappedMessage::Input, AvssWrappedMessage::Output) into the main node dispatch loop
Merge store fixes to dev
- It implements the Goldilocks field.
- It includes local tests for RandBit, PRandBitD, TruncPr, FPMult with the new field
- setup turmoil for testing and added new tests

- replaced BadFakeNetwork with turmoil network
Fixes as a consequence of turmoil tests
- Benchmarking mpc protocols
@hdvanegasm hdvanegasm requested review from GarryFCR and Mikerah April 15, 2026 22:41
@hdvanegasm hdvanegasm self-assigned this Apr 15, 2026
@hdvanegasm hdvanegasm added the enhancement New feature or request label Apr 15, 2026
@linear

linear Bot commented Apr 15, 2026

Copy link
Copy Markdown

@hdvanegasm hdvanegasm marked this pull request as draft April 16, 2026 14:42
@hdvanegasm hdvanegasm changed the title Turmoil test for AVSS Turmoil test for AVSS, FPMul and FPDiv Apr 16, 2026
In this commit I checked that the Trail of Bits errors reported on the
blog are not happening in our case. They don't happen because our
interpolation points are roots of unity.
@GarryFCR GarryFCR force-pushed the fixes branch 2 times, most recently from 9688bc7 to 35912be Compare May 4, 2026 08:10
@hdvanegasm hdvanegasm changed the base branch from fixes to dev May 27, 2026 15:23
@Mikerah Mikerah marked this pull request as ready for review May 28, 2026 15:16
Comment thread mpc/src/honeybadger/mod.rs Outdated
@hdvanegasm hdvanegasm requested a review from GarryFCR June 2, 2026 20:04
@hdvanegasm hdvanegasm changed the title Turmoil test for AVSS, FPMul and FPDiv test: Turmoil simulation tests for AVSS, FPMul, FPDiv, RanSha and batch reconstruction Jun 3, 2026
@hdvanegasm hdvanegasm changed the title test: Turmoil simulation tests for AVSS, FPMul, FPDiv, RanSha and batch reconstruction Turmoil simulation tests for AVSS, FPMul, FPDiv, RanSha and batch reconstruction Jun 3, 2026
@hdvanegasm hdvanegasm merged commit af377b7 into dev Jun 4, 2026
6 checks passed
@hdvanegasm hdvanegasm deleted the feature/sto-579-add-turmoil-into-avss-module branch June 4, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants