Skip to content

[Backend] Implement Automatic Event Replay on RPC Node Re-synchronization - #768

Open
TochukwuJustice wants to merge 2 commits into
SoroLabs:mainfrom
TochukwuJustice:feature/issue-27-event-replay
Open

[Backend] Implement Automatic Event Replay on RPC Node Re-synchronization#768
TochukwuJustice wants to merge 2 commits into
SoroLabs:mainfrom
TochukwuJustice:feature/issue-27-event-replay

Conversation

@TochukwuJustice

Copy link
Copy Markdown
Contributor

closes #585

Summary of Changes

Added query loading for the atomic last_collected_sequence from the SQLite database using get_latest_sequence() upon uninitialized startups.
Implemented a gap detection check on the latest ledger sequence returned by the RPC provider.
Triggered a catch-up replay loop inside collect_latest_fees() that sequentially fetches and stores fee data for all skipped ledgers in the gap.
Integrated error resilience: if fetching any replayed ledger fails, the catch-up gracefully stops, saving the latest successfully processed block sequence.

#Reason for Changes

Previously, when the RPC provider reconnected after an outage, ledgers produced during the downtime were skipped. By querying the last known ledger from the database and fetching all skipped ledgers sequentially on reconnection, we guarantee complete data collection and prevent gaps in analytics.

…e-synchronization

Queries the database for the last processed ledger sequence when the
in-memory state is uninitialized, detects gaps on reconnection, and
sequentially catch-up replays missed ledgers.
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@TochukwuJustice 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

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.

[Backend] Implement Automatic Event Replay on RPC Node Re-synchronization

1 participant