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:
- Parse relevant CLI flags
- Produce a network service configuration from these flags
- Initialise the UPnP service