Releases: nightswatchhq/redstart
Release list
v0.16.0
The porting release.
Fixed
- Handler symbols are source-qualified when they would collide. Two sources handling the same event name (three registry contracts all emitting
CollSurplusPoolAddressChanged, say) emitted three identically-named exported functions, three imports sharing one alias, and three manifest entries pointing at the same symbol, whichgraph buildrejects withDuplicate identifier. Colliding handlers now becomehandle<Source><Event>and their trigger classes are aliased per source. A name with nothing to disambiguate is untouched, so the common single-source case still readshandleTransfer. - A bound ABI is imported and listed in the manifest.
Abi.bind(addr)for a contract the data source doesn't itself watch, such as reading a token'ssymbol()from a factory handler or a registry from inside a helperfn, emitted the contract class with no import and no manifestabis:entry, failing eject withCannot find name. Every bind, including in a helper, is now resolved across the project: the ABI is listed on each data source and imported from the modulegraph codegenwrites it to. Declaring an inert template with a dummy block handler is no longer necessary. - Narrow Solidity integers lower correctly. A
uint8/uint16/uint24orint8…int32parameter was typedBigInt, soevent.params.op == 1emitted.equals(1)on whatgraph codegenhad made a nativei32. The width table now matches graph-cli's exactly, and Solidity array types map to lists. - A description containing a colon no longer breaks the manifest. It is emitted as a quoted YAML scalar. Previously the graph CLI refused to parse
subgraph.yamlat all. Bytes.empty/Address.zeroare called, not referenced. They lowered to a bare function reference that failed to compile, likeBigInt.zerobefore it.
Added
redstart verifybuilds, then runsgraph codegen+graph buildover the output.checkandbuildanswer questions about your source;verifyanswers the one that decides a deploy, and it is the command to put in CI. (deploy --dry-runalready did this.verifyis the honest name for it.)entity.field = Noneclears an optional field, lowering to the generated setter'sunset, with no rawstore.get/unset/store.setescape hatch.E056rejects clearing a field that isn'tOption<T>.Booleanis accepted alongsideBool, because that is what everyschema.graphqlsays. The checker used to reject it while its own error text recommended it.E057, unknown trigger parameter.event.params.x(orcall.inputs.x) naming something the ABI doesn't declare is now an error listing the real parameter names, instead of passing through to fail atgraph build. Unnamed ABI inputs areparam0,param1, … exactly asgraph codegennames them.E055,.save()teaches instead of confusing. It used to report "Xhas no fieldsave". It now explains that entities dirty-track and save themselves. The catalogue is 35 codes (29 errors, 6 warnings).- Porting an existing subgraph, a book chapter covering the schema and mapping translation tables, exactly what an event handler can see (and that
event.receiptis not available), the transaction-keyed staging-entity pattern that replaces receipt inspection, multi-source event names, and multi-network deployment. redstart newwrites a fuller.gitignore, andredstart buildsays plainly that its output is generated.
v0.15.0
Author-side MCP server — roadmap §5.3 (the agent keystone).
Added
-
redstart mcp— a Model Context Protocol server. Exposes the toolchain the
compiler already owns as MCP tools an AI agent can drive in a write → check → fix
loop, over stdio (newline-delimited JSON-RPC 2.0, no external SDK):check— type-check a project (path) or inlinesourceand return the
same structured diagnostics asredstart check --json(errors and lint
warnings, each with a code, message, and file/line). A parse/load failure is
returned as a normal{ ok: false, diagnostics }result, not a tool error, so
the agent always gets machine-readable feedback. This is the keystone tool.explain— explain a diagnostic code (what triggers it, the footgun it
prevents, the fix); omitcodeto list every code.build— emitschema.graphql,subgraph.yaml, andsrc/mappings.ts,
returning the artifacts (and optimisation notes);write: truealso writes them.test— run the project'stestblocks natively and return per-test results.
New
redstart-mcpcrate; the CLI gains theredstart mcpsubcommand alongside
redstart lsp.
v0.14.0
Optimising compiler — roadmap §4.3 (fix --ids completeness).
Changed
redstart fix --idsnow converts the via-a-local id pattern. The most common
real-world shape —let id = addr.toHexString(); Entity.create(id, …)— is now
auto-converted (previously reported and skipped): the.toHexString()is dropped
on theletbinding, the construction site is left untouched, and the entity is
flipped toId<Bytes>. It stays conservative: the local is converted only when it
is used exactly once in the handler/function body (that single id site), so
re-typing it toBytescan't affect any other reader. A local that is read again
(logged, concatenated, used as a second id) is still reported and left untouched
(⤫ … id built via a local that is used more than once).
v0.13.0
Optimising compiler — roadmap §4.4 (stored arrays → @derivedFrom).
Added
-
W050 — stored array of entity references. The checker now flags an entity
field typed[Child](a stored array of another entity, not aderived from
relation) and steers to@derivedFrom. graph-node keeps such arrays inline and
rewrites the whole array into a new versioned row on every append, so a growing
one-to-many is O(n²) on disk; a@derivedFromreverse lookup is computed on
read and never stored. Scalar and enum arrays ([String],[BigInt],
[TokenStandard]) are genuinely stored values and are never flagged, and the
recommendedderived fromform stays clean. The diagnostic suggests a concrete
back-ref field name. Registered inredstart explain W050. Brings the
diagnostic catalogue to 32 codes (26 errors, 6 warnings).Like W040, this is a warning rather than an auto-rewrite: the migration needs a
back-ref field the author chooses (and it changes the stored data model), so it
can't be applied mechanically the way immutability inference can.
v0.12.0
Optimising compiler — roadmap §4.3 (Bytes-ids, the rewrite half).
Added
-
redstart fix --ids— the W040 autofix. Turns theString→Bytesid
lint into an opt-in, in-place rewrite: it flips the entity's schema declaration
toId<Bytes>and drops the.toHexString()at every construction site, in
one coordinated pass across all modules. ABytesid indexes ~28% faster and
stores ~48% less than the equivalent hex-string id (Edge & Node benchmark).Conservative by construction — an entity is converted only when every one of
its id sites (in handlers, functions andtestblocks) is provably a single
stringifiedBytes/Addressvalue. A single literal-string id, composite key,
or id built via an intermediate local and the whole entity is left untouched and
reported (⤫ Entity skipped: …), so the command never emits code that fails to
check. It re-verifies the result and refuses to leave a broken tree.--dry-runpreviews the plan without writing. Because aBytesid changes the
stored id representation (hex-string → raw bytes), this is a deliberate data
change — hence opt-in — so redeploy affected subgraphs from the relevant block.
redstart explain W040now points at the fixer.
v0.11.0
Optimising compiler — roadmap §4.3 (Bytes-ids, the id half).
Added
- W040 — stringified-id warning. The checker now flags an entity keyed on a
singleBytes/Addressvalue stringified with.toHexString()/.toHex()
(directly, or via a local), and recommendsid: Id<Bytes>. ABytesid (with
immutability) indexes ~28% faster and stores ~48% less than the equivalent
hex-string id (Edge & Node benchmark). Genuine composite keys
(a.toHexString() + "-" + b…) and literal-string ids are never flagged.
This is a warning rather than an auto-rewrite: converting a String id toBytes
changes the stored id representation (hex-string → raw bytes), so it is a data
change the author opts into — unlike immutability inference, which is
store-identical. Registered inredstart explain W040. Brings the diagnostic
catalogue to 31 codes (26 errors, 5 warnings).
v0.10.0
Optimising compiler — roadmap §4.5.
Added
indexerHints: prune: autoby default. graph-node's default is
prune: never(largest DB, slowest queries); Redstart now emitsprune: auto,
which keeps only the history needed for reorgs — a smaller database and faster
queries, with no effect on current-state queries. The eject path is unchanged
(graph buildaccepts it). Reported as a build note.
v0.9.0
The optimising compiler begins — roadmap §4.3 (Lever 2).
Added
- Inferred
immutableentities. The checker now proves which entities are
append-only — created but never loaded (load/loadInBlock/loadOrCreate) and
never field-mutated anywhere — and codegen emits@entity(immutable: true)for
them automatically. Immutable entities index faster and use far less disk
(Edge & Node benchmark: up to 19% faster / 48% less disk).redstart build
reports each inference (⚡ inferred @entity(immutable: true) for …).
Conservative by construction; consistent with the gate-proven hand-annotated
immutability on the ERC-20 fixture. Generated.notes— informational optimisation notes, separate from warnings.
v0.8.0
Division footguns — roadmap §3.4 / §3.5.
Added
- E090 — dividing by a statically-zero value (
/ 0,/ 0.0,
/ BigInt.zero(),/ BigDecimal.zero()) is now a compile error. A divide-by-
zero is a fatal, deterministic sync halt (attempted to divide … by zero). - W030 — assigning a
BigInt / BigIntresult to aBigDecimalfield is
flagged: integer division truncates the fraction first (the canonical Uniswap
"price returns 0" bug). Use.divDecimal(). Integer division into integer
fields is unaffected (no false positives). redstart explaincovers both new codes.
v0.7.0
The store-diff kill-gate is GREEN, and a deploy footgun is gone.
Added
- Store-diff conformance gate proven.
conformance/fixtures/arb-erc20(the
ARB token on Arbitrum One) deployed to a live graph-node alongside the
hand-written reference and produced a byte-identical store — 0 diffs across
10 Account + 13 Transfer entities at block 477,660,492. Indexing fidelity, the
roadmap's #1 risk, is no longer a hypothesis.
Fixed
- ABI normalisation on build. Emitted ABIs now always carry
anonymouson
event entries. graph-node requires it at deploy time (even thoughgraph builddoesn't), so an ABI missing it caused a crypticgraph deployfailure.
Redstart now adds it automatically.