fix(receive): Enforce BIP-352 K_MAX per-group recipient limit in scan_txouts - #75
Merged
Merged
Conversation
nymius
reviewed
Sep 1, 2026
MusabYK
force-pushed
the
add-k_max-cap
branch
2 times, most recently
from
September 2, 2026 19:13
e319f66 to
345a109
Compare
nymius
requested changes
Sep 2, 2026
nymius
left a comment
Collaborator
There was a problem hiding this comment.
Can you squash both commits together? Also, in general, I prefer commit messages that explain the what and why of the code, rather than short descriptions.
MusabYK
force-pushed
the
add-k_max-cap
branch
from
September 3, 2026 05:51
345a109 to
dfd71b8
Compare
Contributor
Author
|
Hi @nymius I squashed both commits together and updated the commit message to include the full context. Thanks for the feedback |
nymius
reviewed
Sep 3, 2026
MusabYK
force-pushed
the
add-k_max-cap
branch
from
September 3, 2026 13:25
dfd71b8 to
1598b06
Compare
Contributor
Author
Done! |
nymius
approved these changes
Sep 3, 2026
Collaborator
|
If you want to work in a follow up: I prefer these slow tests to only execute on CI, and ignore them in |
Contributor
Author
|
Makes sense. I'll look into it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #67 by adding const K_MAX: u32 = 2323 to silentpayments::receive, and a threshold check to the matched_tweaks counter loop in scan_txouts. Also added a ScanLimitExceeded(u32) variant to SpReceiveError returning an explicit error
Notes to the reviewers
I replaced
check_cases(27)with a dedicatedmaximum_per_group_recipient_limit_k_max_is_exceeded()test function that explicitly matches and asserts SpReceiveError::ScanLimitExceeded(K_MAX) on test vector 27, preservingcheck_casesfor standard test vectors. i think modifying it with hardcoded branch conditions for test 27 makes the general test runner dirty.All Submissions:
just p(fmt, clippy and test) before committingNew Features:
Bugfixes: