#36690 test: check guarantees of bech32 error detection
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #36690 test: check guarantees of bech32 error detection | Ready | 0 | Crickets | 2 + 92 tests | |||
|
|
|
|
| |||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | |||||||
Goal
Adds unit tests in bech32_tests.cpp to verify Bech32m checksum error detection guarantees and error location bounds at both the standard 90-character limit and the 1023-character silent payments limit. Also adjusts comments in bech32.h to state that checksums detect character changes rather than ambiguously implying they can find or fix errors.
Problem: Test coverage does not explicitly validate error detection guarantees or error location behavior around the 1023-character limit introduced for BIP352 silent payments. Furthermore, header comments stating that character limits 'guarantee finding up to N errors' can mislead developers into thinking errors can be accurately located or repaired.
Evidence of importance:
- Author noted in the description: 'Initially I was just looking at all code around Silent Payments, looked if the bech32 test had been updated to have tests for the new CharLimit::SILENT_PAYMENTS, and saw less tests than I expected.' (PR description)
Risk of a mistake: low (tests, docs). Touches only unit tests and header comments; any error would cause test suite failures without affecting node runtime behavior.
Reviewability
Ready
Nothing known that would invalidate a review now.
Waiting on (from the thread read):
- reviewer: initial review 2026-10-29
Agreement
Crickets
no substantive comment either way
Thread notes: Initial record. No external reviews or comments yet; author noted fixing an error in a comment. / Initial record. No reviews yet; only an update comment from the PR author.
Objections, suggestions, and questions: none recorded.
Files
92 lines under test/bench/ci.
- src/test/bech32_tests.cpp +92/-0
- src/bech32.h +2/-2
Card
The short text the ranking pass compares across PRs.
This PR adds unit tests verifying Bech32m checksum error detection and error location bounds at both the standard 90-character limit and the 1023-character silent payments limit. It also clarifies comments in bech32.h that character limits guarantee detecting changes rather than locating or fixing errors. The change addresses missing test coverage for the BIP352 silent payment character limits.
Data
thread read through 2026-10-29 (1 statements), head 6151f1dd19
labels: Tests
Categories
Test infrastructure
P4 · test coverage (ranking pass: Moved up within P4: it tests a real boundary (the 1023-char silent-payments limit) and corrects misleading header comments.)
Adds unit tests verifying Bech32m error detection guarantees and clarifies header comments without addressing a known bug or flaky test. Test infrastructure prioritizes test harness signal and regression-catching tests, while test coverage added for its own sake ranks low.
Membership: PR has the Tests label and adds unit test coverage in src/test/bech32_tests.cpp with no separate category for encoding/bech32.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0