Join our community: https://t.me/+DOylgFv1jyJlNzM0
Description
backend/src/services/eventIndexer.ts has a quarantine system for malformed or unparseable events. Events that fail parsing are moved to a quarantine table. However, there is no admin endpoint or CLI tool to reprocess quarantined events after the parsing bug is fixed.
This means if a contract upgrade changes the event schema and the parser is later updated to handle the new format, all events quarantined during the gap period remain permanently stuck in quarantine. The database will be missing data for that period.
Expected Behavior
Add an admin endpoint or background job that:
- Lists quarantined events (with filter by contract address, event type, date range)
- Allows replaying quarantined events through the current parser
- On success, moves the event from quarantine to the normal event table
- On failure, keeps it in quarantine with an updated
retry_count
Suggested Fix
// POST /admin/indexer/reprocess-quarantine
const quarantined = await query('SELECT * FROM quarantine_events WHERE event_type = $1', [eventType]);
for (const event of quarantined.rows) {
try {
await processEvent(parseRawEvent(event));
await query('DELETE FROM quarantine_events WHERE id = $1', [event.id]);
} catch (err) {
await query('UPDATE quarantine_events SET retry_count = retry_count + 1 WHERE id = $1', [event.id]);
}
}
Impact
Medium. Any parser bug that causes event quarantine creates a permanent data gap. Without replay capability, the only fix is a full re-index from genesis, which is expensive.
Description
backend/src/services/eventIndexer.tshas a quarantine system for malformed or unparseable events. Events that fail parsing are moved to a quarantine table. However, there is no admin endpoint or CLI tool to reprocess quarantined events after the parsing bug is fixed.This means if a contract upgrade changes the event schema and the parser is later updated to handle the new format, all events quarantined during the gap period remain permanently stuck in quarantine. The database will be missing data for that period.
Expected Behavior
Add an admin endpoint or background job that:
retry_countSuggested Fix
Impact
Medium. Any parser bug that causes event quarantine creates a permanent data gap. Without replay capability, the only fix is a full re-index from genesis, which is expensive.