Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: refactor chain reorgs handling #72

Merged
merged 8 commits into from
Jun 21, 2024
Merged

Conversation

PJColombo
Copy link
Member

This PR updates the indexer's reorg handling logic.

Previously, the indexer subscribed to the beacon node’s SSE stream to listen for chain_reorg events. The issue with this approach was the delay in event notification, causing the indexer to call the Blobscan API’s reorg handling endpoint after the reorg had already occurred.

The indexer now detects reorgs by comparing the parent root of the head block with the root of the last indexed block. If there is a mismatch, it indicates a reorg, and the indexer handles it immediately.

@PJColombo PJColombo force-pushed the refactor/reorgs-handling branch from 58a052c to 4144f4b Compare June 10, 2024 14:48
@PJColombo PJColombo force-pushed the refactor/reorgs-handling branch 3 times, most recently from 4c0762e to 9040406 Compare June 19, 2024 12:19
@PJColombo PJColombo force-pushed the refactor/reorgs-handling branch from 9040406 to 36577be Compare June 21, 2024 14:17
@PJColombo PJColombo merged commit 2646828 into master Jun 21, 2024
1 check passed
@PJColombo PJColombo deleted the refactor/reorgs-handling branch June 21, 2024 14:22
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.

2 participants