-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chain): rework checkpoint logic to better handle finality (#12650)
* feat(chain): use the index when determining if A is an ancestor of B That way we efficiently accept old and checkpoint finality certificates. * feat(chain): allow checkpoints beyond finality but prevent forks 1. Allow setting checkpoints more than 900 epochs ago as long as said checkpoint doesn't cause us to _revert_ more than 900 epochs. 2. Verify that we don't end up reverting more than 900 epochs when switching to a chain at or beyond the current head. 3. Optimize all of this such that, e.g., setting checkpoints in the distant past can use the chain index instead of having to walk back the chain manually. We may still need to walk up to 900 epochs to make sure we're not forking beyond finality, but that's it. * chore(chain): remove ChainStore.NearestCommonAncestor It's unused, inefficient, and a potential DoS vector if someone decides to use it.
- Loading branch information
Showing
1 changed file
with
47 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters