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

Merge rust-bitcoin/rust-bitcoin#7005: feat(units): add saturating arithmetic methods to FeeRate

Public commit record

What the developer wrote

Authored by Andrew Poelstra

96/100 · Strong
Merge rust-bitcoin/rust-bitcoin#7005: feat(units): add saturating arithmetic methods to FeeRate

ab56fd63b79c22966bc35edda724d8fdbadc6860 feat(units): add saturating arithmetic methods to FeeRate (luhrhenz)

Pull request description:

## Summary

- Add `saturating_mul`, `saturating_div`, `saturating_add`, and `saturating_sub` to `FeeRate`, following the pattern established by `BlockHeight` and the existing `checked_*` methods.
- All four are `const fn`, `#[inline]`, `#[must_use]`, delegating to the underlying `u64` saturating operations.
- Add unit tests covering normal operation, boundary values, and overflow/underflow saturation.

Ref #6793


ACKs for top commit:
Kixunil:
ACK ab56fd63b79c22966bc35edda724d8fdbadc6860
Abeeujah:
ACK ab56fd63b79c22966bc35edda724d8fdbadc6860
apoelstra:
ACK ab56fd63b79c22966bc35edda724d8fdbadc6860; successfully ran local tests


Tree-SHA512: ff12235f6e6ff496937536df2adac85ef5cf64c9ec4645c4d11b37cd8f21872f1211aa3a724c57cba47c16a0e15fc52f8bc3db2e1b375dd9532ad6f462a0ed99
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit adds new safe arithmetic helpers to the FeeRate type in the rust-bitcoin library. These methods multiply, add, or subtract fee rates while capping the result at the maximum or minimum allowed value, preventing accidental numeric overflow. It is a routine feature addition with no security fix or vulnerability indicator.

Recommended action

No security action needed. Treat as a normal feature merge.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 18/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 5/15
Confidence 9/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.