Skip to content

[REQUEST] Optimize vanish (NIP-62) checks using table flag #436

@vikashsiwach

Description

@vikashsiwach

Description:
Currently, the relay checks for an active NIP-62(kind:62) vanish request by querying the events table.
If the number of events grows ,this will not be a good practice to scale and will need a additional query.
To be more efficient , we can add a flag to users table (e.g. is_vanished) .

Solution:

  • Add a boolean flag (is_vanished) to the users table.
  • Set this flag when a kind:62 event is processed.
  • Use this flag for vanish checks instead of querying events table.

Benefit:

  • Faster lookups (no event table scan)
  • Simpler logic for checking vanish state
  • Better scalability as event volume grows

Additional context
Optimize the performance of NIP-62 in PR #418

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions