Skip to content

[Bug]: WebSocket re-broadcasts ops in the reorg confirmation window on every poll #65

Description

@flwrenn

What happened?

Ops inside the confirmation-lag / cursor-rewind window are re-scanned on each poll cycle and re-broadcast to WebSocket subscribers each time. Database writes are idempotent and the bundled frontend dedupes by hash, so first-party behavior is correct — but third-party WS consumers without their own dedup will double-count ops until the block leaves the rewind window.

Area

Backend

Expected behavior

Each op is broadcast at most once per connection — e.g. track a separate last-broadcast cursor distinct from the scan cursor, or dedupe by op hash in the hub before broadcasting.

Steps to reproduce

  1. Connect a raw WS client to the live feed
  2. Submit a UserOp and wait for it to be indexed
  3. Observe the same op hash delivered again on subsequent poll cycles until the block leaves the rewind window

Additional context

Found during code review. Relevant code: rescan/broadcast path in indexer/internal/indexer/indexer.go (~486-501 and ~764). 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