Skip to content

refactor: Rename threshold to reconstruction_threshold across node providers#3655

Open
SimonRastikian wants to merge 1 commit into
3164-adding-ReconstructionThreshold-in-nodefrom
3164-reconstruction-threshold-rename
Open

refactor: Rename threshold to reconstruction_threshold across node providers#3655
SimonRastikian wants to merge 1 commit into
3164-adding-ReconstructionThreshold-in-nodefrom
3164-reconstruction-threshold-rename

Conversation

@SimonRastikian

Copy link
Copy Markdown
Contributor

Improves readability of the code

@SimonRastikian SimonRastikian self-assigned this Jun 23, 2026
@claude

claude Bot commented Jun 23, 2026

Copy link
Copy Markdown

PR title type suggestion: This PR renames fields/variables across the node providers codebase, so the type prefix should be refactor:.

Suggested title: refactor: rename threshold to reconstruction_threshold across node providers

@claude

claude Bot commented Jun 23, 2026

Copy link
Copy Markdown

Pull request overview

Mechanical rename of thresholdreconstruction_threshold across the node providers (ecdsa, robust_ecdsa, eddsa, ckd, verify_foreign_tx), the SignatureProvider trait, key_events, the coordinator, and test fixtures. Targets the 3164-adding-ReconstructionThreshold-in-node follow-up branch and re-applies the rename portion that was previously reverted.

No semantic changes. Local bindings, struct fields, function parameters, and the HashMap<DomainId, ReconstructionThreshold> plumbing are renamed; calls into the external threshold_signatures crate keep their library-defined field name (PresignArguments { threshold: ... }).

Changes:

  • Rename threshold / new_threshold / old_threshold parameters on SignatureProvider::run_key_generation_client / run_key_resharing_client and their implementations across all providers.
  • Rename threshold field to reconstruction_threshold on KeyGenerationComputation, KeyResharingComputation, SignComputation, FollowerSignComputation, PresignComputation, FollowerPresignComputation, ManyTripleGenerationComputation, FollowerManyTripleGenerationComputation for ECDSA / robust-ECDSA / EdDSA / CKD.
  • Rename thresholds constructor argument to reconstruction_thresholds on EcdsaSignatureProvider::new, RobustEcdsaSignatureProvider::new, EddsaSignatureProvider::new, CKDProvider::new.
  • Rename domain_to_threshold HashMap in coordinator.rs and the local binding in key_events.rs.
  • Touch test fixture gen_four_participants and several #[cfg(test)] constructors to use the new name.

Reviewed changes

Per-file summary
File Description
crates/node/src/assets/test_utils.rs Rename local binding in gen_four_participants.
crates/node/src/coordinator.rs Rename domain_to_thresholddomain_to_reconstruction_threshold.
crates/node/src/key_events.rs Rename locals in keygen_computation_inner / resharing_computation_inner.
crates/node/src/providers.rs Rename trait method parameters on SignatureProvider.
crates/node/src/providers/ckd.rs Rename constructor arg and trait-method params.
crates/node/src/providers/ckd/key_generation.rs Rename KeyGenerationComputation::threshold field.
crates/node/src/providers/ckd/key_resharing.rs Rename KeyResharingComputation::{threshold, old_threshold} fields.
crates/node/src/providers/ckd/sign.rs Rename local in CKD sign client.
crates/node/src/providers/ecdsa.rs Rename constructor arg, trait params, and locals in background jobs / triple_store_for_t.
crates/node/src/providers/ecdsa/key_generation.rs Rename field on KeyGenerationComputation.
crates/node/src/providers/ecdsa/key_resharing.rs Rename fields on KeyResharingComputation.
crates/node/src/providers/ecdsa/presign.rs Rename fields on PresignComputation / FollowerPresignComputation and locals.
crates/node/src/providers/ecdsa/sign.rs Rename fields on SignComputation / FollowerSignComputation and locals.
crates/node/src/providers/ecdsa/triple.rs Rename TripleStorage::new param, ManyTripleGenerationComputation::threshold, and the follower variant.
crates/node/src/providers/eddsa.rs Rename constructor arg and trait-method params.
crates/node/src/providers/eddsa/key_generation.rs Rename field on KeyGenerationComputation.
crates/node/src/providers/eddsa/key_resharing.rs Rename fields on KeyResharingComputation.
crates/node/src/providers/eddsa/sign.rs Rename field on SignComputation and locals.
crates/node/src/providers/robust_ecdsa.rs Rename constructor arg and trait-method params.
crates/node/src/providers/robust_ecdsa/presign.rs Rename function param and compute_thresholds param.
crates/node/src/providers/verify_foreign_tx.rs Rename _threshold placeholder params on stub trait impls.

Findings

No blocking issues — the diff is a faithful mechanical rename, behavior is unchanged, and the one remaining threshold: (in PresignArguments, crates/node/src/providers/ecdsa/presign.rs:255) correctly preserves the external library's field name.

Non-blocking (nits, follow-ups, suggestions):

  • crates/node/src/providers/ecdsa.rs:140triple_store_for_t now takes reconstruction_threshold: ReconstructionThreshold, so the _for_t suffix is the last place that still uses the short name. Optional: rename to triple_store_for_reconstruction_threshold for consistency, or leave as-is if the abbreviation is preferred for the method name.
  • crates/node/src/providers/ecdsa/presign.rs:189 — error message still reads "presign participant count ({}) does not match domain threshold t={}". Not wrong (it's user-facing prose referring to the protocol parameter t), but worth a glance if you want operator-visible strings to track the variable rename.
  • crates/node/src/assets/test_utils.rs:45 — doc comment "Generates a 4-participant test fixture with threshold 3" still says "threshold"; harmless prose, but trivially aligns with the new vocabulary by saying "reconstruction threshold 3".

✅ Approved

@SimonRastikian SimonRastikian changed the title Rename threshold to reconstruction_threshold across node providers refactor: Rename threshold to reconstruction_threshold across node providers Jun 24, 2026
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.

1 participant