Skip to content

v5.21.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 18:51
· 317 commits to main since this release
684a621

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 balance or top_balances result by key: read complete_history
    rather than assuming a key. A nest records whether its history began at its configured start_block
    with no --backfill (the deployment block, when init set 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
    configured start_block keeps balance and holders and gains complete_history: true; one that
    began elsewhere (started with --backfill, or with no start_block) now returns
    net_flow_since_indexed_from and net_receivers, with complete_history: false, indexed_from and
    a note; a store that records no start block stays unknown (complete_history: null) and reads the
    same way. The HTTP /balance and /balances routes are unchanged.
  • The MCP sql tool'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.txt and SKILL.md are part of a nest's package and now describe the balance routes and the MCP
    explain, queries and query tools only where the nest has them. Its data identity is the same.
    An existing nest keeps its NID: dev no longer rewrites those two files when it regenerates a stale
    schema.json, and warns when they describe tables the schema no longer has;
    nuthatch schema regenerates 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 the Host it saw. That name then reads watched data and
    changes nothing: watch, unwatch, the proxy module, 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, no mounts.toml beside it): new
    seals go into the nest's own segments/. 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-graph build's port-emit from a graph init scaffold: running
    port-emit again rewrites its views with an id column, 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 N on 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
    --concurrency against a rate-limited public endpoint.
  • Every operator with sealed history: a restart no longer rehashes every segment before the nest
    serves. Expect a segment-verify thread 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
    answers 503 as soon as it holds a block past the watermark, with integrity.seals_stopped: true,
    where it answered 200 until the seal clock ran out, hours later on a sparse nest. A restart
    clears it. A nest with nothing quarantined answers exactly as before; integrity is absent.
  • A dashboard or job timing a credit/debit fold on /sql (a SUM of 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 answered 500
    and counted as nuthatch_sql_rejections_total{reason="internal"}, not 400 and invalid.

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 loopback Host and 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
    rewrites Host to loopback and adds no forwarding header, as nginx's plain proxy_pass does, 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 as Authorization: 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, explain or the prompts
    that tell the agent to run SQL; queries and query reach the declared queries. GET /shape reports
    free_form and the number of declared queries.
  • nuthatch mcp --url at 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 /nests whether 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 sql provenance line prints the source the node sent and leads with a notice when the live tip
    could not be read, where it always said hot+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 whose id is null) gets -32600 Invalid Request with a null id. A response
    object (result or error, no method) is ignored without a reply.
  • server.json names the current release and image, and scripts/version-check.sh checks it.

Dev

  • --backfill on a nest that already has blocks says it does not apply. The flag only chooses
    where a first run starts, so rerunning dev --backfill 300 after 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

  • dev says 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).
  • init stops warning USDC about zero rows. A proxy's own Upgraded, AdminChanged and
    BeaconUpgraded logs no longer count as a mismatch with the implementation's ABI (#2855).
  • init --chain on an address with no code says so, and names --abi for a contract that
    self-destructed, instead of asking for an Etherscan key (#2867).
  • The scaffolded .gitignore now lists nuthatch.redb and segments/. It does not move a
    nest's identity, and an existing .gitignore is not rewritten (#2864).

Backfill

  • One RPC endpoint is no longer capped to one window at a time. --concurrency N on 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 publish hashes 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 in degraded_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.
  • /ready says what the integrity passes took. integrity names the quarantined segments, the
    tables they reduce, whether seals have stopped on a lost provisional tail (which now answers 503
    at once) and whether the derived state rebuilt at start read a segment since quarantined. While it
    did, /balances, /balance, /exposure, /flags and /derived carry
    "derived_state_stale": true and /sql lists a referenced entity in degraded_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 /ready counts it (#2902).
  • nuthatch publish reads 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 running dev holds;
    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 data keeps 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 a mounts.toml. A nest already sealed that way keeps reading those files where they are, and
    seals into its own segments/ 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 /metrics says so. The start derives what /ready reports
    from what quarantine/ holds, so a reduced table stays reported until a seal writes the segment
    back; nuthatch_quarantined_segments and nuthatch_derived_state_stale carry 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 verify names it, and seed refuses 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 in nuthatch_follower_held_generation_seconds, and one waiting
    on its first snapshot names the file it is fetching.
  • /sql and 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 NULLS and ^@. 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's inspect::calls; what it refuses is unchanged. A refusal names the function as the
    engine resolves it, in lower case, so an unlisted VERSION() is now named version (#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 20000 queued only the last block's rows. Nothing warned
    and nothing failed. A webhook now delivers only through the nest's sealed watermark. A
    --seal-direct backfill 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 its since, 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_blocks and nuthatch_webhook_failures_total carry a nest label,
    and are dropped when the nest is unmounted.

SQL

  • An authored view over labels or an offchain snapshot answers. Both were bound after the
    authored views were defined, so a views/*.sql view 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
    and dev'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
    MCP schema tool. /sql and /explain, on a node and in the tab, now give the
    information_schema query that lists the tables or a table's columns, and a valid /explain says
    to run the query at /sql; an MCP agent is still told the tool, and nuthatch sql,
    nuthatch check and dev's log name the REPL's .tables and .schema. A client that matched
    the old sentence in an error body or the /explain note 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 ANALYZE prints the same totals, with
    filename reading (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 JOIN is refused by name. It failed as Expected: MATCH_CONDITION, found: ON; it is now
    refused with a row_number() recipe for the nearest row. asof still works as a column or alias.
  • A HAVING with 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-contract subgraph now ports with its ids. Every entity that
    scaffold writes is keyed event.transaction.hash.concatI32(event.logIndex.toI32()), which
    port-emit could not render, so each view had no id, GraphQL answered none of them and the
    coverage line read 0 of 27. It now renders that id, and the spelling
    concat(Bytes.fromI32(event.logIndex.toI32())), from tx_hash and log_index as the 0x
    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-emit is unchanged (#2843).