Open jakubgs opened 1 year ago
I just found out about this flag:
--p2p.allowed-ports value [ --p2p.allowed-ports value ] Allowed ports to pick for different eth p2p protocol versions as follows <porta>,<portb>,..,<porti> (default: 30303, 30304, 30305, 30306, 30307)
What kind of silly formatting is this, and what the hell does portb
or porti
mean?
If I specify just one port for --p2p.allowed-ports
I get this:
EROR Erigon startup err="run out of allowed ports for p2p eth protocols [40404]. Extend allowed port list via --p2p.allowed-ports"
What is this weird behavior? I've never seen this with any other exec layer clients.
Could someone elucidate the difference between --port
and --p2p.allowed-ports
?
If I use --port 40403 --p2p.allowed-ports 40404
I get:
> d exec -it test netstat -lpnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:42069 0.0.0.0:* LISTEN 1/erigon
tcp 0 0 127.0.0.1:8551 0.0.0.0:* LISTEN 1/erigon
tcp 0 0 127.0.0.1:8545 0.0.0.0:* LISTEN 1/erigon
tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 1/erigon
tcp 0 0 :::40403 :::* LISTEN 1/erigon
tcp 0 0 :::40404 :::* LISTEN 1/erigon
Why?
So I'm assuming this is related to this flag:
--p2p.protocol value [ --p2p.protocol value ] Version of eth p2p protocol (default: 68, 67)
Which I assume is the number of ports that will be used from the list provided to --p2p.allowed-ports
.
But why? Why is this something no other client does?
Is there some kind of magical way to use just the latest version of protocol? Like --p2p.protocol=latest
?
What I don't get is why does the default value in help message say it's 68, 67
and not just 68
based on this:
https://github.com/ledgerwatch/erigon/blob/411913dd161afafdf87c5e30da64b4226fda502c/cmd/devnet/args/node.go#L28
It appears the default version is coming from here: https://github.com/ledgerwatch/erigon/blob/b6ffd87e4480a43a425a727b366cc500c59e5dff/cmd/utils/flags.go#L505-L509 Which in turn comes from here: https://github.com/ledgerwatch/erigon/blob/b6ffd87e4480a43a425a727b366cc500c59e5dff/node/nodecfg/defaults.go#L52 But I still don't get why there are two protocols enabled on two different ports.
Apparently - based on suggestions on Discord - the --port
flag is an "anachronism" and should not be used.
Not sure why it exists then, since it just causes confusion.
This issue is stale because it has been open for 40 days with no activity. Remove stale label or comment, or this will be closed in 7 days.
I don't think this is stale at all. The flags are confusing and need cleanup, or help message needs updating.
right. need or fix it or remove it.
System information
Erigon version:
2.49.3
OS & Version: Ubuntu 22.04Erigon Command: click to unfold
Concensus Layer: Nimbus Beacon Node
23.9.1
Erigon Command: click to unfold
Concensus Layer Command (with flags/config): click to unfoldChain/Network:
holesky
Expected behaviour
The DevP2P port listens on the port specified via
--port
flag.Actual behaviour
The DevP2P port is listening on
30303
despite flag specifying a different value.Steps to reproduce the behaviour
Use
--port
with value different than30303
.