Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

--max-peers not honored if --min-peers is not specified #7576

Closed
GoodMirek opened this issue Jan 16, 2018 · 3 comments
Closed

--max-peers not honored if --min-peers is not specified #7576

GoodMirek opened this issue Jan 16, 2018 · 3 comments
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M2-config 📂 Chain specifications and node configurations. M4-core ⛓ Core client code / Rust. Q2-easy 💃 Can be fixed by copy and pasting from StackOverflow.

Comments

@GoodMirek
Copy link

I'm running:

  • Which Parity version?:
parity --version
Parity
  version Parity/v1.10.0-unstable-ad14e656f-20180115/x86_64-linux-gnu/rustc1.22.1
  • Which operating system?: Linux
uname -a
Linux hostx 4.14.13-300.fc27.x86_64 #1 SMP Thu Jan 11 04:00:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • How installed?: from source
  • Are you fully synchronized?: no
  • Which network are you connected to?: ethereum
  • Did you try to restart the node?: yes

Running command:

parity --max-peers 10

does not limit the maximum number of peers, unless --min-peers is specified too.
It seems that the default value of min-peers prevails CLI option of --max-peers. When --max-peers is specified to be lower than the min-peers default value, then it is not honored.

Expected behavior is that explicitly expressed options always prevails defaults, so --max-peers should have been honored.

File ~/.local/share/io.parity.ethereum/config.toml does not exist on the affected system.

@5chdn 5chdn added Z5-intended 🎯 Issue describes a behavior which turns out to work as intended. Closer should explain why. M2-config 📂 Chain specifications and node configurations. labels Jan 16, 2018
@5chdn 5chdn added this to the 1.9 milestone Jan 16, 2018
@5chdn
Copy link
Contributor

5chdn commented Jan 16, 2018

That's intended, you can not have less than minimum peers :)

@GoodMirek
Copy link
Author

I would think that explicitly specified options should prevail the defaults.

In this case, I would expect that specifying --max-peers without providing --min-peers should automatically lower min-peers to be the same or lower than the max-peers. In order not to constantly connect/disconnect peers, which behavior is probably costly (is it?), I can imagine that it can work in e.g. following way:
If --min-peers is omitted and only --max-peers is specified then min-peers could be set to a half of max-peers, but not less than e.g. 10 and never more than max-peers.

@5chdn 5chdn added F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. Q2-easy 💃 Can be fixed by copy and pasting from StackOverflow. M4-core ⛓ Core client code / Rust. and removed Z5-intended 🎯 Issue describes a behavior which turns out to work as intended. Closer should explain why. labels Jan 17, 2018
@5chdn 5chdn modified the milestones: 1.9, 1.10, 1.11 Jan 17, 2018
@5chdn 5chdn modified the milestones: 1.11, 1.12 Mar 1, 2018
@niklasad1
Copy link
Collaborator

Solved in #8087

@5chdn 5chdn modified the milestones: 1.12, 1.11 Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M2-config 📂 Chain specifications and node configurations. M4-core ⛓ Core client code / Rust. Q2-easy 💃 Can be fixed by copy and pasting from StackOverflow.
Projects
None yet
Development

No branches or pull requests

3 participants