Skip to content
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

feat(cli): add max peer args #4024

Merged
merged 4 commits into from
Aug 1, 2023
Merged

feat(cli): add max peer args #4024

merged 4 commits into from
Aug 1, 2023

Conversation

altugbakan
Copy link
Contributor

Fixes #3990

@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #4024 (d5fb597) into main (1249601) will increase coverage by 0.02%.
Report is 2 commits behind head on main.
The diff coverage is 47.22%.

Impacted file tree graph

Files Changed Coverage Δ
crates/net/network/src/peers/manager.rs 83.50% <0.00%> (-0.77%) ⬇️
bin/reth/src/args/network_args.rs 32.18% <65.38%> (+14.44%) ⬆️

... and 13 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.55% <0.00%> (+0.01%) ⬆️
unit-tests 64.12% <47.22%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 25.83% <65.38%> (+0.20%) ⬆️
blockchain tree 83.04% <ø> (ø)
pipeline 90.10% <ø> (ø)
storage (db) 74.30% <ø> (ø)
trie 94.70% <ø> (ø)
txpool 47.96% <ø> (+0.59%) ⬆️
networking 77.43% <0.00%> (-0.06%) ⬇️
rpc 58.27% <ø> (+0.01%) ⬆️
consensus 63.51% <ø> (ø)
revm 32.71% <ø> (ø)
payload builder 6.58% <ø> (ø)
primitives 87.99% <ø> (+0.04%) ⬆️

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty, this is correct,

just have some style nits for the builder fns here

bin/reth/src/args/network_args.rs Outdated Show resolved Hide resolved
@mattsse mattsse added the A-cli Related to the reth CLI label Aug 1, 2023
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last nit

Comment on lines 90 to 92
let mut peer_config = config.peers.clone();
if let Some(max_inbound_peers) = self.max_inbound_peers {
peer_config = peer_config.with_max_inbound(max_inbound_peers);
}
if let Some(max_inbound_peers) = self.max_outbound_peers {
peer_config = peer_config.with_max_outbound(max_inbound_peers);
}
peer_config = peer_config.with_max_inbound_opt(self.max_inbound_peers);
peer_config = peer_config.with_max_outbound_opt(self.max_outbound_peers);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: these can be chained:

let peer_config = config.peers.clone().with_().with()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, updated!

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work

@mattsse mattsse added the M-changelog This change should be included in the changelog label Aug 1, 2023
@mattsse mattsse added this pull request to the merge queue Aug 1, 2023
Merged via the queue into paradigmxyz:main with commit b46101a Aug 1, 2023
23 checks passed
@altugbakan altugbakan deleted the peer-args branch August 1, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Related to the reth CLI M-changelog This change should be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cli arg "max peers" to change the default number of peers from 100
2 participants