Skip to content

Commit 7aa6f9f

Browse files
committed
Cap the seed crawl as a circuit breaker, not a budget
1 parent 86822d7 commit 7aa6f9f

2 files changed

Lines changed: 22 additions & 13 deletions

File tree

operations/MANUAL-DEPLOY.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,11 @@ read the caps in the spec as a spend ceiling:
187187
curl -s -X POST https://mainnet.base.org -H 'content-type: application/json' \
188188
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["<attester>","latest"]}'
189189

190-
Half a cent per page at the gas measured on 2026-09-09, so the spec's `--max=1500` is about
191-
7.50 USD. An attester that runs dry does not lose the work: the receipts are owed by the
192-
database, the sweeper re-asks every minute, and funding it is what completes them.
190+
Half a cent per page at the gas measured on 2026-09-09. A full pass over the four seeds that
191+
publish sitemaps is 3,761 pages, about 19 USD; the spec's `--max` sits above that as a circuit
192+
breaker against a link-followed host with an unbounded URL space, not as a budget. An attester
193+
that runs dry does not lose the work: the receipts are owed by the database, the sweeper re-asks
194+
every minute, and funding it is what completes them.
193195

194196
Re-running is safe. The crawler skips what a sitemap reports unchanged and anything fetched
195197
inside `CRAWL_MAX_AGE_DAYS`, so a second submission fetches only what is new or stale, and the

operations/wuzzy-seed.hcl

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,21 @@
2727
#
2828
# Measured on Base on 2026-09-09, tx 0xe7a9adca...b61c: 334,381 gas at
2929
# 0.006 gwei plus an L1 fee of 0.0000000015 ETH, so 0.0000020 ETH per
30-
# attestation, half a cent at 2,493 USD. The caps below bound the run at
31-
# 1,500 pages, about 7.50 USD, which fits inside the 0.00398 ETH the attester
32-
# holds without topping it up. Raise them and fund it first, or the attester
33-
# runs out mid-corpus and retries every minute until it is funded.
30+
# attestation, half a cent at 2,493 USD. The four seeds that publish sitemaps
31+
# list 3,761 URLs between them, so a full pass is about 19 USD.
3432
#
35-
# The per-host cap is what spreads the budget. docs.cdp.coinbase.com alone lists
36-
# 2,357 sitemap URLs and would otherwise consume the whole run before the
37-
# crawler reached the fifth seed.
33+
# `--max` is a circuit breaker rather than a budget, which is why it sits well
34+
# above that figure. Three of the seven seeds publish no sitemap and are reached
35+
# by following links instead, and a link-followed host can expose an unbounded
36+
# URL space through pagination or a calendar. Scope is the exact host, so the
37+
# damage is capped at one site either way, but a run that stops at a number
38+
# somebody chose is easier to read than one that stops when a quota runs out.
39+
#
40+
# There is deliberately no `--per-host` cap. It would truncate whichever host
41+
# the crawler reaches with the budget already spent, and truncating a corpus by
42+
# sitemap order drops pages for a reason that has nothing to do with what they
43+
# say. docs.cdp.coinbase.com is 2,357 of those URLs, the x402 reference among
44+
# them, and a partial copy of it is worse than a complete one is skewed.
3845
job "wuzzy-seed" {
3946
datacenters = ["mb-hel"]
4047
type = "batch"
@@ -71,7 +78,7 @@ job "wuzzy-seed" {
7178
image = "ghcr.io/memetic-block/wuzzy-backend:sha-b13567c0482148c34cfeda3bebfd42bd5febd8cf"
7279
entrypoint = ["/bin/sh", "-c"]
7380
args = [
74-
"set -e; bun apps/backend/src/cli/wuzzy.ts crawl --per-host=250 --max=1500; bun apps/backend/src/cli/wuzzy.ts embed",
81+
"set -e; bun apps/backend/src/cli/wuzzy.ts crawl --max=6000; bun apps/backend/src/cli/wuzzy.ts embed",
7582
]
7683
}
7784

@@ -98,8 +105,8 @@ job "wuzzy-seed" {
98105
POSTGRES_PORT={{ .Port }}
99106
{{- end }}
100107
{{- with secret "kv/wuzzy/api" }}
101-
POSTGRES_PASSWORD={{ .Data.data.POSTGRES_PASSWORD | required "POSTGRES_PASSWORD missing from kv/wuzzy/api" }}
102-
EMBEDDING_API_KEY={{ .Data.data.EMBEDDING_API_KEY | required "EMBEDDING_API_KEY missing from kv/wuzzy/api" }}
108+
POSTGRES_PASSWORD="{{ .Data.data.POSTGRES_PASSWORD }}"
109+
EMBEDDING_API_KEY="{{ .Data.data.EMBEDDING_API_KEY }}"
103110
{{- end }}
104111
EOT
105112
destination = "secrets/seed.env"

0 commit comments

Comments
 (0)