Skip to content

implement NIP-62#49

Open
mattn wants to merge 5 commits into
fiatjaf:masterfrom
mattn:nip-62
Open

implement NIP-62#49
mattn wants to merge 5 commits into
fiatjaf:masterfrom
mattn:nip-62

Conversation

@mattn

@mattn mattn commented Nov 17, 2025

Copy link
Copy Markdown
Collaborator

Please review carefully, as data loss may occur due to my bugs.

@fiatjaf

fiatjaf commented Nov 21, 2025

Copy link
Copy Markdown
Owner

Looks good, but I didn't review carefully.

mattn added 4 commits June 17, 2026 09:47
- lmdb: stop deleting from the pubkey index while iterating its own
  cursor, which corrupted iteration and left entries behind; collect
  matching events first, then delete via the shared delete(). Also skip
  kind 62 (vanish requests) to match the other backends.
- badger: stream deletes through a WriteBatch over a View snapshot so
  pubkeys with many events don't blow past the per-transaction size cap
  (Txn too big), same fix as migration 5.
- honor ctx cancellation in the badger/lmdb iteration loops.
- replace the magic kind 62 with a named kindRequestToVanish constant
  across all backends.
- add a slicestore VanishPubkey test.
Vanishing is irreversible and deletes every event for evt.PubKey, so a
forged kind 62 event with a victim's pubkey must not be honored. Check
the signature before saving or vanishing, rejecting invalid requests.

Also collapse the duplicated relay-tag handling into a single path and
add an exported KindRequestToVanish constant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants