Skip to content
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

feat: allow port 0 configuration on Waku node object #2359

Open
jm-clius opened this issue Jan 17, 2024 · 0 comments
Open

feat: allow port 0 configuration on Waku node object #2359

jm-clius opened this issue Jan 17, 2024 · 0 comments
Labels
effort/days Estimated to be completed in a few days, less than a week enhancement New feature or request

Comments

@jm-clius
Copy link
Contributor

Problem

The fix for #2042 allows users to configure the wakunode2 application with port 0 to use a dynamically allocated port for libp2p communications. This fix allows the allocated port to be updated in announced/advertised addresses for any wakunode2 app

However, if a WakuNode object is instantiated with port 0 from anywhere else than the application, the announced addresses (in e.g. identify or the enr) will never be updated to the allocated port. This is especially a problem for test cases instantiating the node and not the wakunode2 app. See for example this test where the resultant incorrect behaviour of identify 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 for if zeroPortPresent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days Estimated to be completed in a few days, less than a week enhancement New feature or request
Projects
Status: To Do
Development

No branches or pull requests

3 participants