Skip to content

Add replay idempotency tests for duplicate and out-of-order contract events #1257

Description

@Jagadeeshftw

Area: Indexer correctness · Estimated effort: 8–12 h

Problem

The backend has replay integrity, event-id, ingested-at, and stale-cursor tests, but one cross-path invariant is needed for duplicate/out-of-order delivery.

Design decision required

Define the event identity key and whether a corrected event supersedes or rejects an earlier record.

Requirements

  • Deliver duplicates, reordered batches, gaps, and retries
  • assert database state, metrics, and cursor advancement.

Acceptance criteria

  • Replaying the same event is a no-op, out-of-order events follow the documented policy, and no duplicate business event is emitted.

Out of scope

  • Unrelated refactors, dependency upgrades, or behavior changes outside the stated scope.
  • Closing, deleting, or weakening existing tests to make the change pass.

Verification

pnpm vitest run tests/indexer-store.ingested-at.test.ts tests/indexer-store.ledger-hash.test.ts tests/streamEventService.eventId.test.ts

PR requirements

  • Explain the before/after behavior and include the evidence requested above.
  • Add regression tests for the changed behavior and report relevant build, test, lint, and artifact results.
  • Keep the PR focused and reference this issue.
  • Please open the PR within 48 hours of assignment so the work remains active; ask a question in the issue if the scope needs clarification.

Good luck, and please join the contributor Telegram group if you want to discuss the work: https://t.me/+u5qmu35nZ7I0OTU1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions