AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 60 Bitcoin

dynafed: require at least four-fifths approval for parameter transition

Public commit record

What the developer wrote

Authored by Byron Hambly

78/100 · Adequate
dynafed: require at least four-fifths approval for parameter transition

NextBlockIsParameterTransition computed the approval threshold as
(epoch_length*4)/5, which floor-divides. For epoch lengths not divisible by
5 this is below the intended at-least-four-fifths rule, so a transition
could pass with fewer than 80% of the epoch's blocks voting for it.

Use the overflow-safe ceiling N - N/5 (== ceil(N*4/5)). This is a no-op for
epoch lengths divisible by 5 (the only currently deployed case) and only
corrects the under-approximation for non-divisible epoch lengths.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a voting threshold bug in Elements' dynamic federation (dynafed) feature. The code was supposed to require at least 80% (four-fifths) of recent blocks to approve a change to federation parameters, but due to integer division rounding down, it could approve changes with slightly less than 80% support when the voting epoch length was not evenly divisible by 5. The fix changes the math so the threshold is always rounded up to the next whole number, ensuring the true 80% requirement is met. Currently deployed systems use epoch lengths divisible by 5, so this is a no-op for them, but it corrects the behavior for other configurations.

Recommended action

Review whether any deployed or planned configurations use dynamic_epoch_length values not divisible by 5; if so, prioritize deployment of this fix. Add regression tests covering epoch lengths such as 6, 7, 9, 11, etc., to verify the threshold is always ceil(4N/5). Consider adding an explicit consensus-level invariant or assertion that the threshold equals the intended four-fifths ceiling.

Security signals we found

01

Consensus threshold under-approximation due to integer floor division

02

Potential for dynafed parameter transition with less than intended 80% block approval

03

Overflow-safe ceiling formula used as remediation

04

Comment explicitly describes the security-relevant threshold correction

Risk score

Why this scored 60/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.