Skip to content

[Bug]: block timestamp cache not invalidated on reorg rewind #66

Description

@flwrenn

What happened?

The block-number-keyed timestamp cache is never invalidated when the cursor rewinds. After a reorg, re-scanned blocks reuse pre-reorg timestamps from the cache, so re-indexed ops can carry stale timestamps.

Area

Backend

Expected behavior

A rewind evicts cached timestamps for the rewound block range — or the cache is keyed by block hash so reorged blocks miss naturally.

Steps to reproduce

Requires a reorg inside the rewind window, so hard to trigger on demand. Verifiable by inspection: indexer/internal/indexer/indexer.go (~888-894) — the cache has no eviction on the rewind path.

Additional context

Found during code review. Only timestamps are affected; op data itself is re-fetched. Severity: low.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendGo indexerbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions