Go-ethereum: --light.maxpeers is 100 by default, bad for clients

Created on 10 Jul 2019  路  8Comments  路  Source: ethereum/go-ethereum

The --light.maxpeers flag is used by both light servers and light clients. The default of 100 is good for servers, but setting 100 connections for clients is an overkill. We should figure out how to make servers run with 100, but clients with default of 10.

good first issue help wanted

Most helpful comment

Whoops, thx! Fixed!

All 8 comments

You likely meant --light.maxpeers.

% geth --help | grep -E "light\.(serve|maxpeers)"
  --light.serve value     Maximum percentage of time allowed for serving LES requests (multi-threaded processing allows values over 100) (default: 0)
  --light.maxpeers value  Maximum number of light clients to serve, or light servers to attach to (default: 100)
  --lightserv value        Maximum percentage of time allowed for serving LES requests (deprecated, use --light.serve) (default: 0)
  --lightpeers value       Maximum number of light clients to serve, or light servers to attach to  (deprecated, use --light.maxpeers) (default: 100)

Whoops, thx! Fixed!

Hello, is this issue still available? I am new to contributing to open source projects and would love to get some experience!

@dantedallag as far as I can see, no pull requests have been opened to fix this. Feel free to take a stab at it. If you need guidance on where to look, just ask :)

Is @dantedallag still working on this? If not, I could take a look. Where is the logic for this, and where/how is the default defined?

@hewiefreeman as far as I can tell, it鈥檚 just a quick change in eth/config.go in DefaultConfig.

@hewiefreeman Go ahead, I have been working on something else. Good Luck!

@ScreamingTaco It doesn't seem quite as simple as that since in cmd/utils/flags.go it's used as "Maximum number of light clients to serve, or light servers to attach to". So, it's not a matter of changing the default to 10, since that would change the default for both clients and servers. Maybe there should also be a Config.LightClientPeers defined for this as well as in cmd/utils/flags.go. I should be looking in cmd and cmd/geth for it's relevant usage, no?

And someone correct me if I'm wrong, but all the init() functions in the eth package aren't ever used, and private, making them useless. Shouldn't they be removed?

Was this page helpful?
0 / 5 - 0 ratings