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

Merge rust-bitcoin/rust-bitcoin#6678: units: Add `Weight::to_vb_*` functions, deprecating `to_vbytes_*`

Public commit record

What the developer wrote

Authored by Andrew Poelstra

91/100 · Strong
Merge rust-bitcoin/rust-bitcoin#6678: units: Add `Weight::to_vb_*` functions, deprecating `to_vbytes_*`

c4a5a5e64de86f100008972389a76c3eae2faeae Update API files (Mitchell Bagot)
4af70a4eb6a18f4f6ca27c4ea0898f5c9e4bc363 Replace uses of deprecated methods with Weight::to_vb_* (Mitchell Bagot)
519ba8c8a113e679f00a9669ccec51e5c5ef7b54 units: Add Weight::to_vb_* functions, deprecating to_vbytes_* (Mitchell Bagot)

Pull request description:

The Weight type uses from_vb* as the pattern for constructors, but to_vbytes_* for conversion. FeeRate is consistent with to/from_vb*. Before we go to 1.0, Weight's conversion functions should be renamed to keep everything consistent.

Add Weight::to_vb_{floor,ceil} and deprecate Weight::to_vbytes_{floor,ceil}.


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


Tree-SHA512: ae4c7781511bf8f654633c2d2b4f7e8ae99ba7385a0f5c2641a01045f14c888554d85080c31c0b56bf99f8b481fc88231cc687066d270995bf18617e3232b6f3
✓ 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 in a Rust Bitcoin library. It adds new method names (to_vb_floor, to_vb_ceil) for converting transaction 'weight' to 'virtual bytes' and marks the old names (to_vbytes_floor, to_vbytes_ceil) as deprecated. The actual math is unchanged, and existing callers are updated to use the new names. There is no security bug or fix here.

Recommended action

No security action needed. Treat as a normal API-consistency refactor. If maintaining downstream code, plan to migrate from to_vbytes_* to to_vb_* before the deprecated methods are removed in a future release.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 20/100

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