@subsquid/pipes v1.0.0-alpha.17
Pre-release
Pre-release
·
29 commits
to main
since this release
Fork recovery correctness in the portal client and the Postgres target
Three independent defects could each leave a chain fork half-applied: rows restored to the wrong value, finalized writes rolled back with nothing to bring them home, and — under genesis-only finality — an undo log that was never written at all. If you run the Postgres target against a forky chain, this is the release to move to.
Fork handling
- Rollback restores the value a row actually had. The undo log stored after-images, so restoring a row whose pre-fork value came from a finalized block recovered the value that overwrote it rather than the original. Replay now takes the earliest before-image above the ancestor, and drops rows that never existed there.
- Finalized blocks no longer ride along in an unfinalized batch. Coalescing the finalized bulk with the first hot block tagged finalized writes above the finalized head, so a fork to that head rolled them back with no re-fetch.
- A finalized head of block 0 now reads as finality, not as its absence. Under genesis-only finality every hot block was filed as finalized: the per-block separation the Postgres target relies on stopped happening, the undo log was never written, and the cursor sweep pruned the rows a deep fork needs to find its ancestor.
Portal client
- Empty batches are no longer emitted at the head.
- Request counters are attributed per response rather than per batch. A response split across blocks was billed once per block, and a response carrying no blocks dropped its counters and retry attempts entirely.
- Spans can no longer end twice, or be left open by a throwing transformer.
Monitoring
- RPC latency gauges no longer freeze after a stream restart. The watcher subscribed once and its stop was a one-way latch, so past the first restart the gauges held their last value while indexing carried on — a flat line that reads as a steady delay rather than an outage. It now also recovers from socket errors and from silence, backs off exponentially, caps retained heads, and contains a throwing message handler instead of letting it take the process down.
API
- Targets can request per-block delivery through
read(). Off by default: targets that carry the block number on the rows themselves (ClickHouse) keep one batch per response.
Full Changelog: pipes-v1.0.0-alpha.16...pipes-v1.0.0-alpha.17