You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix new chain not using configured reorg check start block (#173)
### TL;DR
Fixed reorg handler logic to properly handle cases where the configured start block is ahead of the latest committed block.
### What changed?
- Refactored `getInitialCheckedBlockNumber` function to improve readability by using more descriptive variable names and restructuring the conditional logic
- Added a new check in `getReorgCheckRange` to handle the case where the latest checked block is ahead of the latest committed block, preventing unnecessary processing
### How to test?
1. Configure a reorg handler with a start block that is ahead of the latest committed block
2. Verify that the reorg handler logs the message "Committing has not reached the configured reorg check start block" and continues without error
3. Confirm that the reorg handler correctly uses the configured block when appropriate based on the ForceFromBlock setting
### Why make this change?
This change prevents the reorg handler from attempting to process blocks that haven't been committed yet, which could lead to errors or unexpected behavior. The refactoring also improves code readability and maintainability by using clearer variable names and more logical flow.
0 commit comments