-
Notifications
You must be signed in to change notification settings - Fork 459
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
Expose CLI for explicit chain sync and head manipulation #3442
Comments
The syncer uses the store's As the code read now, the syncer will not resync any head it already has state for. |
Given this I would feel comfortable with either (A) adding an option to the syncer that instructs it to ignore previous state while syncing or (B) Diffing the current state with the state of the head we are setting, and removing it from the TipIndex's state map when calling |
For a first pass, (c) bouncing the node is ok. But otherwise yes I think we should expect something like (b) to remove all entries from the in-memory tip index that are not on the chain defined by the new head. We could use this to make it safer too. A |
This mostly LGTM. The general idea is great. If we were designing a CLI that Did the Right Thing, then The above ideas might take more time to work out so I understand if throwing all functionality on |
closed via #3444 |
Description
While debugging staging-0.5.0 I added some debug statements to the storage miner actor code. The only way to trigger these was to destroy my repo and then re-sync the chain, including re-fetching it from remote peers. Now that a new release has been deployed, I can't do that.
It would be more efficient and direct to instead support explicit rewinding of chain head back to the genesis, and then sync of the desired head tipset. This would cause the chain to be re-validated (fetching all the required data from the local store).
Chain import export #3443 could be another solution to the general problem.
Acceptance criteria
chain set-head <cid>....
command replaces the chain store's head with the provided tipset key cids (which must be present in the store)chain sync <cid>...
invokesHandleNewTipset
with the provided tipset key, revalidating that part of the chain subsequent to wherever the new head diverges from the prior chain.Risks + pitfalls
These commands allow an unwitting user to screw up their local chain state. I don't think this should be a dominating concern during the present stage of development.
FYI @ZenGround0 @frrist
The text was updated successfully, but these errors were encountered: