Skip to content

fix: remove lossy percentage conversion in DKG randomness config#44

Merged
Lchangliang merged 5 commits intoaptos-nodefrom
dev-0208-lossy
Feb 9, 2026
Merged

fix: remove lossy percentage conversion in DKG randomness config#44
Lchangliang merged 5 commits intoaptos-nodefrom
dev-0208-lossy

Conversation

@Lchangliang
Copy link
Collaborator

No description provided.

The convert_randomness_config_from_api function was converting FixedPoint64
threshold values through an integer percentage round-trip:
  FixedPoint64 → percentage (u64) → FixedPoint64
This caused precision loss (e.g., 2/3 = 0.6666... → 66% → 0.66), leading to
different DKG rounding weights between transcript generation and epoch
transition wconfig reconstruction (W=4 vs W=11), resulting in an index
out-of-bounds crash in weighted_protocol.rs.

Fix: directly construct ConfigV1/ConfigV2 with the original FixedPoint64
values, preserving full precision.
@Lchangliang Lchangliang merged commit c9ae04b into aptos-node Feb 9, 2026
38 of 43 checks passed
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