Skip to content

Commit

Permalink
Merge #23577: Follow-ups to Bech32 error detection
Browse files Browse the repository at this point in the history
a4fe701 Make Bech32 LocateErrors return error list rather than using out-arg (Samuel Dobson)
2fa4fd1 Use std::iota instead of manually pushing range (Samuel Dobson)
405c96f Use bounds-checked array lookups in Bech32 error detection code (Samuel Dobson)
28d9c28 Simplify encoding of e in GF(1024) tables to (1,0) (Samuel Dobson)
14358a0 Replace GF1024 tables and syndrome constants with compile-time generated constexprs. (Samuel Dobson)
63f7b69 Update release note for bech32 error detection (Samuel Dobson)
c8b9a22 Report encoding type in bech32 error message (Samuel Dobson)
92f0caf Improve Bech32 boost tests (Samuel Dobson)
bb4d3e9 Address review comments for Bech32 error validation (Samuel Dobson)

Pull request description:

  A number of follow-ups and improvements to the bech32 error location code, introduced in #16807.

  Notably, this removes the hardcoded GF1024 tables in favour of constexpr table generation.

ACKs for top commit:
  laanwj:
    Re-ACK a4fe701

Tree-SHA512: 6312373c20ebd6636f5797304876fa0d70fa777de2f6c507245f51a652b3d1224ebc55b236c9e11e6956c1e88e65faadab51d53587078efccb451455aa2e2276
  • Loading branch information
laanwj committed Dec 6, 2021
2 parents d20d6ac + a4fe701 commit 22feb7f
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 323 deletions.
10 changes: 7 additions & 3 deletions doc/release-notes-16807.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Updated RPCs
------------

- The `validateaddress` RPC now optionally returns an `error_locations` array, with the indices of
invalid characters in the address. For example, this will return the locations of up to two Bech32
errors.
- The `validateaddress` RPC now returns an `error_locations` array for invalid
addresses, with the indices of invalid character locations in the address (if
known). For example, this will attempt to locate up to two Bech32 errors, and
return their locations if successful. Success and correctness are only guaranteed
if fewer than two substitution errors have been made.
The error message returned in the `error` field now also returns more specific
errors when decoding fails.
Loading

0 comments on commit 22feb7f

Please sign in to comment.