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

Merge rust-bitcoin/rust-bitcoin#7117: primitives: Document omitted return conditions

Public commit record

What the developer wrote

Authored by Andrew Poelstra

91/100 · Strong
Merge rust-bitcoin/rust-bitcoin#7117: primitives: Document omitted return conditions

d2613e64e6e0a20f4baa84a8d87db6f7f3ec3207 primitives: Document the witness commitment check (Jamil Lambert, PhD)
2d80f4bb4a65a9c990fee065ded7423cabb8541e primitives: Document no-alloc Merkle root limit (Jamil Lambert, PhD)

Pull request description:

`TxMerkleNode::calculate_root` and `WitnessMerkleNode::calculate_root` return `None` for more than 32,767 transactions when `alloc` is disabled, but only the private `MerkleNode` trait says so. And `Block::check_witness_commitment` returns a `(bool, Option<WitnessMerkleNode>)` and the docs only describe the root.

Copy the no-alloc note to the public docs and describe both halves of the witness commitment result.

Docs only changes.


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


Tree-SHA512: 11aa3468e3cfd8d6fc36abf32bd91774864c27ef2adee4375d35718ee2844c387eaa85338ca3bd1d521eebb7fc5fdbd7f1cc6e80ce24398cc821519a76313eb1
✓ 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 commit only updates documentation comments in the rust-bitcoin library. It adds notes explaining when two Merkle-root calculation functions can return None (specifically when a no-memory-allocation build mode is used with very large transaction lists) and clarifies what the two parts of a witness-commitment check result mean. No code behavior was changed.

Recommended action

No security action needed; this is a documentation-only change. Reviewers may verify that the added docs accurately reflect the existing implementation.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

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