-
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: allow checkpointing to forks #6107
Conversation
@Stebalien This will need an update to the |
Because if not you might (likely will) immediately sync away from your new "set" head if you're setting far back in the past. |
708f5ab
to
cbd8b84
Compare
Previously, `lotus sync checkpoint` would only checkpoint on the current chain. Now, it can switch to a new fork.
6bf712b
to
dbbd74e
Compare
It can take a tipset or a height. |
dbbd74e
to
3e08f0b
Compare
We need to wait until the node _has_ the tipset, not until it doesn't. This probably only worked before due to race conditions. fixes #4716 (probably)
That way, checkpoints can be enforced by the chainstore, removing a potential race where an in-progress sync of a fork could bypass a sync checkpoint.
3e08f0b
to
8f309b2
Compare
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.
Yup, LGTM
Previously,
lotus sync checkpoint
would only checkpoint on the currentchain. Now, it can switch to a new fork.
Alternatives considered:
invasive. (but I have a WIP patch if desired).
lotus sync fetch
command to fetch a chain (to bepaired with
lotus chain sethead
followed by alotus sync checkpoint
.Changes:
Sync.SetCheckpoint
toSync.SyncCheckpoint
and allow it to sync to a new fork.Chain.SetHead
unset any set checkpoints.Known issues:
The current checkpoint mechanism is racy because we only check before we start syncing a chain. We need to push checkpoints down into the chainstore to be safe/atomic.fixedUnlikenot an issue herelotus chain sethead
, this code doesn't "invalidate" the current fork. I'm not entirely sure why we need to do that.