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

Merge rust-bitcoin/rust-bitcoin#6661: units: Remove `From<u16>` from `NumberOfBlocks`

Public commit record

What the developer wrote

Authored by Andrew Poelstra

91/100 · Strong
Merge rust-bitcoin/rust-bitcoin#6661: units: Remove `From<u16>` from `NumberOfBlocks`

6ea25bed2982858815abeb8788f12f342584108b Update API files (Mitchell Bagot)
f9b08eb1fb1ec6871d144f16c6fdad3d13d9b552 Remove From<u16> from NumberOfBlocks (Mitchell Bagot)

Pull request description:

The NumberOfBlocks type has a From\<u16> impl on it, which is used to simplify construction of the type in various tests. However, the from_height constructor already takes a u16 and functions identically. Since the NumberOf512Seconds type has no such From impl, it should be removed from this to reduce the API surface and make the two consistent.

Remove From\<u16> impl from NumberOfBlocks.


ACKs for top commit:
apoelstra:
ACK 6ea25bed2982858815abeb8788f12f342584108b; successfully ran local tests
tcharding:
ACK 6ea25bed2982858815abeb8788f12f342584108b


Tree-SHA512: dbe29afbab5bfbbbb411fd7789ad0c5e289b2991784d130fa67a5eb1f4122c1f5da6fe09a8acb1ddb3dc4d3ffbe8845588578bcfe60df1be9f16ceaef7ae5872
✓ 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 API cleanup, not a security fix. The developers removed a shortcut that let programmers create a 'number of blocks' value directly from any u16 number, replacing it with an existing named constructor called from_height. The behavior of the code is unchanged; only the way callers write it is slightly different. There is no vulnerability here.

Recommended action

No security action needed. Treat as a normal semver-aware API change; downstream code using NumberOfBlocks::from(u16) will need to switch to NumberOfBlocks::from_height.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 19/100

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