refactor(filler): read SHIP through @atomichub/antelope-ship-utils - #175
Merged
Conversation
robrigo
force-pushed
the
feat/antelope-ship-utils-adapter
branch
from
August 17, 2026 23:42
0e23bb9 to
c87921b
Compare
There was a problem hiding this comment.
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-utilsand adaptStateReceiverto 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.
robrigo
force-pushed
the
feat/antelope-ship-utils-adapter
branch
from
August 17, 2026 23:59
c87921b to
c85d788
Compare
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
force-pushed
the
feat/antelope-ship-utils-adapter
branch
from
August 18, 2026 00:02
c85d788 to
c764cc2
Compare
robrigo
marked this pull request as ready for review
August 18, 2026 00:02
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_v2handling, 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(repositoryatomicassets/antelope-ship-utils) with both fix sets, and the filler adopts it through the receiver:StateReceiverimplements 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 directwsandnode-worker-threads-pooldependencies go; the handler files keep their block-shape types through a re-export.Runtime changes an operator sees are listed under
## [2.2.0]### UpgradinginCHANGELOG.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-typesandpnpm run lintgreen; 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 onmain(measured in a scratch worktree ofmain); 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 knipcarries the pre-existing red baseline (two re-exported types now count as unused exports). This change goes out as2.2.0-rc1first and soaks on the testnet fillers before a stable tag, perRELEASING.md.