Skip to content

v3.9.0

Choose a tag to compare

@github-actions github-actions released this 23 Sep 19:33
· 3427 commits to main since this release
208b2c3

Nuthatch 3.9.0 adds nest nid, which prints the identity a nest's data is stored under, and
offchain pull, a one-shot fetch that seals a price feed as an offchain snapshot. Authored entities
can now read those snapshots while they run. Beside them come correctness fixes in call
extraction, /sql and the GraphQL lane, and the first of the Network Subgraph endpoint, behind a
graph cargo feature that a default build does not have. For most nests it is a binary swap and a
restart. A nest that declares entities, or that calls contracts through a pruned RPC, should read
the compatibility section first.

Compatibility and upgrade

No CLI flag, nuthatch.toml key or metric was removed or renamed, and the NID and data identity
are computed as before.
Checked: git diff v3.8.5..v3.9.0 -- src/cli.rs adds offchain pull and
nest nid and removes nothing; src/metrics.rs is untouched; src/blob.rs adds only
graph/history.toml to the files outside the data identity; calls.rs serialises its two new
declaration keys only when set, so an existing [[calls]] block keeps its hash.

Two configurations 3.8.5 accepted now refuse to start:

  • An entity whose sql is inline, or names a file other than entities/<name>.sql (#1469). In
    3.8.5 dev took inline SQL while check wanted a path, so a nest could pass one and fail the
    other. Both now use one loader. The refusal names the file to create: move the SQL into
    entities/<name>.sql and set sql = "entities/<name>.sql".
  • A contract alias or template name that would put its tables inside offchain__ (#1450), where
    offchain snapshots are served. On /sql one table would have answered with the other's rows.

Three behaviours change:

  • An eth_call item error is no longer stored as a revert (#1455). 3.8.5 wrote any per-item
    error as None, so a pruned node answering missing trie node put "this call reverted" into the
    dataset. Only an explicit revert is stored as None now. Anything else is retried and then stalls
    the nest at that block, logging the provider's error. A nest calling through an endpoint without
    the history it needs will stop where it used to write nulls; point it at an archive endpoint.
  • A row-driven call schedules no periodic blocks (#1457). Headers were fetched for blocks
    nothing read. The Network Subgraph pilot's first million blocks went from 23,078 reserved RPC units
    to 3,038, with byte-identical segments and manifests.
  • The GraphQL lane refuses what it cannot answer exactly (#1465). _meta ignored its arguments,
    so _meta(block: { number: 100 }) answered with the current head; it now takes the same
    block: { number_gte: N } precondition entity roots take and refuses any other argument. An answer
    /sql flags as truncated, degraded or missing its tip is refused by name instead of reaching a
    GraphQL client as complete.

nuthatch nest nid (#1474)

Prints a nest's full NID, the data/<nid>/ a multi-nest runtime stores it under, without running
it. A script writing mounts.toml or calling POST /_admin/nests no longer has to start the nest to
read GET /nest. A bundle-installed nest whose inputs have drifted from its manifest is refused, as
migrate refuses it.

Offchain snapshots reach entities (#1436, #1437)

nuthatch offchain pull <url> --table <name> --format json fetches a JSON-array feed and seals it
through the snapshot writer, for a host timer to run. It is https only unless
--allow-loopback-http is given, capped in size and time, retries 429, 5xx and connection failures,
and follows no redirects. docs/offchain.md has a systemd timer for it.

An authored entity can name offchain__<table> as a source. A snapshot is read only after its bytes
match the manifest hash. A new snapshot is fed to a running entity as a delta; a replaced, removed or
reordered one rebuilds the entity beside the old relation, which keeps serving until the swap. The
maintained relation is tested equal to DuckDB's answer to the same SQL across appended snapshots.

/sql fixes (#1460)

A query through views nested more than eight deep failed with "does not exist"; the walk now follows
views to any depth. A CTE that shared a name with a view pulled that view and its sources into the
query; CTE scope is now respected.

Behind --features graph only

RFC-0059 and RFC-0060 were accepted on the condition that none of this reaches a default build, and
none of it does. A graph build adds config schema v3 with canonical calls, which pin an eth_call
to the source block's hash and refuse on a fork mismatch, and on_any triggers (#1463); Graph
history reads through graph/history.toml and the Network Subgraph client dialect (#1466); and the
client contract suite (#1467). A default build refuses a schema v3 nest, or one carrying
graph/history.toml, by naming the feature.

Also

  • RFC-0061: 256-bit values stay canonical decimal text in segments (#1447). No format change.
  • Deterministic tests for retry hints, IPFS deadlines and authoring-runner cleanup (#1470, #1471,
    #1472), and CI caches that no longer evict main's (#1445).