Blacklist: Prevent redeeming a node suspected in the same orbit #266
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.
This commit prevents to redeem a node in a given orbit if the node has been lastly suspected in the same orbit.
The intent is to prevent a situation where a node momentarily loses connection in the round it is supposed to propose a block, it is then blacklisted after a few rounds, and the nodes then redeem it when they build blocks notarized on top of the blocks where it is redeemed in. However, since the nodes use the finalized blocks and not the notarized blocks to know whether to time out immediately on a blacklisted node or not, they might have not finalized the block where it has been redeemed in by time, and therefore they immediately time out. Since they immediately time out, the node is then blacklisted again, as it has been redeemed right before it had a chance to propose a block.
This commit prevents this problem, by preventing a node to be redeemed in the same round it was blacklisted in.
This prevents the node from being blacklisted in the orbit successive to the orbit it has been blacklisted in, because a blacklisted node cannot be blacklisted again, and once a node is redeemed in an orbit, it will not be blacklisted in that orbit again:
For example, node 2 out of 0,1,2,3 is supposed to propose a block in round 6, and then in round 10. If round 6 times out, it will not be redeemed in rounds 7 to 9, and it can start be redeemed in round 11. It won't be blacklisted in the orbit corresponding to round 10, because it is already blacklisted in that orbit, and we only vote to blacklist a node if it was not blacklisted in the round it was supposed to propose a block in.