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

Adjust AddrV2 arbitrary to satisfy decode checks

Public commit record

What the developer wrote

Authored by Mitchell Bagot

68/100 · Adequate
Adjust AddrV2 arbitrary to satisfy decode checks

The AddrV2Decoder has various checks in place that enforce certain
invariants for the decoded values. Arbitrary impls should enforce the
same invariants on constructed values as the decoders do.

Adjust AddrV2 arbitrary impl to enforce the same invariants as the
AddrV2Decoder.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a mismatch in test-only code between how fake network addresses are randomly generated and how the real decoder validates them. It does not change any production parsing or network logic, so it cannot be exploited by an attacker. The change only makes property-based tests more realistic and avoids false test failures.

Recommended action

No security action required. Treat as a normal code-quality/test-hygiene patch. Reviewers may optionally verify that the new invariants exactly match those in `AddrV2Decoder`.

Security signals we found

01

Test-only Arbitrary impl aligned with decoder invariants

02

No change to production decode/encode/network logic

03

Prevents generation of invalid-but-craftable address variants during fuzz/property tests

Risk score

Why this scored 16/100

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