Wrap SetupParameters in Arc to fix memory issue#12
Open
ycscaly wants to merge 2 commits into
Open
Conversation
The reconfiguration protocol's PublicInput contained 7 SetupParameters directly (not wrapped in Arc), each containing large accelerator tables (~8MB each with 4096 entries of ~512 bytes). Every PublicInput.clone() was copying ~56-80MB of data. With 80 validators and multiple protocol rounds, this caused memory usage to grow to tens of GB. Changes: - Wrap setup_parameters and setup_parameters_per_crt_prime in Arc in class_groups::reconfiguration::PublicInput - Wrap ristretto_setup_parameters, curve25519_setup_parameters, and secp256r1_setup_parameters in Arc in twopc_mpc::decentralized_party::reconfiguration::PublicInput - Add "rc" feature to serde for Arc serialization support - Update usages to dereference Arc when inner value is needed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Apply the same Arc-wrapping treatment to DKG that was done for reconfiguration. This ensures SetupParameters (which contain large accelerator tables ~8MB each) are reference-counted rather than deep-cloned when PublicInput is cloned. Changes: - 2pc-mpc: Wrap setup parameters in Arc in DKG PublicInput struct - class-groups: Wrap setup_parameters and setup_parameters_per_crt_prime in Arc - Update party.rs, third_round.rs, fourth_round.rs to dereference Arc 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.