Merged
Conversation
Owner
|
Are we missing the code refactor to use the new flag on the users table? |
There was a problem hiding this comment.
Pull request overview
Adds a database-level optimization for NIP-62 “request-to-vanish” checks by introducing a persisted users.is_vanished flag and backfilling it from existing kind-62 events, reducing reliance on repeated events table lookups.
Changes:
- Add
is_vanishedboolean column to theuserstable (defaultfalse, not nullable). - Backfill
is_vanished = truefor users with non-deleted kind-62 events and insert missingusersrows for pubkeys that have active kind-62 events.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
Hey @cameri ! I made migration reversible (removed user inserts from events) and optimized backfill query using EXISTS. Also missing users issue is solved by adding lazy hydration for |
Owner
|
@vikashsiwach Please address conflicts that have surfaced |
5b93ceb to
5436848
Compare
Resolve IUserRepository conflict by retaining both vanish-state methods and new admit-user API, and keep branch passing build/lint/unit tests. Made-with: Cursor
Resolve worker factory merge conflict by keeping vanish-aware UserRepository wiring and upstream NIP-05 repository wiring so vanish and gift-wrap flows remain compatible. Made-with: Cursor
cameri
approved these changes
Apr 18, 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.
This PR introduces a new
is_vanishedcolumn on theuserstable to support a more efficient way of handling NIP-62 (request-to-vanish) checks.Related Issue
Currently NIP-62 query the
eventstable for active kind-62 records on every check.Fixes issue #436
Motivation and Context
The relay have to check every pubkey for an active request-to-vanish by querying events.As events volume grows ,this becomes less efficient. So we introduced a
is_vanishedflag in users table for faster checks.How Has This Been Tested?
npm run build:checknpm run test:unit(504 passing)Types of changes
Checklist: