-
Notifications
You must be signed in to change notification settings - Fork 12
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: support custom blocks to rollback #55
Conversation
When doing rollback, it will take very long time if the flag |
there are some lint issues |
@@ -12,7 +12,7 @@ import ( | |||
// Rollback overwrites the current CometBFT state (height n) with the most | |||
// recent previous state (height n - 1). | |||
// Note that this function does not affect application state. | |||
func Rollback(bs BlockStore, ss Store, removeBlock bool) (int64, []byte, error) { | |||
func Rollback(bs BlockStore, ss Store, removeBlock bool, rollbackBlocks int64) (int64, []byte, error) { | |||
invalidState, err := ss.Load() |
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.
ss.Load()
will load the latest state, which is not the state we are expecting. In the following validators
parmsChangeHeight
... are not expected.
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.
We need heavy changes for this function.
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.
NextValidators: invalidState.Validators,
Validators: invalidState.LastValidators,
This should be updated.
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.
fixed to validators loaded from store
We need to test validator set change, maybe on dev or qa env. |
Description
support custom blocks to rollback
Changes
Notable changes: