This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Extract transactions handling from protocol.rs #8110
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NikVolf
reviewed
Feb 12, 2021
Contributor
Author
|
Note for self: I've just realized that this wasn't compatible with the current network, because the handshake of all notifications, by default, is an encoded |
Co-authored-by: Nikolay Volf <[email protected]>
Contributor
Author
|
Fixing this transaction would be way easier if #8079 was in. I'm going to push for that PR to be merged. |
romanb
approved these changes
Feb 16, 2021
Contributor
romanb
left a comment
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.
The direction looks good to me, conceptually (I did not look at the control flow in detail).
NikVolf
approved these changes
Feb 17, 2021
Contributor
Author
|
Updated the burn-in PR after the commit I've just pushed and will see if everything looks normal before merging. |
KalitaAlexey
pushed a commit
to KalitaAlexey/substrate
that referenced
this pull request
Jul 9, 2021
* Extract transactions handling from protocol.rs * Oops, boolean * Do this better * Update client/network/src/transactions.rs Co-authored-by: Nikolay Volf <[email protected]> * [WIP] Fix handshake * Finish handshake change * Bugfix Co-authored-by: Nikolay Volf <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
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.
Cleans up
protocol.rsby extracting all the transactions-related code to a newtransactions.rsmodule.In this PR, I've done the minimal amount of changes to make sure to not break anything. Later PRs can add more changes, such as switching from
write_notificationto some properly-back-pressured alternative.Before this PR, the various layers go like this:
(outside) <-> service.rs <-> behaviour.rs <-> protocol.rs <-> generic_proto.rsThis PR moves the transaction handling from
protocol.rsto(outside). It is now a background task that interacts with theNetworkServiceinservice.rs.A new
transactions_handler_executorfield has been added to the network parameters. It is used to spawn that task.This background task is spawned by
service.rsafter the service creation. Again, I want to minimize the surface of the changes.I have in mind to later do the same with the syncing protocol later, and completely eliminate
protocol.rs.The main advantage, beyond code clean up, is that the transactions sizes and rates are now treated the same as GrandPa, collation and validation messages, and are reported on Prometheus.
Two misc. notes:
gossip_disabledvariable that is updated with whenever we're full synced when polling the network worker.