-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
state sync: last consensus params height is not set #5889
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5889 +/- ##
==========================================
- Coverage 59.91% 59.79% -0.12%
==========================================
Files 269 269
Lines 24550 24552 +2
==========================================
- Hits 14708 14681 -27
- Misses 8240 8266 +26
- Partials 1602 1605 +3
|
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.
utACK 👍
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.
👍
changelog entry is missing |
if err := store.saveConsensusParamsInfo(height, | ||
state.LastHeightConsensusParamsChanged, state.ConsensusParams); err != nil { |
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.
nit: the following reads easier IMHO
if err := store.saveConsensusParamsInfo(
height, state.LastHeightConsensusParamsChanged, state.ConsensusParams,
); err != nil {
// ...
}
Description
When state syncing, we currently don't save
state.LastHeightConsensusParamsChanged
. This causes it to be set with a value of 0 when it is saved to the state store.Bootstap()
the function that is called ignores this valueHowever, state keeps the 0 value meaning at following heights when state is saved,
LastHeightConsensusParamsChanged
is 0This means that the state store isn't saving the consensus params rather referencing the consensus params at height 0 which don't exist and causes this error to arise when pruning:
The second part of this is that we are requesting the consensus params of
state.LastBlockHeight + 2
and saving it asstate.LastBlockHeight + 1