fix v2 conversion to ensure we provide blocks in correct format #3465
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.
Testing on
testnet
(wasfloonet
) uncovered an issue in our protocol version handling when providing blocks to v2 peers.I think we see this on
testnet
because there are relatively few nodes in sync.This does not appear to be happening on
mainnet
but I suspect this is simply masked by the fact we have better connectivity and more peers available.The following error occurs when attempting to provide a full block to a v2 peer -
This is because we store v3
CommitOnly
blocks in the local db and the bug resulted in us not converting the block into v2 compatible format prior to the serialization attempt. We do not have "input features" and cannot serialize successfully.v2
.v3
peers and above we do not need to convert.The bug had this logic flipped.
This would most obviously manifest itself if a
4.0.0
node attempted to sync against a number of4.1.0
nodes.Given
4.1.0
is the latest binary this is unlikely to occur. I think this is why we did not see this onmainnet
and we are only seeing it ontestnet
.