-
Notifications
You must be signed in to change notification settings - Fork 800
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
Enable binding to zero port in networking stack #4675
Labels
Comments
This was referenced Sep 5, 2023
Closed by #4700 |
Woodpile37
pushed a commit
to Woodpile37/lighthouse
that referenced
this issue
Jan 6, 2024
Woodpile37
pushed a commit
to Woodpile37/lighthouse
that referenced
this issue
Jan 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Due to the ordering of various operations during initialisation of Lighthouse's networking stack, we are currently unable to defer port selection to the OS (i.e., bind to the 0 port). The ability to do so is desirable for a few reasons; namely that it would avoid racing on bound port numbers which are currently causing some instability in our tests and subsequently CI jobs.
Currently, the following procedure describes the initialisation of the network service:
lighthouse/beacon_node/network/src/service.rs
Lines 241 to 257 in 0c23c86
lighthouse_network
(i.e., our libp2p handle)lighthouse/beacon_node/network/src/service.rs
Lines 292 to 294 in 0c23c86
a) Build ENR
lighthouse/beacon_node/lighthouse_network/src/service/mod.rs
Lines 148 to 154 in 0c23c86
b) Initialise network globals using this ENR
lighthouse/beacon_node/lighthouse_network/src/service/mod.rs
Lines 157 to 169 in 0c23c86
c) Initialise discovery
lighthouse/beacon_node/lighthouse_network/src/service/mod.rs
Lines 281 to 293 in 0c23c86
d) Start libp2p
lighthouse/beacon_node/lighthouse_network/src/service/mod.rs
Lines 356 to 383 in 0c23c86
lighthouse/beacon_node/network/src/service.rs
Lines 352 to 377 in 0c23c86
Steps to resolve
The new procedure needs to look like the following:
lighthouse_network
NewListenAddr
event from libp2pa) Initialise the UPnP service
b) Update the networking globals accordingly
The associated RPC tests will also need to be updated to bind to port 0.
The text was updated successfully, but these errors were encountered: