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

Add reorg handler functionality and configuration options #91

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

iuwqyir
Copy link
Collaborator

@iuwqyir iuwqyir commented Oct 4, 2024

TL;DR

Added a new reorg handler to detect and handle blockchain reorganizations.

What changed?

  • Introduced a new ReorgHandler component with configuration options
  • Added reorg detection logic to scan for inconsistencies in block headers
  • Implemented a fork point detection mechanism
  • Created a process to handle reorgs by re-fetching and updating affected blocks
  • Added new metrics for tracking reorg handler performance
  • Updated the orchestrator to include the reorg handler in its workflow

How to test?

  1. Enable the reorg handler using the --reorgHandler-enabled flag or REORGHANDLER_ENABLED environment variable
  2. Configure the reorg handler settings:
    • Interval: --reorgHandler-interval or REORGHANDLER_INTERVAL
    • Blocks per scan: --reorgHandler-blocks-per-scan or REORGHANDLER_BLOCKSPERSCAN
    • Starting block: --reorgHandler-from-block or REORGHANDLER_FROMBLOCK
    • Force starting block: --reorgHandler-force-from-block or REORGHANDLER_FORCEFROMBLOCK
  3. Run the indexer and monitor the logs for reorg detection messages
  4. Check the new metrics reorg_handler_last_checked_block and reorg_handler_reorg_counter for reorg handler activity

Why make this change?

Blockchain reorganizations can lead to inconsistencies in indexed data. The reorg handler ensures data integrity by detecting reorgs and updating the affected blocks, maintaining the accuracy of the indexed information.

@iuwqyir iuwqyir changed the title handle reorgs Add reorg handler functionality and configuration options Oct 4, 2024
@iuwqyir iuwqyir requested a review from AmineAfia October 4, 2024 16:41
@iuwqyir iuwqyir marked this pull request as ready for review October 4, 2024 16:41
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from 81f8a60 to 2e3c10b Compare October 4, 2024 16:46
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch from 579cfc9 to 40e1005 Compare October 4, 2024 16:46
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from 2e3c10b to 487685c Compare October 7, 2024 11:05
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch from 40e1005 to a4c5e6a Compare October 7, 2024 11:05
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from 487685c to dab5d24 Compare October 7, 2024 11:44
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch from a4c5e6a to ebef386 Compare October 7, 2024 11:44
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from dab5d24 to 56646cf Compare October 7, 2024 12:12
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch 4 times, most recently from c2a0db6 to 792c94e Compare October 7, 2024 13:08
@iuwqyir iuwqyir requested a review from AmineAfia October 7, 2024 13:08
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from 56646cf to a4e9d3e Compare October 7, 2024 13:19
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch from 792c94e to ef70dc9 Compare October 7, 2024 13:20
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from a4e9d3e to b591820 Compare October 7, 2024 13:22
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch 3 times, most recently from b1e10e0 to 587b45d Compare October 7, 2024 18:44
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from b591820 to ddcfcbb Compare October 7, 2024 20:01
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch from 587b45d to 868d4fe Compare October 7, 2024 20:02
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from ddcfcbb to f4c4f06 Compare October 8, 2024 23:32
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch from 868d4fe to 6997e9c Compare October 8, 2024 23:32
@iuwqyir iuwqyir force-pushed the 10-04-create_new_storage_functions_for_handling_reorgs branch from f4c4f06 to d96a682 Compare October 10, 2024 12:48
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch from 6997e9c to cdaf53e Compare October 10, 2024 12:49
Copy link
Collaborator Author

iuwqyir commented Oct 10, 2024

Merge activity

  • Oct 10, 10:01 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 10, 10:09 AM EDT: Graphite rebased this pull request as part of a merge.
  • Oct 10, 10:10 AM EDT: A user merged this pull request with Graphite.

@iuwqyir iuwqyir changed the base branch from 10-04-create_new_storage_functions_for_handling_reorgs to graphite-base/91 October 10, 2024 14:05
@iuwqyir iuwqyir changed the base branch from graphite-base/91 to main October 10, 2024 14:07
@iuwqyir iuwqyir force-pushed the 10-04-handle_reorgs branch from cdaf53e to acb60cc Compare October 10, 2024 14:08
@iuwqyir iuwqyir merged commit f541e01 into main Oct 10, 2024
4 checks passed
@iuwqyir iuwqyir deleted the 10-04-handle_reorgs branch October 10, 2024 14:10
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