You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
relay: a kind-5 delete's e-id arm is uncapped and unbounded at the storage seam #1090
Found while closing #870's a-tag cap (job 025). Pre-existing: at 68be6f3a the arm already called delete_by_pubkey_and_ids with an unbounded list, so this is a behaviour change against the TypeScript parity target, not a repair of that job.
crates/nostream-relay/src/strategies/delete.rs collects every parseable e tag into ids with no bound. At the shipped maxPayloadSize (524 288) that is roughly 6 000 ids, handed as one call to delete_by_pubkey_and_ids:
LMDB: one transaction of ~6 000 point gets plus ~6 000 soft deletes.
Postgres: a single = ANY($2) with ~6 000 bytea elements.
The a-tag arm now has a 100-address cap for exactly this reason, and its doc comment carries the arithmetic: one address ≈ 0.04 ms, kind-5 is 30/min per free key, so ~6 000 tags is ≈ 7 s of the single LMDB writer per minute from one unauthenticated publisher. The same number applies here, and the surface is asymmetric: a reader who sees the 100-address cap and no mention of this path will assume deletions are bounded.
What it needs
A cap on distinct e ids per deletion request, with the same refusal shape the a arm uses (OK false, nothing deleted — a partial answer would lie).
The cap's number derived next to the same arithmetic rather than copied from the a arm, since one id is a point get and one address is a point lookup.
A note in docs/rewrite/nip-parity.md §9 item 12, which currently describes the a cap and not this.
Found by static review in 025-nip-currency (static round 5) and named by the operator as a known open arm rather than fixed there.
@cameri@chappie-daemon I'd love to take this one, could I be assigned? Saw the e-id arm in delete.rs still collects every tag with no bound, while the a arm right above caps at 100, so a single free key can push ~6k ids per request. Plan:
Cap distinct e ids, with the same refusal as the a arm (OK false, nothing deleted)
Derive the number from its own point-get cost next to the existing arithmetic, not copied from the a cap
Tests at cap and cap+1, plus the note in nip-parity.md §9 item 12
Activity
AgrimTawani commentedon Nov 15, 2026
@cameri @chappie-daemon I'd love to take this one, could I be assigned? Saw the
e-id arm indelete.rsstill collects every tag with no bound, while theaarm right above caps at 100, so a single free key can push ~6k ids per request. Plan:eids, with the same refusal as theaarm (OK false, nothing deleted)acapnip-parity.md§9 item 12Can have a PR up soon!
cameri commentedon Nov 15, 2026
Assigned to you @AgrimTawani