Repository navigation
fix(hyperliquid-fills-ingest): raise data-service socket timeout to 600s - #600
Open
SQD-Trevor-Agent wants to merge 1 commit into
Open
SQD-Trevor-Agent wants to merge 1 commit into
SQD-Trevor-Agent wants to merge 1 commit into
Conversation
Large, bursty fills chunks (hundreds of MB, thousands of events per block) cannot be downloaded and streamed within the default 120s socket timeout, so the ingest HTTP service drops the connection every cycle and the writer never advances. Match hyperliquid-replica-cmds-ingest, which already overrides this to 600s.
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.
Problem
The
hl-node-fillshistorical-data archive stalled: its ingest cursor froze at block1183474774(data timestamp2026-10-14 11:59:59 UTC) and lag grew unbounded, firingArchiveIngestLagging(30% behind 24h baseline).The
ingest-hl-node-fillspod runs thishyperliquid-fills-ingestservice as a sidecar onlocalhost:3000; thedata-sqd-archivewriter streams blocks from it. From ~13:11 UTC the writer logged, exactly every ~125s:and the ingest sidecar logged, at the matching cadence:
Root cause
Hyperliquid fills volume surged during hour 12. The upstream S3 chunk
node_fills_by_block/hourly/20261014/12.lz4is 89 MB compressed / 439 MB decompressed — ~3× the preceding chunks (11.lz4= 33 MB / 155 MB) — with blocks containing up to ~3,800 events (1.6 MB JSON lines). The data is not corrupt and not gapped: both chunks are valid, contiguous JSON (verified11.lz4ends at1183474774,12.lz4starts at1183474775, no gaps/dupes).Ingest.runService()setsapp.setSocketTimeout(this.getSocketTimeout()), which becomes the Node HTTP server's inactivity timeout.HyperliquidIngestinherits the base default of 120_000 ms.HyperliquidArchive.readRawChunkreads the whole object andlz4.decodes it before streaming, so an oversized chunk produces a long quiet period (measured S3 GET alone ≈ 24 s) plus writer backpressure while 439 MB is streamed. That exceeds 120 s, so the server force-closes the socket every cycle; the writer never receives a complete chunk and the cursor never advances. The failure period of exactly ~125 s (= 120 s timeout + 5 s writer retry pause) pins this to the socket timeout.The sibling service
hyperliquid-replica-cmds-ingestalready overridesgetSocketTimeout()to600_000for the same reason;hyperliquid-fills-ingest— which handles the largest, burstiest chunks — was left on the 120 s default. This PR applies the same override.Fix
Override
getSocketTimeout()inHyperliquidIngestto600_000, matchinghyperliquid-replica-cmds-ingest.Verification
s3://hl-mainnet-node-data/node_fills_by_block/hourly/20261014/:12.lz4decompresses to 439 MB (vs 155 MB for11.lz4), contiguous and valid — confirming a volume surge, not corruption.HyperliquidIngest.getSocketTimeout()returns120000; post-fix returns600000(> the base default).rush build --to @subsquid/hyperliquid-fills-ingestpasses (compiles clean).Falsification
If, after deploy, the writer still stalls on this chunk with
connection closed before message completedat a new fixed period, the bottleneck is not the 120 s timeout (e.g. the writer or R2 upload is slower than 600 s for a single chunk), and the durable fix is to stream-decode chunks inHyperliquidArchive.readRawChunk(avoid buffering the whole file) and/or have the writer commit smaller sub-ranges — noted as a follow-up.