Repository navigation
fix: persist reorg-safe cursor in Stellar metrics indexer - #253
Bethelamos wants to merge 2 commits into
Conversation
|
@Bethelamos Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
truthixify
left a comment
There was a problem hiding this comment.
Blocking: the new cursor store and dedupe helpers are never imported or called by the metrics indexer runtime. Only runtime.js, its tests, and the README change, so the production polling path still does not load, commit, rewind, or deduplicate with this state. Wire the store into the actual getEvents loop and test a restart/reorg through that integration.
|
@truthixify — this PR is ready for another review. I addressed the review feedback (pushed a9c1c4f). |
truthixify
left a comment
There was a problem hiding this comment.
Current head still does not wire cursor persistence into the production indexer: index.js continues to import only createPoller, deriveHealthState, and summarizeError, so createIndexerRuntime is never called by the real getEvents loop. The submitted integration tests call an undefined createMetricsRuntime symbol, and npm test fails 5 of 41 tests; this update also renames rpcHost to rpchost, breaking the health contract, and changes out.startsWith(...) to an undefined startsWith(...). Please integrate the cursor store through index.js, preserve existing health behavior, and make the full metrics-indexer suite pass.
Overview
This PR makes the Stellar metrics indexer persist a reorg-safe cursor across restarts. The indexer previously always called
fetchContractEventswith the default cursor, and the README listed cursor persistence as unfinished. This change persists the last confirmed cursor, deduplicates replayed events, defines reorg rewind behavior, and adds restart, duplicate, and cursor-corruption tests.Related Issue
Changes
🔁 Cursor Persistence & Reorg Safety
[MODIFY]
stellar/scripts/metrics-indexer/runtime.jsfetchContractEventsresumes instead of starting from the default cursor.[MODIFY]
stellar/scripts/metrics-indexer/runtime.test.js[MODIFY]
stellar/scripts/metrics-indexer/README.mdVerification Results
runtime.jsruntime.test.jsCloses #235