Skip to content

feat(backend): add dryRun mode to admin indexer replay/reset endpoints - #1316

Open
Seunfunmi-319509 wants to merge 2 commits into
LabsCrypt:mainfrom
Seunfunmi-319509:feat/admin-indexer-dry-run
Open

feat(backend): add dryRun mode to admin indexer replay/reset endpoints#1316
Seunfunmi-319509 wants to merge 2 commits into
LabsCrypt:mainfrom
Seunfunmi-319509:feat/admin-indexer-dry-run

Conversation

@Seunfunmi-319509

Copy link
Copy Markdown

PR Summary

Added a dry-run mode for admin indexer replay and reset operations to allow operators to review the projected scope before executing changes.

What was done

  • Added dryRun=true support to the indexer replay/reset endpoints.
  • Added preview information including the affected event count and ledger range.
  • Ensured dry-run requests do not execute replay/reset operations or mutate state.
  • Preserved the existing execution flow when dry-run is not enabled.
  • Added test coverage for preview responses and state immutability.

Acceptance Criteria

  • dryRun=true returns the projected replay scope.
  • Dry-run requests do not mutate state.
  • Existing execution behavior remains unchanged without dry-run mode.
  • Tests cover the dry-run behavior.

The implementation is ready for review.

closes #1238

Seunfunmi-319509 and others added 2 commits August 29, 2026 23:14
Operators executing POST /v1/admin/indexer/replay or /reset currently
get no preview of the scope before the mutation fires. A single misfired
call can trigger wide, hard-to-undo state changes (non-idempotent
withdrawnAmount increments, cursor resets across the full event range).

Add ?dryRun=true query parameter support to both endpoints:

- replay preview returns event count, ledger range, and current cursor
  so operators can sanity-check the projected scope before committing
- reset preview returns the current cursor and target ledger for
  verification

Neither endpoint mutates state when dryRun=true; both return 200 with
a structured preview object.

Closes LabsCrypt#1238

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Audit] No confirmation before an in-flight indexer replay/reset is triggered by an admin

1 participant