This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Make transactions and block announces use notifications substreams #5360
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.
Extends the "notifications protocol" system introduced in #4284 and #4909, which are already used for GrandPa and Polkadot-specific protocols, to block announces and transactions.
This should normally be the last step to the transition to the new parachain-friendly networking protocol and the deeper integration with the libp2p protocol.
The next changes to
sc_networkshould normally only be clean-ups.Changes:
protocol.rsnow registers two notifications protocols:/<chainid>/block-announces/1and/<chainid>/transactions/1.ConsensusEngineIdto the handler to use as a fallback, we pass a full fallback message.protocol.rswe register, for each notifications protocol, how to interpret it. This is done with theFallbackenum. When we decode a block announce or list of transactions, we do the same thing as for the legacy protocol.Dangerosity of the change
This change is fully backwards-compatible, and is using the same mechanism for notifications as is used by GrandPa right now on the live network. #5201 suggests that there is a hidden bug somewhere, but it happens very rarely and I will spend the next days trying to find out what is happening.
I also tried on a local network (with
--dev), and everything works fine.Additionally, all the tests have passed on first try, which gives even more confidence.
Because of all this, I think the change should be quite smooth.