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

Fix force range for reorg checks #126

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

iuwqyir
Copy link
Collaborator

@iuwqyir iuwqyir commented Dec 11, 2024

TL;DR

Added block range validation and optimized block header queries to prevent unnecessary reorg checks.

What changed?

  • Added validation to skip reorg checks when the most recent and last checked block numbers are equal
  • Modified the LookbackBlockHeaders query to include a lower bound on block numbers, creating a specific range for querying
  • Enhanced logging to better indicate when reorg checks are skipped

How to test?

  1. Run the system with chain monitoring enabled
  2. Verify logs show skipped reorg checks when blocks are equal
  3. Confirm block header queries return results only within the specified range
  4. Validate that reorg detection still functions correctly for actual reorgs

Why make this change?

The previous implementation would perform unnecessary reorg checks when block numbers were identical and could potentially query more blocks than needed. These changes improve efficiency by avoiding redundant operations and limiting the query scope to only relevant block ranges.

Copy link
Collaborator Author

iuwqyir commented Dec 11, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@iuwqyir iuwqyir changed the title fix reorg handler force from block optimize reorg checks and block header queries Dec 11, 2024
@iuwqyir iuwqyir changed the title optimize reorg checks and block header queries Fix force range for reorg checks Dec 11, 2024
@iuwqyir iuwqyir requested a review from AmineAfia December 11, 2024 12:10
@iuwqyir iuwqyir marked this pull request as ready for review December 11, 2024 12:10
@iuwqyir iuwqyir merged commit 996d70b into main Dec 12, 2024
5 checks passed
@iuwqyir iuwqyir deleted the 12-11-fix_reorg_handler_force_from_block branch December 12, 2024 13:21
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