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
Fix sync and migration on compacted state #3472
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -246,9 +246,9 @@ class Initializing[F[_] | |||||||||||||||
.map(_.latestBlockHash) | ||||||||||||||||
.toSet | ||||||||||||||||
|
||||||||||||||||
// Add sorted DAG in order from oldest to approved block | ||||||||||||||||
// Add sorted DAG in order from approved block to oldest | ||||||||||||||||
minHeight <- getMinBlockHeight | ||||||||||||||||
_ <- heightMap.flatMap(_._2).toList.traverse_ { hash => | ||||||||||||||||
_ <- heightMap.flatMap(_._2).toList.reverse.traverse_ { hash => | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to add LFB first, because each rchain/block-storage/src/main/scala/coop/rchain/blockstorage/dag/BlockMetadataStore.scala Lines 186 to 192 in 56c35c0
So fix is to add blocks in reverse order - down from LFB. |
||||||||||||||||
for { | ||||||||||||||||
block <- BlockStore[F].getUnsafe(hash) | ||||||||||||||||
// If sender has stake 0 in approved block, this means that sender has been slashed and block is invalid | ||||||||||||||||
|
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.
On compacted state finalized block set during migration were including edge blocks parents, which do not exist in metadata store. Fix is filtering them out.