fix(nip17): drop since filter on kind 1059 subscription #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/gift-wrap-since-filter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
NIP-59 randomizes gift wrap
created_atup to 2 days into the past to defeat metadata correlation. The lenientsince = last_dm_time - 5minwindow from commite0fdada(designed for NIP-04 messages with real timestamps) locks out any gift wrap whose randomized timestamp falls before the latest stored DM.aio-demo symptom: established merchant with
last_dm_time = today 14:40subscribed withsince = today 14:35. Customer published a new gift wrap whose randomizedcreated_atwasMay 1 23:11. The relay'sNostrFilter.matchesseesevent.created_at < self.sinceand returns False — relay logs❌ Filter didn't matchand the order never reaches the merchant. Locally this didn't reproduce because regtest had no DM history, solast_dm_time = 0skipped thesinceclause.Fix
Drop
sinceentirely on the kind 1059 filter. Replay risk is bounded by:NostrClient.is_duplicate_event()(bounded LRU set in our subscription health monitor)Other filters (stalls, products, profiles) keep their
since— those events use real timestamps so the optimization still works.Test plan
make test— 44/44 passv1.1.0-aio.3on aio-demo, retry the order flow that was failing, confirm_handle_gift_wrapruns and an invoice is generatedsincefilter on kind 1059 subscription