Contract Event Replay Index
Background
If the off-chain indexer misses events (downtime, reorg), it needs a way to re-fetch historical events without re-scanning the entire chain.
Goal
Maintain an on-chain event log ring buffer (DataKey::EventLog(index)) storing the last 1000 event summaries in Temporary storage.
Acceptance Criteria
- Every state-change event writes a summary entry to the ring buffer.
get_event_log(from_index, limit) read function returns paginated results.
- Ring buffer wraps around after 1000 entries.
- Buffer entries use
Temporary storage to keep rent costs low.
Key Files
contracts/src/events.rs, contracts/src/lib.rs
Contract Event Replay Index
Background
If the off-chain indexer misses events (downtime, reorg), it needs a way to re-fetch historical events without re-scanning the entire chain.
Goal
Maintain an on-chain event log ring buffer (
DataKey::EventLog(index)) storing the last 1000 event summaries inTemporarystorage.Acceptance Criteria
get_event_log(from_index, limit)read function returns paginated results.Temporarystorage to keep rent costs low.Key Files
contracts/src/events.rs,contracts/src/lib.rs