Skip to content

Define hardcoded ports  #457

Description

@tropicar

Is your feature request related to a problem? Please describe.

Setting up random ports in docker-compose files seems to provoke a problem to find incoming peers in the blockchain clients. Without properly broadcasting and opening the P2P ports for each client other peers cannot connect to your client which harms decentralization since in this situation you are not contributing to the network by sharing your info with peers you're only taking info when you have no inbound peers.

Describe the solution you'd like

The solution would be to add a hardcoded port and set up the client to use this port. To be able to do this, we have to define a clear way to define what ports we will use for the different clients and chains.

We will use 3 values in order to define what number port will be hardcoded in the package:

  • ChainID of the chain multiplied by 10, it will be 0 if the chain has no specified chain ID value.
  • P2P default value
  • ClientID (It's a value we define for every client)

The sum of the 3 above values for each package will be the defined P2P port(s) for the package. This avoids port collisions caused by many clients using the same P2P port and also using the same client with up to 5 separate network implementations again trying to use the same port.

Additional Schema Rules (i.e. the chainID value is larger than the port range)

  • In the beacon-chain clients, the chainID value will be equal to the value of the Execution layers for that network (i.e. Prater network chain ID is equal to its merged EL Goerli so both chain IDs are 50).
  • If the chainID has more than 5 digits, we use the last 4 digits only.(chainID: 431140, we use 1140).
Package NameChainIDP2P port by defaultClientIDHardcoded PortPublished update
Geth1030303030403✔️
Goerli Geth5030303030803✔️
Lukso Geth282830303033141
Besu10303031130414✔️
Besu Goerli50303031130814✔️
Nethermind1030303130404✔️
Nethermind Goerli5030303130804✔️
Nethermind Ropsten3030303130604✔️
Nethermind Chiado10200 (200)30303132304✔️
Erigon1030303230405✔️
Erigon Gnosis100030303231305✔️
Erigon Gnosis Torrent100042069243084✔️
Erigon Gnosis Caplin1000UDP/4000 & TCP/400115UDP/5015 & TCP/5016✔️
Erigon Goerli5030303230805✔️
Erigon Ropsten3030303230605✔️
Prysm10TCP/13000 & UDP/120003TCP/13103 & UDP/12103
Prysm Sepolia11155111 (5111)TCP/13000 & UDP/120003TCP/19114 & UDP/18114
Prysm Ropsten303TCP/13303 & UDP/12303✔️
Prysm Prater50TCP/13000 & UDP/120003TCP/13503 & UDP/12503Merged ✔️
Gnosis Beacon Chain Prysm1000TCP/13000 & UDP/120003TCP/14003 & UDP/13003
Prysm Chiado10200 (200)TCP/13000 & UDP/120003TCP/15003 & UDP/14003
Teku Ethereum10TCP/9000 & UDP/90005TCP/9105 & UDP/9105✔️
Teku Gnosis1000TCP/9000 & UDP/90005TCP/19005 & UDP/19005✔️
Teku Ropsten30TCP/9000 & UDP/90005TCP/9305 & UDP/9305✔️
Teku Prater50TCP/9000 & UDP/90005TCP/9505 & UDP/9505✔️
Teku Chiado10200 (200)TCP/9000 & UDP/90005TCP/1105 & UDP/11005
Nimbus Ethereum10TCP/9000 & UDP/90006TCP/9106 & UDP/9106✔️
Nimbus Gnosis1000TCP/9000 & UDP/90006TCP/19006 & UDP/19006✔️
Nimbus Prater50TCP/9000 & UDP/90006TCP/9506 & UDP/9506✔️
Nimbus Chiado10200 (200)TCP/9000 & UDP/90006TCP/11006 & UDP/11006
Lighthouse Ethereum10TCP/9000 & UDP/90004TCP/9104 & UDP/9104✔️
Lighthouse Gnosis1000TCP/9000 & UDP/90004TCP/19004 & UDP/19004✔️
Lighthouse Ropsten30TCP/9000 & UDP/90004TCP/9304 & UDP/9304✔️
Lighthouse Prater50TCP/9000 & UDP/90004TCP/9504 & UDP/9504✔️
Lighthouse Chiado10200 (200)TCP/9000 & UDP/90004TCP/11004 & UDP/11004
Lodestar Ethereum10TCP/9000 & UDP/900012TCP/9112 & UDP/9112✔️
Lodestar Prater50TCP/9000 & UDP/900012TCP/9512 & UDP/9512✔️
Lodestar Gnosis1000TCP/9000 & UDP/900012TCP/19012 & UDP/19012
Lodestar Chiado10200 (200)TCP/9000 & UDP/900012TCP/11012 & UDP/11012
Sepolia Geth11155111 (5111)30303035415✔️
Sepolia Erigon (Execution)1155111 (5111)30303135416✔️
Sepolia Erigon (Torrent Port)1155111 (5111)42069 TCP & UDP2TCP/47285 & UDP/47285✔️
Sepolia Erigon Caplin (Internal CL)1155111 (5111)TCP/4000 & UDP/400115TCP/9113 & UDP/9115✔️
Nethermind xDai100030303131404✔️
Avalanche431140 (1140)TCP/965110TCP/21061
Rinkeby4030303030343
Ropsten3030303030338✔️
Bitcoin0833378340
Monero018080918089Merged ✔️
Zcash0823388241✔️
Ethereum Classic61030303030913
SSV Shifu Prater50TCP/12001 UDP/1300113TCP/ 12514 UDP/13514✔️

The ClientID is a value we have defined:

ClientClientID
Geth0
Nethermind1
Erigon2
Prysm3
Lighthouse4
Teku5
Nimbus6
Bitcoin7
Monero8
Zcash9
Avalanche10
Besu11
Lodestar12
SSV Shifu13
Lukso14
Caplin (Erigon Embedded CL)15

┆Issue is synchronized with this Basecamp todo by Unito

Metadata

Metadata

Labels

docDocumentation update is requiredenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions