-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
remove non-consensus data when inserting new consensus blocks #2687
Conversation
Pull Request Test Coverage Report for Build 328f20a3-9a4d-48b7-b00c-f97c33be5ca8
💛 - Coveralls |
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.
One necessary change.
Also, CHANGELOG
entry is missing.
} -> | ||
nonconsensus_block_numbers = | ||
lost_consensus_blocks | ||
|> Kernel.++(lost_consensus_neighbours) |
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.
Just a nitpick, but I don't think credo
will complain if you start the pipe with lost_consensus_blocks ++ lost_consensus_neighbours
In this PR (#1657) we started invalidating a large number of blocks.
Imagine a situation when we just imported a non-consensus block. Logic in this PR sets
consensus
to false for this block in the DB to makeCatchup.Fetcher
re-fetch this block. But we already imported logs and token transfers for this non-consensus block. the second time we will import correct logs and transfers but invalid data is not deleted.fixes #2645
fixes #2627
Changelog