refactor: use exact pubkey matching for whitelist/blacklist#524
Merged
cameri merged 6 commits intocameri:mainfrom Apr 19, 2026
Merged
refactor: use exact pubkey matching for whitelist/blacklist#524cameri merged 6 commits intocameri:mainfrom
cameri merged 6 commits intocameri:mainfrom
Conversation
Collaborator
There was a problem hiding this comment.
Pull request overview
Refactors pubkey matching for fee-schedule whitelists and event pubkey whitelist/blacklist enforcement to use exact pubkey matches (instead of prefix-based matching), addressing issue #512.
Changes:
- Replace
startsWith-based whitelist/blacklist checks withincludes(exact match) in admission-fee and event-acceptance logic. - Update/add unit tests to assert exact-match behavior (prefix-only entries no longer match).
- Add a changeset documenting the behavior change.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/services/payments-service.ts |
Switch fee whitelist matching to exact pubkey equality during admission-fee computation. |
src/handlers/event-message-handler.ts |
Enforce exact pubkey matching for event whitelist/blacklist checks and admission-fee applicability. |
src/controllers/invoices/post-invoice-controller.ts |
Apply exact pubkey matching for admission-fee whitelist checks and simplify fee summation. |
src/app/static-mirroring-worker.ts |
Enforce exact pubkey matching for static mirroring pubkey whitelist/blacklist + admission-fee applicability. |
test/unit/services/payments-service.spec.ts |
Update whitelist test data and add a regression test ensuring prefix-only whitelist entries do not match. |
test/unit/handlers/event-message-handler.spec.ts |
Update blacklist/whitelist tests to reflect exact-match behavior. |
.changeset/release-whitelist-exact-match.md |
Declare the release note for exact-match behavior change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cameri
reviewed
Apr 19, 2026
Owner
cameri
left a comment
There was a problem hiding this comment.
Please address copilot comments.
dcc83e9 to
70e37b8
Compare
Collaborator
Author
Addressed all the comments and updated the changeset to major |
cameri
approved these changes
Apr 19, 2026
This was referenced Apr 22, 2026
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
This PR updates pubkey matching in whitelist and blacklist to use exact match instead of prefix-based matching.
Related Issue
Fixes issue #512
Motivation and Context
Some parts of codebase used startsWith which incorrectly match unrelated pubkeys sharing the same prefix. Based on discussion, the exact matching is more efficient method.
How Has This Been Tested?
-Ran full unit test suite:
npm run test:unitTypes of changes
Checklist: