sync: a page is stored in one transaction with parallel verification; a sync is cut off by idleness, not a fixed 2 minutes

20,000 listings to a newcomer: 120 s (unfinished) -> 24 s.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-19 09:46:27 +01:00
co-authored by Claude Sonnet 5.5
parent fc3a1efba4
commit 7da38a9e7e
8 changed files with 352 additions and 29 deletions
+4 -1
View File
@@ -163,7 +163,10 @@ starting a design-heavy item; see "Working with the owner".
Not measured: relayed streams (need a node behind a NAT). The run found that
a newcomer stored only ~137 listings/s with SQLite's `synchronous=FULL` and
its 2-minute sync cut-off left 18% of a 20k region for the next round; the
store now uses `synchronous=NORMAL` (63 s for all 20,140).
store now uses `synchronous=NORMAL`, stores a sync page in one transaction
(`PutMany`, signatures checked in parallel), and a sync is only cut off
after 2 minutes without progress (30 minutes at most). A newcomer taking
20,000 listings: 120 s and unfinished before, 24 s now.
- **What the abuse limits do not cover** (`internal/p2p/guard.go`, `ipgate.go`,
`internal/api/ratelimit.go`): attackers with many real addresses, valid but
unwanted records under the limits, and bans are per node and not shared