mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
The outbox model — and especially the wide relay-list broadcast — delivers the same event from many relays at once, and the gated drain ran a Schnorr verify (and a store insert) on every copy before the store's UNIQUE constraint dropped it. On a fan-out that asks hundreds of relays for the same kind:10002s, that is hundreds of redundant verifications per event and pegged a core. Add a per-drain SeenIds skip-before-verify to the consumer, mirroring drainAllPages: an id is marked seen only after it verifies, so a forged copy (valid id, bad signature) delivered first can't suppress the genuine one. Cuts the redundant verification across the whole crawl, not just the wide sweep.