[Feature] Do not sync when peer consensus version differs#3936
[Feature] Do not sync when peer consensus version differs#3936
Conversation
d081cc9 to
453f986
Compare
|
Strangely, I had to increase the machine size for another CI job. Some recent change caused a lot of our builds to take longer or use up more memory. |
vicsn
left a comment
There was a problem hiding this comment.
Core logic LGTM! Just a note on backwards compatibility
This commit also deduplicates block request/response code between router and gateway, and improves testing.
|
Thanks for the feedback! I changed the PR to now interpret the To make this change simpler, Finally, I needed to make changes to the prop tests for these two message types because they didn't actually generate valid block requests or responses. For example, it picked two random numbers as start and end height, so that the ranges could be invalid. The number of blocks in the response also was not guaranteed to be equal to the size of the request range. |
ljedrz
left a comment
There was a problem hiding this comment.
Left some nits, but nothing blocking; LGTM 👌.
|
I tested this finally, and you will get an output like the following starting at consensus V12 for nodes that have not upgraded: Before merging/approving: take a look at the most recent change in ddb841b, which ensures messages are always rejected if the local consensus version would be greater than 12. |
|
@kaimast thank you, this is the behaviour we want:
Please confirm |
Yes. That's the behavior. |
This PR fixes #3822. It adds a
latest_consensus_versionto a block response to prevent nodes that did not upgrade from block advancement.If the peers use different versions of snarkOS, it will either fail to deserialize the block response, or abort when it detects that the version do not match.
Note: This requires upgrading the message version, as the format for
BlockResponsechanged.