Repository navigation
fix: Do not use nHeight when trying to identify the very first/initial snapshot - #5538
Merged
Merged
Conversation
knst
reviewed
Aug 17, 2023
Collaborator
|
concept ACK. |
UdjinM6
marked this pull request as draft
August 17, 2023 17:02
Author
|
That's what I thought initially too but looking at logs a bit more - node1 was at height=14 already when it crashed, it must be some deeper issue. |
…l snapshot `-1` will only mean `not initialized` from now
Author
|
I think I found the root of it (pls check PR description). |
PastaPastaPasta
approved these changes
Aug 21, 2023
PastaPastaPasta
left a comment
Member
There was a problem hiding this comment.
utACK for squash merge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
-1will only meannot initializedfrom nowShould fix crashes like https://gitlab.com/dashpay/dash/-/jobs/4893359925
This fix applied on top of #5525 https://gitlab.com/UdjinM6/dash/-/pipelines/972154075
What was done?
Introduce and use
m_initial_snapshot_indexinstead of re-usingnHeight. Added a couple of asserts to make sure:nHeightset to-1explicitly (but it's ok for ctor with no params to do so)nHeightto-1for an existing mn listGetListForBlockInternalnever returns non-initialized mn listsHow Has This Been Tested?
Run tests, run regtest/testnet wallets.
Breaking Changes
We never stored snapshots with
nHeight == -1, should be no breaking changes I think.Checklist: