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

Merge rust-bitcoin/rust-bitcoin#6061: Units improvements

Public commit record

What the developer wrote

Authored by Andrew Poelstra

91/100 · Strong
Merge rust-bitcoin/rust-bitcoin#6061: Units improvements

a002978d05f88a0864bcb07ed3711999ab92dc22 Improve error messages of `serde` errors (Martin Habovstiak)
30f7aba5ab61a27ab017cfd6dce93751338adb69 Add `FeeRate::from_sat_per_{vb,kvb,kwu}` methods (Martin Habovstiak)
fc1bed37e0bdc3d19b78f26fca0238ea72d939a2 Rename `u32`-taking `FeeRate::from_sat_per_*` (Martin Habovstiak)
861a8d609514423771e96e362b8ed345b27bb7c3 Deduplicate `FeeRate` constants in tests (Martin Habovstiak)
e4e124e87aee47ed637b87932dcddf7a6867c5d4 Remove artificial restriction from `from_per_vb` (Martin Habovstiak)

Pull request description:

This makes various improvements to units - see commits.


ACKs for top commit:
apoelstra:
ACK a002978d05f88a0864bcb07ed3711999ab92dc22; successfully ran local tests


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

What changed, and why it matters

This is a routine code-quality and API-expansion pull request for the rust-bitcoin library's 'units' crate. It widens some fee-rate constructors from 32-bit to 64-bit inputs, renames the old 32-bit versions, improves serde error messages, and removes an artificial restriction. The changes are mostly additive or renaming; they do not appear to fix a known vulnerability and the commit message does not describe any security issue.

Recommended action

Treat as a normal API-maintenance merge. Reviewers should verify that the new u64 constructors correctly propagate overflow errors and that the renamed `_u32` methods preserve previous behavior. Downstream projects should update call sites because `from_sat_per_vb`/`from_sat_per_kwu`/`from_sat_per_kvb` signatures have changed. No urgent security action is indicated by the supplied materials.

Security signals we found

01

API surface change: new u64 fee-rate constructors return NumOpResult to prevent silent overflow

02

Renaming of existing u32 constructors to *_u32 may break downstream callers at compile time (breaking API change)

03

Removal of artificial restriction in from_per_vb allows larger valid inputs

04

Serde deserialization now uses custom Visitor with explicit range expectations

05

No mention of vulnerability, CVE, or security bug in commit or PR description

Risk score

Why this scored 35/100

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