Skip to content

Backend: webhook replay, indexer backfill, reconciliation, and Soroban RPC failover - #1001

Merged
levoski1 merged 4 commits into
WHEELBACK:mainfrom
cephascenturion:drips/967-968-969-970
Oct 21, 2026
Merged

levoski1 merged 4 commits into
WHEELBACK:mainfrom
cephascenturion:drips/967-968-969-970

Conversation

@cephascenturion

Copy link
Copy Markdown
Contributor

Summary

Backend: webhook replay, indexer backfill, reconciliation, and Soroban RPC failover

What was solved

#967 — Add merchant webhook delivery history

Add a merchant-facing webhook delivery history view that lists recent delivery attempts with response status and replay state, and lets authorized users replay eligible failed deliveries. This requires a frontend UI plus supporting API/data wiring for delivery history and replay actions.

Addressed:

  • Changed: backend/src/handlers.rs
  • Display recent webhook delivery attempts for merchants, including response status codes and replay state
  • Allow authorized users to replay eligible failed deliveries
  • Keep changes scoped to merchant webhook delivery history and replay; do not alter unrelated backend routes or contracts

#968 — Backfill indexer events after retention gaps

Add a documented backfill path for the backend indexer so missed Soroban contract events can be recovered when the indexer falls behind the RPC retention window. The change should detect gaps (e.g., ledger cursor vs. current RPC ledger / retention boundary), expose a backfill routine that re-fetches events over the missing ledger range, and verify recovered events (dedupe/idempotent persistence plus a verification step).

Addressed:

  • Changed: backend/src/lib.rs, backend/src/main.rs, backend/src/handlers.rs, backend/.env.example
  • Detect gaps between the indexer's last processed ledger and the Soroban RPC retention window boundary
  • Provide a documented backfill path (code + docs) to re-fetch missed contract events over the gap range
  • Verify recovered events after backfill (idempotent/deduped persistence and a verification check)

#969 — Reconcile indexed state against ledger checkpoints

Add a reconciliation capability to the backend that compares indexed records (e.g., invoices) against on-chain ledger checkpoints, reports discrepancies, and safely updates or flags affected records. The work centers on a new reconciliation module plus wiring into existing backend routes/handlers, following the existing Rust module patterns in backend/src.

Addressed:

  • Changed: backend/src/lib.rs, backend/src/handlers.rs, backend/src/routes/invoices.rs, backend/src/main.rs
  • Implement a reconciliation job/module that compares backend indexed records against on-chain ledger checkpoint state
  • Report discrepancies found during reconciliation (structured output/logging)
  • Safely update or flag affected records based on reconciliation results, without destructive data loss

#970 — Add Soroban RPC failover

Add Soroban RPC failover support in the backend: allow configuring multiple RPC endpoints, perform health checks, and fail over requests only under documented conditions while preserving transaction/network correctness.

Addressed:

  • Changed: backend/src/lib.rs, backend/src/main.rs, backend/src/routes/health.rs, backend/.env.example
  • Support multiple Soroban RPC endpoints via configuration (primary plus fallbacks).
  • Implement health checks for RPC endpoints to determine availability.
  • Fail over to a fallback endpoint only under documented conditions (e.g., primary unhealthy/unreachable), not on arbitrary errors.

Changes

  • backend/src/handlers.rs (modify)
  • backend/src/lib.rs (modify)
  • backend/src/main.rs (modify)
  • backend/.env.example (modify)
  • backend/src/routes/invoices.rs (modify)
  • backend/src/routes/health.rs (modify)

Approach

  1. Add merchant webhook delivery history #967 — Add merchant webhook delivery history (Changed: backend/src/handlers.rs)
  2. Backfill indexer events after retention gaps #968 — Backfill indexer events after retention gaps (Changed: backend/src/lib.rs, backend/src/main.rs, backend/src/handlers.rs, backend/.env.example)
  3. Reconcile indexed state against ledger checkpoints #969 — Reconcile indexed state against ledger checkpoints (Changed: backend/src/lib.rs, backend/src/handlers.rs, backend/src/routes/invoices.rs, backend/src/main.rs)
  4. Add Soroban RPC failover #970 — Add Soroban RPC failover (Changed: backend/src/lib.rs, backend/src/main.rs, backend/src/routes/health.rs, backend/.env.example)

Issues

Closes #967
Closes #968
Closes #969
Closes #970

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@cephascenturion Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@levoski1
levoski1 merged commit 0505347 into WHEELBACK:main Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants