Block out-of-sync proposals #2784
Open
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.
I chose this approach - to refuse/block the broadcast of the proposal - as it has the least impact on the rest of the code, as opposed to checking/failing at every step of the proposal assembly. So, a node is allowed to go thru the motions of assembling a proposal but will only broadcast a proposal if-and-only-if it is in-sync at the time of broadcast.
In addition, the proposer checks that the proposed block is not lagging the chain, to address the situation where the node might have been out-of-sync at the start of proposal assembly but caught up by the time it had to broadcast the proposal.
The proposal itself could very well be a fork, and that is dealt with elsewhere, as usual.