Skip to content

refactor(filler): read SHIP through @atomichub/antelope-ship-utils - #175

Merged
robrigo merged 1 commit into
mainfrom
feat/antelope-ship-utils-adapter
Aug 18, 2026
Merged

refactor(filler): read SHIP through @atomichub/antelope-ship-utils#175
robrigo merged 1 commit into
mainfrom
feat/antelope-ship-utils-adapter

Conversation

@robrigo

@robrigo robrigo commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Why

The filler carried its own SHIP reader, a copy of the client the AtomicHub fillers run from a shared package, and the two drifted: this side gained ack backpressure and get_blocks_result_v2 handling, the other side gained a heartbeat, reconnect backoff and recovery from empty payloads, and each fix had to be ported by hand. The shared client is now published as @atomichub/antelope-ship-utils (repository atomicassets/antelope-ship-utils) with both fix sets, and the filler adopts it through the receiver: StateReceiver implements the package's consumer interface, the prefetch-versus-confirmation guard runs before the connection is built, and the package's events feed winston. The in-tree reader, its deserializer worker and the direct ws and node-worker-threads-pool dependencies go; the handler files keep their block-shape types through a re-export.

Runtime changes an operator sees are listed under ## [2.2.0] ### Upgrading in CHANGELOG.md: heartbeat and idle timeout active, reconnect backoff 5 s to 60 s, empty-payload escalation, and a prepare-path failure now exits the process instead of pausing until the stall watchdog fires.

Validation

pnpm run check-types and pnpm run lint green; the handler files are untouched, which is the proof that the type re-export keeps their surface. pnpm test: 349 passing and 37 pending on this branch against 341 passing and 37 pending on main (measured in a scratch worktree of main); the delta is ten new adapter tests minus two relocated deadlock-guard tests, none weakened. The integration suite needs Postgres and was not run locally; CI runs it. pnpm knip carries the pre-existing red baseline (two re-exported types now count as unused exports). This change goes out as 2.2.0-rc1 first and soaks on the testnet fillers before a stable tag, per RELEASING.md.

@robrigo
robrigo force-pushed the feat/antelope-ship-utils-adapter branch from 0e23bb9 to c87921b Compare August 17, 2026 23:42
@robrigo
robrigo requested a lite review from Copilot August 17, 2026 23:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the filler’s SHIP integration by removing the in-repo State History websocket reader and adopting the shared @atomichub/antelope-ship-utils client, aligning behavior with the upstream fillers (heartbeat, reconnect backoff, empty-payload recovery) while keeping the existing handler-facing block/trace/delta type surface via re-exports.

Changes:

  • Replace the in-tree SHIP reader with @atomichub/antelope-ship-utils and adapt StateReceiver to the package’s consumer interface.
  • Remove the deserializer worker and the legacy SHIP reader implementation (and corresponding direct dependencies).
  • Update queue reporting, tests, and changelog/docs to reflect the new connection behavior and upgrade notes.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/workers/deserializer.ts Deletes the dedicated deserialization worker now handled by the shared package.
src/types/ship.ts Re-exports SHIP block-shape types from the shared package while preserving wider generics used by handlers.
src/filler/receiver.ts Adapts StateReceiver to IShipConsumer, wires package events to winston, moves deadlock guard pre-connection, and delegates connection lifecycle to the package.
src/filler/receiver.test.ts Updates unit tests to call consume() directly and removes legacy startProcessing ack-guard tests that no longer match the new integration point.
src/filler/receiver-adapter.test.ts Adds focused tests validating the consumer/connection handover, guard behavior, event forwarding, and stop behavior.
src/filler/filler.ts Updates queue state logging to use the new connection queue size accessor.
src/connections/ship.ts Removes the legacy in-tree SHIP websocket reader implementation.
src/connections/manager.ts Replaces createShipBlockReader with createShipConnection constructing the package connection.
src/bin/ship.ts Removes the legacy standalone SHIP test/debug entrypoint.
pnpm-workspace.yaml Excludes the new first-party package from minimum-release-age gating.
pnpm-lock.yaml Locks @atomichub/antelope-ship-utils@1.0.0 and its transitive dependencies.
package.json Adds @atomichub/antelope-ship-utils and drops direct ws / node-worker-threads-pool deps.
knip.json Removes workers from knip entrypoints (worker file deleted).
CHANGELOG.md Documents operational changes and upgrade guidance for 2.2.0.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/connections/manager.ts Outdated
Comment thread src/filler/receiver.ts Outdated
Comment thread src/filler/receiver-adapter.test.ts Outdated
@robrigo
robrigo force-pushed the feat/antelope-ship-utils-adapter branch from c87921b to c85d788 Compare August 17, 2026 23:59
The filler carried its own SHIP reader, a copy of the client that the
AtomicHub fillers run from a shared package, and the two drifted: this side
gained ack backpressure and get_blocks_result_v2 handling, the other side
gained a heartbeat, reconnect backoff and recovery from empty payloads, and
each fix had to be ported by hand. The shared client is now published as
@atomichub/antelope-ship-utils with both fix sets, and the filler adopts it
through the receiver: StateReceiver implements the package's consumer
interface, the prefetch-versus-confirmation guard runs before the connection
is built, and the package's events feed winston. The in-tree reader, its
deserializer worker and the direct ws and worker-pool dependencies go; the
handler files keep their block-shape types through a re-export. Runtime
changes an operator sees are listed under Upgrading in the changelog.
@robrigo
robrigo force-pushed the feat/antelope-ship-utils-adapter branch from c85d788 to c764cc2 Compare August 18, 2026 00:02
@robrigo
robrigo marked this pull request as ready for review August 18, 2026 00:02
@robrigo
robrigo merged commit aa0a285 into main Aug 18, 2026
2 checks passed
@robrigo robrigo mentioned this pull request Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants