-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable incoming light-client connections for minimal relay node #2202
Merged
skunert
merged 2 commits into
paritytech:master
from
skunert:skunert/network-traffic-fix
Nov 7, 2023
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
Even though it looks ugly, it seems there is no other way to estimate
in_peers_light
using current implementation ofNetworkConfiguration
...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.
Yes, this should probably become a proper field in the config some day.
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.
There is something I don't understand, maybe due to some limited domain knowledge in the networking subsystem. How reducing the
in_peers
number just trims the light clients connections?I mean, aren't the full clients connections affected as well?
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.
This is a bit tricky, when users specify
--in-peers-light
we actually add them to the normalin_peers
in config construction:polkadot-sdk/substrate/client/cli/src/params/network_params.rs
Lines 235 to 245 in b44de38
And here is the logic that checks for the light client slots actually occupied:
polkadot-sdk/substrate/client/network/sync/src/engine.rs
Lines 1035 to 1041 in b44de38
The whole concept of light client slots is kind of implicit currently. But in the end you can still calculate the light client slots with by calculating the difference as in the code.
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.
I was going to comment, but @skunert beat me. Could just add that it's the limitation of light peer slots bookkeeping, we calculate the light peer slot count in
SyncingEngine
fromin_peers
,out_peers
,full_peers
:polkadot-sdk/substrate/client/network/sync/src/engine.rs
Lines 422 to 426 in 4caa3d8
So it's enough to update
config.default_peers_set.in_peers
for light peer slots to be correctly calculated later.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.
clear Ty