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

[Bug]: incorrect missed blocks key during slashing migraion (0.47 -> 0.50) #18004

Closed
1 task done
swelf19 opened this issue Oct 9, 2023 · 0 comments · Fixed by #18016
Closed
1 task done

[Bug]: incorrect missed blocks key during slashing migraion (0.47 -> 0.50) #18004

swelf19 opened this issue Oct 9, 2023 · 0 comments · Fixed by #18016
Assignees
Labels

Comments

@swelf19
Copy link
Contributor

swelf19 commented Oct 9, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

slashing module.

in sdk47 missed blocks stored under the key

// ValidatorMissedBlockBitArrayPrefixKey - stored by *Consensus* address (not operator address)
func ValidatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte {
	return append(ValidatorMissedBlockBitArrayKeyPrefix, address.MustLengthPrefix(v.Bytes())...)
}

but im migration v4 code, you have copied the key with an error, you missed address.MustLengthPrefix wrapper

func validatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte {
	return append(validatorMissedBlockBitArrayKeyPrefix, v.Bytes()...)
}

it leads to no data migration in real state, and it leads to an error in the begin blocker
panic: failed to get the validator's bitmap value: failed to decode bitmap chunk; index: 93911: unexpected EOF

Cosmos SDK Version

main

How to reproduce?

  1. run the node with sdk0.47
  2. collect some data under missed blocks key
  3. migrate node with sdk0.50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants