Description
EventIngestionService.ingestEvents() and ingestSingleLedger() (src/event-ingestion/event-ingestion.service.ts) both loop over fetched events with for (const event of events) { const result = await this.eventProcessorService.processEvent(event); ... }, processing them one at a time even though EventProcessorService.processEvent() (src/event-ingestion/event-processor.service.ts) operations on different escrow IDs are largely independent. A ledger range with many events (up to the MAX_LEDGER_RANGE = 100-ledger window, each potentially containing multiple events) processes fully serially every 5-second poll tick (POLL_INTERVAL_MS), which could cause ingestion to fall behind the chain during bursts of on-chain activity.
Component
Backend
Difficulty
🔴 Hard
Tasks
Acceptance Criteria
Estimated Time
1-2 days
Description
EventIngestionService.ingestEvents()andingestSingleLedger()(src/event-ingestion/event-ingestion.service.ts) both loop over fetched events withfor (const event of events) { const result = await this.eventProcessorService.processEvent(event); ... }, processing them one at a time even thoughEventProcessorService.processEvent()(src/event-ingestion/event-processor.service.ts) operations on different escrow IDs are largely independent. A ledger range with many events (up to theMAX_LEDGER_RANGE = 100-ledger window, each potentially containing multiple events) processes fully serially every 5-second poll tick (POLL_INTERVAL_MS), which could cause ingestion to fall behind the chain during bursts of on-chain activity.Component
Backend
Difficulty
🔴 Hard
Tasks
escrowId/topic to preserve required per-escrow ordering, but process independent escrows in parallel)escrow_createdbeforeescrow_fundedfor the same escrow) — document the concurrency-safety analysis in the PRAcceptance Criteria
Estimated Time
1-2 days