feat: allow port 0 configuration on Waku node object #2359
Labels
effort/days
Estimated to be completed in a few days, less than a week
enhancement
New feature or request
Problem
The fix for #2042 allows users to configure the
wakunode2
application with port0
to use a dynamically allocated port for libp2p communications. This fix allows the allocated port to be updated in announced/advertised addresses for anywakunode2
appHowever, if a
WakuNode
object is instantiated with port 0 from anywhere else than the application, the announced addresses (in e.g.identify
or theenr
) will never be updated to the allocated port. This is especially a problem for test cases instantiating the node and not thewakunode2
app. See for example this test where the resultant incorrect behaviour ofidentify
caused unexpected test failures.Suggested solution
It should be possible to follow the delayed address mapper (or a similar pattern) to allow the
node
to update addresses after binding/starting. This will also be a better separation of concerns - the app should not have to "understand" that the node needs updating under certain conditions - and allow us to remove the conditional processing path forif zeroPortPresent
.The text was updated successfully, but these errors were encountered: