-
Notifications
You must be signed in to change notification settings - Fork 13
Interrupt production on irreversible block #1569
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
Conversation
… is not child of pending lib
Why would |
b3 <- b4 <-b5 <-b6 |
When pending lib is moved to b4, shouldn't we do a fork switch and update head to |
Yes, which is the point of this PR. |
So if we do a fork switch and update head to |
Sorry, I'm not being clear. Before this PR, once block production was started by the producer plugin it would produce its complete round of 12 blocks before evaluating anything in the forkdb. Blocks might be coming into the node and put into the forkdb, but a needed fork switch was not performed until all 12 blocks of the producer was complete. This PR makes the producer plugin checks to see if there is a pending lib greater than head before it produces each block which allows it to switch to that pending lib if available. Before Savanna, we actually dropped those blocks on the floor so they were not even in the forkdb. Pre-Savanna the longest chain would win which would mean that normally the 12 blocks produced by the producer would win and any dropped blocks would not become final. With Savanna, voting can happen on those late blocks so they can become the canonical chain. In practice, if the producer was running slow or had some hiccup so that everyone else had those blocks then those blocks are going to be the canonical chain. This PR takes the very conservative approach of only interrupting production on proof of LIB that makes the produced chain impossible to become LIB. We talked about and might in the future switch to a diff fork if we find it is likely to become the canonical chain. For example, if we know that there are not enough outstanding votes to allow our branch to win. |
Thanks for the explanation! I finally understand the logic of what we are trying to do, but I find the code hard to follow. |
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.
Is it possible to add a test for the new code logic in producer_plugin?
Interrupt production if an irreversible block received on a different branch.
See new test in #1570
Resolves #1492