Treat LONG_TERM_STORAGE_SLOT_SKIPPED as a skipped slot by default#32
Conversation
Some RPC providers report a skipped slot as SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED (-32009) instead of SLOT_SKIPPED (-32007) once it falls outside their local blockstore retention window, which was still crashing the node. Add a treatLongTermStorageSkipAsSkipped endpoint config option (default true) so this is treated the same as a confirmed skip, while allowing it to be disabled if a genuine archival data gap needs to surface as an error.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds a configurable ChangesConfigurable Long-Term Storage Skip Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Comment |
Coverage reportCaution Test run failed
Test suite run failedFailed tests: 4/60. Failed suites: 1/9.Report generated by 🧪jest coverage report action from 32c7c45 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a85425ace
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * crash the node so a genuine gap in archival data isn't silently skipped. | ||
| * @default true | ||
| */ | ||
| treatLongTermStorageSkipAsSkipped?: boolean; |
There was a problem hiding this comment.
Add the endpoint validator for the opt-out flag
When users set network.endpoint: { <url>: { treatLongTermStorageSkipAsSkipped: false } } in a project manifest, endpoint objects are validated through SolanaEndpointConfig in packages/common-solana/src/project/versioned/v1_0_0/model.ts, which currently only decorates batchSize plus inherited common fields. Adding this property only to the interface means the manifest validator will not accept/preserve the new key, so the advertised opt-out cannot be used from normal endpoint config and SolanaApi.create will keep defaulting to true.
Useful? React with 👍 / 👎.
This is about how an RPC response is interpreted, not something tied to a specific endpoint, so it doesn't belong in the per-endpoint manifest config (where it would also raise the question of mixing enabled/disabled per endpoint in the same pool). Expose it instead as a --treat-long-term-storage-skip-as-skip startup flag (default true), read via a SolanaNodeConfig wrapper following the same pattern used for custom node options in other @subql node packages, and apply it uniformly across every endpoint connection.
Summary
On devnet, blocks that are genuinely skipped can surface as
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED(-32009, "Slot X was skipped, or missing in long-term storage") instead of the expectedSLOT_SKIPPED(-32007), once the slot falls outside the RPC node's local blockstore retention window and its archival/bigtable lookup returns not-found. This code was previously left unconverted (intentionally, since it's ambiguous on mainnet — it can also mean a genuine archival gap), which still crashed the node viaexitWithErrorwhenever it occurred.api.solana.ts'sisSkippedSlotErrornow also matches-32009and converts it toBlockUnavailableError(same handling as a confirmed skip).--treatLongTermStorageSkipAsSkippedstartup flag (defaulttrue, seeyargs.ts), read through a newSolanaNodeConfigwrapper (configure/NodeConfig.ts) following the same pattern used for custom node options in sibling@subqlnode packages. It's a startup-level setting rather than per-endpoint manifest config, since it's about how an RPC response is interpreted (not specific to any one endpoint), and applies uniformly across every endpoint in the connection pool.api.solana.skip-slot.spec.tscovering both error codes and the opt-out flag.Test plan
api.solana.skip-slot.spec.tspassyarn workspace @subql/node-solana buildsucceedsyarn workspace @subql/types-solana buildsucceedsSummary by CodeRabbit
New Features
treatLongTermStorageSkipAsSkippedto control how Solana long-term storage "slot skipped" errors (RPC -32009) are handled.Tests