[FinChippay/Finchippay-Solution] Issue #64 — Event Ingestion Idempotency & Replayable Cursor (Issue #633) - #661
Open
Jaamaldeen wants to merge 1 commit into
Open
Conversation
- Add ingestion_batches table for cursor persistence - Add txn_hash and op_index columns for deduplication - Update eventIndexer.js with atomic batch transactions - Add replayFrom() function for admin replay - Create admin replay endpoint - Update eventParser.js to extract transaction data - Add comprehensive tests for idempotency and replay - All 13 tests passing
🤖 Greptile AI Code ReviewGreptile will automatically review this PR (11 file(s) changed). Review gates:
|
Author
|
@Topmatrixmor2014 please check it out |
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.
Summary
Makes Horizon/contract event ingestion fully idempotent and replayable by adding atomic cursor persistence with
ingestion_batchestable, unique deduplication constraints on(ledger_sequence, txn_hash, op_index, event_type), and a new admin replay endpoint. A crash or reorg will no longer double-count or drop payment events.Closes #633
Type of change
Related issue
Issue #64 — Event Ingestion Idempotency & Replayable Cursor
Re: [FinChippay/Finchippay-Solution] #633
Changes
ingestion_batchestable for atomic cursor persistencetxn_hashandop_indexcolumns tocontract_eventsfor deduplication(ledger_sequence, txn_hash, op_index, event_type)eventIndexer.jsto write cursor + events atomically in a single transactionreplayFrom(from_ledger)function to reprocess history without duplicationPOST /api/admin/replayGET /api/admin/replay/statusto check indexer statuseventParser.jsto extracttxn_hashandop_indexfrom raw eventsTesting
Checklist
maincloses Issue #64 — Event Ingestion Idempotency & Replayable Cursor #633