Skip to content

v0.7.2 - a nest that indexes nothing now says so

Choose a tag to compare

@github-actions github-actions released this 29 Jul 09:01
· 4818 commits to main since this release
9773221

A nest that indexes nothing now says so, and the last unstarted RFC has started. In-place safe from 0.6.x, 0.7.0 and 0.7.1: no data migration, no config changes, no flag changes.

init no longer scaffolds a silently-empty nest

The quietest failure nuthatch had. Most protocol contracts are proxies; standard ones (EIP-1967, EIP-1822, legacy zeppelinos, beacon) are followed automatically to the implementation's ABI. A protocol using a bespoke proxy matches none of those slots, so Sourcify/Etherscan return the proxy's ABI - typically two or three administrative events - and every event you actually wanted is missing.

init then succeeds. The schema looks plausible. The tables stay empty, and nothing says why. It cost us most of a day on the Livepeer nest, and the only reason we caught it was noticing the event count looked too small.

Chasing more proxy patterns does not fix this - there is always one more bespoke proxy. The silence is what is fixable, so init now samples the contract's real logs and checks whether the ABI decodes any of them:

⚠ bonding (0x35Bc…): none of its last 47 log(s) match any event in the resolved ABI.
  As configured this contract will index zero rows, silently.
  The usual cause is a proxy: …

Two things it will not claim, deliberately. A contract that has emitted nothing recently proves nothing either way, so it stays quiet rather than crying wolf - a warning that fires when nothing is wrong gets ignored on the day it fires when something is. And one matching log clears it: a contract may legitimately emit events its ABI omits, and only the total miss is the silent failure. It never blocks init either; RPC trouble means no output, the same best-effort posture as deploy-block detection.

--abi: bring your own ABI

nuthatch init 0xProxyAddr --abi path/to/implementation.json

One per address, in the same order as the addresses; leave an entry empty to resolve that one normally, so overriding the second of three contracts does not force you to find ABIs for the other two. Hardhat and Foundry artifacts work as-is - the ABI is unwrapped from the "abi" key - and the file is parsed as a contract ABI before it is accepted, so pointing at the wrong file (a subgraph manifest, say) fails immediately with a clear message rather than later as an empty registry. Also on nuthatch add.

Previously the workaround was overwriting abis/*.json by hand and re-running nuthatch schema. That still works for an existing nest.

RFC-0014 slice 0: calldata decode, without the node

RFC-0014 (firehose-class extraction - call traces and storage diffs) was the last unstarted RFC, deferred behind a colocated reth node. The slice that needs no node turns out to be the one carrying most of the correctness risk, so it is now built and tested:

  • Calldata decode keyed by the 4-byte function selector - the same idea as topic0, one layer down. A pure function of (ABI, calldata).
  • [extract] config - traces/state opt-in per nest, both default off, with contracts and selectors scoping. Mirrored into nest.star.
  • Table schemas - {alias}__call_{fn}, calls_raw, state_diffs, emitted into schema.json beside events.
  • The volume guard - unscoped extraction is refused, not warned about.

Extraction itself is not in, and a nest declaring [extract] is refused at startup. There is no source: traces and state can only come from a colocated node (RFC-0003), and this project will not source them from debug_* RPC. Starting anyway would mean traces and state_diffs existing, answering queries and returning nothing - and an empty table is indistinguishable from "no matching rows" to whoever is querying it. Better to be told the source is missing. The refusal validates your whole [extract] config on the way past, so a typo'd alias or malformed selector surfaces now rather than on the day a node appears.

Three decisions worth knowing about:

  • A decode miss produces a row. An unrecognised topic0 belongs to some other contract. An unrecognised selector on a contract you index is information - usually an ABI predating an implementation upgrade - so it lands in calls_raw with the raw input rather than vanishing.
  • Call tables are {alias}__call_{fn}. A contract can have both a Transfer event and a transfer function; usdc__transfer has meant the event since 0.1.0 and keeps meaning it.
  • The guard refuses rather than warns. Unscoped extraction is unbounded by chain traffic, not by anything you wrote. unbounded = true is the escape hatch and has to be typed by a human.

Also

  • schema.json gains a kind discriminator on each table (event, call, state). It defaults to event and is omitted when serialising, so an existing nest's artifact is byte-identical.
  • The dense-roost RAM claim is now measured rather than asserted: 8 nests on one Arbitrum cursor, peak 89 MB against the 2048 MB per-cursor budget. Recorded in docs/prod-readiness.md §5, along with what it does not prove - it bounds density, not longevity.

Verifying the download

curl -fsSLO https://github.com/nuthatch-indexer/nuthatch/releases/download/v0.7.2/nuthatch-x86_64-unknown-linux-gnu.tar.gz
curl -fsSLO https://github.com/nuthatch-indexer/nuthatch/releases/download/v0.7.2/nuthatch-x86_64-unknown-linux-gnu.tar.gz.sha256
sha256sum -c nuthatch-x86_64-unknown-linux-gnu.tar.gz.sha256

Container image: ghcr.io/nuthatch-indexer/nuthatch:0.7.2 (linux/amd64, glibc floor 2.34).