Skip to content
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

Merged
merged 15 commits into from
Jan 26, 2024

Conversation

cosinlink
Copy link
Contributor

Description

support custom blocks to rollback

Changes

Notable changes:

  • support custom blocks to rollback
  • ...

@forcodedancing
Copy link
Collaborator

When doing rollback, it will take very long time if the flag iavl-disable-fastnode is false.
We may need to override the flag when doing rollback, or force users to change the flag.

@forcodedancing
Copy link
Collaborator

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()
Copy link
Collaborator

@forcodedancing forcodedancing Jan 5, 2024

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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

@forcodedancing
Copy link
Collaborator

We need to test validator set change, maybe on dev or qa env.

state/store.go Outdated Show resolved Hide resolved
state/store.go Outdated Show resolved Hide resolved
@cosinlink cosinlink added this pull request to the merge queue Jan 26, 2024
Merged via the queue into bnb-chain:develop with commit 612799c Jan 26, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants