Repository navigation
v5.21.0
Nuthatch 5.21.0 is the fixes from the 2026-11-12 audit: the loopback Host check on every route,
memory-bounded scans and a spilling pool that shares fairly, MCP answers that say what history they
cover, and a webhook that no longer skips a backfill's rows. There is no storage migration and no
existing nest's NID changes. Several answers, statuses and MCP results read differently, so read the
upgrade guidance before rolling a nest that agents, dashboards or a proxy depend on.
Upgrade guidance
- An agent that reads the MCP
balanceortop_balancesresult by key: readcomplete_history
rather than assuming a key. A nest records whether its history began at its configuredstart_block
with no--backfill(the deployment block, wheninitset it). On the first start of 5.21 an
existing nest works that out once from the block its store began at: one that began at its
configuredstart_blockkeepsbalanceandholdersand gainscomplete_history: true; one that
began elsewhere (started with--backfill, or with nostart_block) now returns
net_flow_since_indexed_fromandnet_receivers, withcomplete_history: false,indexed_fromand
a note; a store that records no start block stays unknown (complete_history: null) and reads the
same way. The HTTP/balanceand/balancesroutes are unchanged. - The MCP
sqltool's text table: every data row now begins with|, a line saying how many rows
follow comes first, and the whole answer is held to 256 KiB with one notice saying what cut it. - A nest scaffolded by 5.21 gets a different NID from the same contracts scaffolded by 5.20, because
llms.txtandSKILL.mdare part of a nest's package and now describe the balance routes and the MCP
explain,queriesandquerytools only where the nest has them. Its data identity is the same.
An existing nest keeps its NID:devno longer rewrites those two files when it regenerates a stale
schema.json, and warns when they describe tables the schema no longer has;
nuthatch schemaregenerates them on request. - An address-history nest on a loopback bind behind a reverse proxy that passes the client's
Host: it answers 403 on every route until it is started with--public-host <name>for the
name the proxy forwards. The 403 names theHostit saw. That name then reads watched data and
changes nothing: watch, unwatch, theproxymodule, tracing by hash and the timestamp search stay
with callers on the machine itself. - rotki in a container on Docker Desktop, reaching a nest on the host's loopback: start the nest
with--local-host host.docker.internal. - rotki, or any client, on the same machine as the nest: nothing to do.
- A solo nest kept under a directory named
data(not a NID, nomounts.tomlbeside it): new
seals go into the nest's ownsegments/. Its earlier segments stay in<parent of data>/segments
and are still read from there; leave them while any sibling nest might name the same files. - A nest ported with the
nuthatch-graphbuild'sport-emitfrom agraph initscaffold: running
port-emitagain rewrites its views with anidcolumn, so the nest gets a new NID, as any change
to a view gives it. A nest left as it is keeps its views and its NID. - A seal-direct backfill started with
--concurrency Non one RPC endpoint, as the sample
systemd unit is: it now runs N-way instead of one window at a time, and says so at start. Lower
--concurrencyagainst a rate-limited public endpoint. - Every operator with sealed history: a restart no longer rehashes every segment before the nest
serves. Expect asegment-verifythread reading at up to 64 MiB/s a minute after start, and again
every 24 hours. - A load balancer or monitor reading
/ready: a nest whose provisional tail is quarantined now
answers503as soon as it holds a block past the watermark, withintegrity.seals_stopped: true,
where it answered200until the seal clock ran out, hours later on a sparse nest. A restart
clears it. A nest with nothing quarantined answers exactly as before;integrityis absent. - A dashboard or job timing a credit/debit fold on
/sql(aSUMof signed amounts grouped by
holder): Burrmill no longer swaps it for its own fold operator, because nuthatch always gives the
engine a spill directory and the owned fold could only refuse where DataFusion's aggregate can
spill. The answers are the same; its time and memory are DataFusion's. - An alert or client reading
/sql's status: a statement the engine panics on is answered500
and counted asnuthatch_sql_rejections_total{reason="internal"}, not400andinvalid.
Address history
- A loopback bind answers only a loopback or declared
Host, on every route. A web page that
rebinds a DNS name to 127.0.0.1 could read the watched addresses and their history, and a page or
a proxy could unwatch them and borrow the operator's RPC, because the nest trusted the socket. A
request is now this machine only with a loopbackHostand no proxy header or other site's
Origin; see operators.md for the rule and the one proxy shape no header can
reveal (#2847). - An optional write token for a nest behind a proxy that hides itself. A reverse proxy that
rewritesHostto loopback and adds no forwarding header, as nginx's plainproxy_passdoes, made
every caller look like this machine, so anyone through it could watch, unwatch and borrow the RPC.
--write-token-env <VAR>now names an environment variable whose token those actions, tracing by
hash and the timestamp search then need asAuthorization: Bearer, from this machine too; reads
need none, and the token never makes a public caller local. A token shorter than 16 characters, or
the flag off a loopback bind, stops the nest at start. Without the flag nothing changes (#2910).
MCP
- A mount that answers only declared queries no longer advertises
sql,explainor the prompts
that tell the agent to run SQL;queriesandqueryreach the declared queries.GET /shapereports
free_formand the number of declared queries. nuthatch mcp --urlat a runtime's root offers one tool,mounts, naming the mounts to point at,
where every tool used to answer a bare 404. A trailing slash on the URL no longer breaks the routes.
A bridge pointed at one nest or mount asks/nestswhether it is at a root once a session, not
on every 404, and a root with nothing mounted yet says so and names a mount once one is added.- The
sqlprovenance line prints the source the node sent and leads with a notice when the live tip
could not be read, where it always saidhot+sealed. - A message that is valid JSON but not a request (a number, a string, an array, an object with no
method, or a request whoseidis null) gets-32600 Invalid Requestwith a null id. A response
object (resultorerror, nomethod) is ignored without a reply. server.jsonnames the current release and image, andscripts/version-check.shchecks it.
Dev
--backfillon a nest that already has blocks says it does not apply. The flag only chooses
where a first run starts, so rerunningdev --backfill 300after the first window had committed
silently resumed the full-history backfill. It now logs that the dataset resumes from its last
block and, for a nest whose segments sit in its own directory, how to start over; the advice
printed at the start of a long backfill says the same (#2848).
First run
devsays when it has caught up. The window that reached the tip slept the whole poll
interval before announcing it, so the last line read "behind tip" and the progress line then ran
past 100%. It now finishes the catch-up first, and a mounts runtime, on either cursor, logs one
"caught up to tip" line per catch-up (#2854).- A restarted backfill no longer says an event "likely never fired". The notice for empty
declared tables names the range indexed and whether the nest has reached the tip, and says so
when it could not read the tip (#2866). initstops warning USDC about zero rows. A proxy's ownUpgraded,AdminChangedand
BeaconUpgradedlogs no longer count as a mismatch with the implementation's ABI (#2855).init --chainon an address with no code says so, and names--abifor a contract that
self-destructed, instead of asking for an Etherscan key (#2867).- The scaffolded
.gitignorenow listsnuthatch.redbandsegments/. It does not move a
nest's identity, and an existing.gitignoreis not rewritten (#2864).
Backfill
- One RPC endpoint is no longer capped to one window at a time.
--concurrency Non a
seal-direct backfill runs N-way on one endpoint as on several. The cap guarded a 2026-07 stall
that was a timed-out window ending an ingest task nothing awaited; both halves have since been
fixed. What the windows in flight may hold is now bounded whatever the concurrency
(SEAL_DIRECT_IN_FLIGHT_LOGS), and CI fails a 16-way backfill over 512 MB (#2880).
Sealed segments
- A restart serves at once, and every segment is still hashed. The start rereads only segment
files that changed since a pass last hashed them (segments/verified.json); a background pass then
hashes every segment a minute after start, at up to 64 MiB/s across the process, and every 24 hours
after, quarantining a mismatch as the start does.nuthatch publishhashes each segment before it
uploads it and refuses one that does not match. The views and balances rebuilt at start now read
segments before the background pass has verified them, where before rot that happened before a
restart was caught before the rebuild; and nothing retracts derived state built from a segment
that is later quarantined, so it stays wrong until the next restart. See the failure model in
operators.md for when a corrupted segment is now found (#2853). - A corrupt segment in a runtime's shared store is quarantined, not served. It was reported and
left in place, so every mount that named it kept answering from the bad bytes. It now moves to
<root>/quarantine/<hash>.parquet, and every dataset naming that hash answers reduced, with the
table indegraded_tables, until the same rows are sealed again (#2897). A segment quarantined a
second time keeps the first copy, the new one named<name>.<unix seconds>.<nanos>.parquet. /readysays what the integrity passes took.integritynames the quarantined segments, the
tables they reduce, whether seals have stopped on a lost provisional tail (which now answers503
at once) and whether the derived state rebuilt at start read a segment since quarantined. While it
did,/balances,/balance,/exposure,/flagsand/derivedcarry
"derived_state_stale": trueand/sqllists a referenced entity indegraded_tables, until a
restart rebuilds them from what remains (#2898, #2900).- Quarantine works when
segments/is a link onto another filesystem. The move was a rename,
which fails across filesystems, and the segment stayed in place and served. It is now copied aside
and removed, and one that cannot be moved at all is refused in place: queries answer reduced, a
fold or rebuild will not read it, and/readycounts it (#2902). nuthatch publishreads each segment once. It hashed a segment and then read it again to
upload it, so a first publish of a 7 GB nest read 14 GB and a file changed between the two reads
went up unchecked. Every mirror now hashes the bytes as it reads them for upload, for sealed,
provisional, seed and offchain segments alike, and stores nothing under the key when they are not
the address. It quarantines a bad segment only for a solo nest no runningdevholds;
a shared one, or one a running writer holds, is refused and left for that writer's own pass (#2901).- A solo nest inside a directory named
datakeeps its segments in itself. It was taken for a
runtime's dataset by its parent's name and sealed into<parent of data>/segments, shared with
every sibling. A dataset is now a runtime's only when its directory is named by a NID or its root
has amounts.toml. A nest already sealed that way keeps reading those files where they are, and
seals into its ownsegments/from now on; one of those files found corrupt is quarantined beside
that store, for every nest that names it (#2896). - A quarantine outlives a restart, and
/metricssays so. The start derives what/readyreports
from whatquarantine/holds, so a reduced table stays reported until a seal writes the segment
back;nuthatch_quarantined_segmentsandnuthatch_derived_state_stalecarry the same for alerts.
A publisher in the writer's process asks that writer to verify a final segment it refused, which
it does once the verifier is free, during a full pass after the segment it is reading. A
quarantined segment the mirror never held stays catalogued with no file, and still counts in
nuthatch_publish_lag_blocks, so the mirror advances rather than stalling; a follower refuses a
query that would read it,publish verifynames it, andseedrefuses naming the segment and
its blocks rather than leave a nest silently short. A copy across filesystems
now syncs both directories. A remote follower holding an earlier generation says so on/ready
(holding_earlier_generation) and innuthatch_follower_held_generation_seconds, and one waiting
on its first snapshot names the file it is fetching. /sqland every analytical query cost less on a large nest. The segment catalogue is parsed
once per version instead of up to four times a request, imported labels are bound only for a
statement that reads them, and a session left at a moved watermark is dropped (#2863, #2852,
#2862).
Shared runtime
- A strict-isolation runtime answers
IGNORE NULLSand^@. Its function allow-list read each
statement with a parser that knew neither, so it refused them, and every view that used them, as
statements it could not read. It now reads the calls as the engine parses the statement, through
Burrmill'sinspect::calls; what it refuses is unchanged. A refusal names the function as the
engine resolves it, in lower case, so an unlistedVERSION()is now namedversion(#2899).
Webhooks
- Fixed a data gap: a
since = "genesis"(or block-number) webhook on a plain backfill skipped most of
the history. Delivery was bounded by the chain's finality, not by what the nest had sealed, so a
backfill still sealing block 5,000 while the chain was final at 20,000 moved the webhook's cursor
to 20,000 over blocks that had no segments yet, and the rows sealed afterwards were never queued.
On the footprint fixture,dev --backfill 20000queued only the last block's rows. Nothing warned
and nothing failed. A webhook now delivers only through the nest's sealed watermark. A
--seal-directbackfill was not affected. Rows an affected webhook already skipped are not re-sent;
to replay them, register the webhook under a new name, which starts again from itssince, and
expect the receiver to see the rows it already had a second time. Renaming a webhook edits
nuthatch.toml, which is a data input, so the nest's NID changes: a solo nest restarts, but a
runtime mounts a new NID and re-indexes in full. - A stop between chunks no longer queues rows twice. Each chunk of a slice is committed with the cursor position it leaves (redb store; Postgres still commits them separately), so a crash re-queues nothing the outbox already holds. Delivery to the endpoint remains at least once.
- Webhook queries no longer run on the writer's seal hook. A collector task per nest queries and
queues them, so a seal no longer waits up to about 3 s for a tenant's query. A backlog held when
the process stopped is delivered after a restart without waiting for the next seal. A webhook whose
query keeps failing backs off from 5 s to 5 minutes, logs once when it starts failing and once
when it recovers, and a pass that merely runs out of its time budget is no longer counted in
nuthatch_webhook_failures_total. nuthatch_webhook_backlog_blocksandnuthatch_webhook_failures_totalcarry anestlabel,
and are dropped when the nest is unmounted.
SQL
- An authored view over
labelsor an offchain snapshot answers. Both were bound after the
authored views were defined, so aviews/*.sqlview reading either failed to define and/sql
said there was no such table. They are now bound first, and the tab binds its labels and factory
children first too. Labels are still read only for a statement that reaches them.nuthatch check
anddev's load warning bind offchain snapshots as well, so they no longer report a view over
offchain__*as broken (#2903). - A SQL error's hint names what lists the tables where you are. It told every caller to call the
MCPschematool./sqland/explain, on a node and in the tab, now give the
information_schemaquery that lists the tables or a table's columns, and a valid/explainsays
to run the query at/sql; an MCP agent is still told the tool, andnuthatch sql,
nuthatch checkanddev's log name the REPL's.tablesand.schema. A client that matched
the old sentence in an error body or the/explainnote will not find it (#2904). - A large scan keeps to the memory budget. A scan held about 4.6 KB of DataFusion's per-file
metrics for every segment it opened, about 89 MB at 15,108 segments, and charged its bookkeeping
to the pool in a way that could take it past its bound, so a sort beside it was refused
out-of-memory some of the time. Burrmill now carries DataFusion's parquet scan with those metrics
kept once per partition, and a scan that cannot get its bookkeeping is refused by name rather
than leaving the refusal to the next sort.EXPLAIN ANALYZEprints the same totals, with
filenamereading(every file)(#2895). - Statements sharing a pool share it fairly. Every nuthatch engine has a spill directory, and
its pool now gives each operator that can spill its share, where the first to ask could take it
all and leave the next one refused. An operator past its share borrows from idle ones while one
share stays free, so an aggregate replaying its spills is no longer refused with most of the pool
unused. ASOF JOINis refused by name. It failed asExpected: MATCH_CONDITION, found: ON; it is now
refused with arow_number()recipe for the nearest row.asofstill works as a column or alias.- A
HAVINGwith no aggregate answers.SELECT a FROM t GROUP BY a HAVING upper(a) = 'X'
panicked the engine; it now answers the rows DuckDB does. - A panic in the engine is a named error. It is answered
500, saying the fault is nuthatch's
and not the statement's, without a hint to rewrite the query, and the engine answers the next
statement.
Graph compatibility (the nuthatch-graph build)
- A stock
graph init --from-contractsubgraph now ports with its ids. Every entity that
scaffold writes is keyedevent.transaction.hash.concatI32(event.logIndex.toI32()), which
port-emitcould not render, so each view had noid, GraphQL answered none of them and the
coverage line read0 of 27. It now renders that id, and the spelling
concat(Bytes.fromI32(event.logIndex.toI32())), fromtx_hashandlog_indexas the0x
lowercase hex graph-node serves: the hash, then the log index's four bytes least significant
first. A view whose id still cannot be rendered is refused by name, as before. The default build's
port-emitis unchanged (#2843).