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

fix: consider WS extMultiAddrs before publishing host address #2122

Merged
merged 3 commits into from
Oct 17, 2023

Conversation

gabrielmer
Copy link
Contributor

@gabrielmer gabrielmer commented Oct 11, 2023

Description

When the user runs a Waku node with the flag --ext-multiaddr using a WS/WSS address, our current logic does not notice we specified a WS/WSS address and incorrectly adds the default wsHostAddress to the announcedAddresses

Changes

  • Checking for announced WS/WSS addresses in extMultiAddrs before announcing the default wsHostAddress
  • Adding test case accounting for the mentioned scenario

How to test

When WS/WSS is enabled and no WS/WSS ext-multiaddr provided, default WS/WSS address is published:
without_extma

When WS/WSS is enabled and a WS/WSS ext-multiaddr is provided, the default WS/WSS is not published:
with_extma

Issue

closes #1797

@gabrielmer gabrielmer self-assigned this Oct 11, 2023
@github-actions
Copy link

github-actions bot commented Oct 11, 2023

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2122

Built from cf4485e

@gabrielmer
Copy link
Contributor Author

Notice that currently the same case happens with external addresses that aren't WS/WSS: if an external address is set with the --ext-multiaddr flag and no extIp or dns are provided, both the host's bind address and the external multiaddress are announced.

We can add the same logic for that case. However I do think that it's better to require users to add extIp and extPort properly through its respective CLI flags instead of trying to infer them.

The way I see it is: extIp and extPort have their own flags which should be used. There's no flag for a separate WS/WSS address so it's either inferred from extIp/dns or passed through the ext-multiaddr flag.

Let me know what you think about this approach

@gabrielmer gabrielmer marked this pull request as ready for review October 13, 2023 09:46
Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!
I just added a comment mentioning how we could do the same (not a big deal though.)

However, shall we have in the PR description or somewhere an example on how to validate that the issue is sorted out with that? Maybe a snippet log will help as well.

Cheers!

waku/node/config.nim Outdated Show resolved Hide resolved
Copy link
Member

@vpavlin vpavlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, seems to correctly produce the list of listen addresses

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!!!

@gabrielmer gabrielmer merged commit a5b1cfd into master Oct 17, 2023
9 of 10 checks passed
@gabrielmer gabrielmer deleted the fix-published-ws-addresses branch October 17, 2023 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: provide a way to define advertised addresses
4 participants