-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Remove backwards-compatibility networking hack #8068
Conversation
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.
Does the test_sync
integration test rely on this hack being present or do you think the timeouts are unrelated?
It definitely shouldn't rely on the hack. |
On my machine, the nodes of the sync test can't even establish TCP connections between each other, which is not something that this PR could break. I'm investigating. |
We were missing the same fix as #7985 but for transactions. |
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.
For what my review is worth, the changes look good to me.
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.
For what my review is worth, the changes look good to me.
bot merge |
Trying merge. |
bump substrate to include fix for paritytech/substrate#8068 (comment)
* Bump substrate bump substrate to include fix for paritytech/substrate#8068 (comment) * bump version * bump impl_version for polkadot, kusama, westend * Blank commit to kick github
Fix #7852
After this PR, Polkadot 0.8.26 and below will be unable to open the transactions and GrandPa substreams with clients that have this PR in.
It is a noticable breakage, because so far even old versions of Polkadot (even maybe 0.8.0) were capable of connecting to recent versions. Only the other way around (recent connecting to older) was known to be broken.
Detailed explanations
In Polkadot 0.8.26 and below, we consider that either all substreams (block announces, transactions, and GrandPa) are open with a given peer, or none. As long as the block announces substream (i.e. the "main" one) is open, we silently ignore situations where the transactions and/or GrandPa has failed to open. If the rest of the client tries to send a transaction or a GrandPa message with a peer where it failed to open, the message is silently discarded.
In Polkadot 0.8.27 and later (since #7700), however, we properly separate substreams individually from each other. As part of #7700, nodes now open the block announces substream first, then, only if it is open, opens the transactions substreams and GrandPa.
Similarly, if a 0.8.27 node receives an open request for transactions without the block announces being already open, it will be refused. Later, this receiving node will then send back an open request on their own for a transactions substream.
Unfortunately, this causes some compatibility issue between 0.8.26- and 0.8.27+. Nodes on 0.8.26- try to open everything at once, and only the block announces will successfully open. Nodes on 0.8.26- then silently ignore the situation. Even though nodes on 0.8.27+, after refusing a transactions/grandpa substream, will later try to open an outgoing transactions/grandpa substream, this re-opening will be ignored by nodes on 0.8.26-.
In order to solve this problem, a backwards-compatibility hack was added by allowing a certain number of nodes to open transactions and GrandPa substreams despite having no block announces substream open.
This PR removes this hack.