Fix/indexer parser hardening - #1075
Merged
Mimah97 merged 4 commits intoAug 31, 2026
Merged
Conversation
resolutionParser silently accepted legacy ScvVec/ScvMap dev-stub shapes (with a blank oracleAddress) in every environment, including production. Gate those shapes behind NODE_ENV, fail fast with ResolutionParseError and an indexer.parser.legacy_shape_rejected metric when they surface in production, and keep accepting them for local/dev fixtures. Claude-Session: https://claude.ai/code/session_01WR71DfNQdvTTWtuVDGBzD6
tradeParser cast buy_order_id/sell_order_id straight to String with no validation, so a fill that could never join to a real Order row (empty, or not UUID-shaped like Order.id) was persisted as if it were joined. Reject empty order ids in every environment and non-UUID order ids in production, with an indexer.parser.unjoinable_order_id metric. Claude-Session: https://claude.ai/code/session_01WR71DfNQdvTTWtuVDGBzD6
collateralDepositedParser accepted any i128 bigint as amountRaw with no bounds check, so a wrongly-scaled or out-of-range amount passed through silently and only surfaced later (e.g. as a DB error far from the event that caused it). Validate amountRaw against the same 7-decimal / Decimal(20,8) bounds decimalUtils.amountRawToDecimal enforces elsewhere, reject zero/negative amounts, and in production reject amounts that decode as a plain number instead of the expected i128 bigint. Claude-Session: https://claude.ai/code/session_01WR71DfNQdvTTWtuVDGBzD6
isTransientError() only recognized a fixed set of network error codes/ messages, so a 429 or 5xx from the Stellar RPC (which surfaces as an HTTP-status-bearing error, not a NodeJS.ErrnoException) had no correct retry path, and nothing stopped a re-thrown parse error from being retried indefinitely if its message ever collided with a transient string. Add classifyError() (fatal/rate_limited/transient), route withRetry through it, back off harder (and honor Retry-After) on 429, and never retry ResolutionParseError/TradeParseError/ CollateralDepositedParseError/MarketCreatedParseError/RetryValidationError. Claude-Session: https://claude.ai/code/session_01WR71DfNQdvTTWtuVDGBzD6
5 tasks
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.
Closes #1022
Closes #1023
Closes #1024
Closes #1025