-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(chain): rework checkpoint logic to better handle finality #12650
Merged
Conversation
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
That way we efficiently accept old and checkpoint finality certificates.
Stebalien
force-pushed
the
steb/f3-fork
branch
from
October 28, 2024 15:59
91edc67
to
2f4e022
Compare
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.
It's unused, inefficient, and a potential DoS vector if someone decides to use it.
Stebalien
force-pushed
the
steb/f3-fork
branch
from
October 28, 2024 15:59
2f4e022
to
70054b8
Compare
Kubuxu
approved these changes
Oct 28, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGWM, having better tests would make me more confident from a thorough look, I think it is correct.
Kubuxu
added
release/backport
skip/changelog
This change does not require CHANGELOG.md update
labels
Oct 28, 2024
21 tasks
masih
approved these changes
Oct 28, 2024
I'm working on the test, just running into some issues with the lotus "chain gen" logic. |
Kubuxu
pushed a commit
that referenced
this pull request
Oct 28, 2024
* 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. Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
8 tasks
rjan90
pushed a commit
that referenced
this pull request
Oct 28, 2024
* 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. Signed-off-by: Jakub Sztandera <oss@kubuxu.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issues
fixes filecoin-project/go-f3#717
Proposed Changes
epochs of the current chain.
Checklist
Before you mark the PR ready for review, please make sure that: