-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Reorg depth counter is incorrect #5136
Comments
In the case of a reorg wouldn't the (newHead.slot - commonAncestor.slot) - (oldHead.slot - commonAncestor.slot) |
Not necessarily. We had a recent case like so:
In this case our reorg depth counter registered a reorg of depth 1, even though the reorg went from 24 back to 2 |
Other strange case, in deep reorgs, the shufflings are different, and there can be multiple blocks at the same slot. |
Using Prysm's calculation it seems like the find the max of the two differences between the new slot, the old slot and the common ancestor slot. so essentially Math.max((newHead.slot - commonAncestor.slot), (oldHead.slot - commonAncestor.slot)) |
…ts and the common ancestor slot (ChainSafe#5136)
Describe the bug
Recent reorgs are not properly being shown in our metrics. @wemeetagain investigated why our metrics cannot properly show and calculate reorgs and their depths. Reorg depth is currently calculated as
newHead.slot - commonAncestor.slot
Expected behavior
The reorg depth counter should be able to determine reorgs and at what depth. We need to tweak the calculation with something else. @wemeetagain suggests maybe
Math.max(newHead.slot, oldHead.slot) - commonAncestor.slot
Open for discussion/solutions.
The text was updated successfully, but these errors were encountered: