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: making dns discovery async #3175

Merged
merged 13 commits into from
Dec 3, 2024
Merged

Conversation

gabrielmer
Copy link
Contributor

@gabrielmer gabrielmer commented Nov 10, 2024

Description

Instead of exiting if DNS Discovery fails at startup, we now create a loop that attempts to perform DNS Discovery every 30 seconds until it succeeds.

Changes

  • making bootstrap node retrieval procs async
  • introduce a DNS retry loop in wakunode2
  • updating nim-dnsdisc submodule

How to test

Run wakunode2 configuring discv5 and dns-discovery with the internet connection off, then turn it on after some time and see that DNS Discovery is performed and Discv5 finds peers

Issue

#3076

@gabrielmer gabrielmer self-assigned this Nov 10, 2024
Copy link

github-actions bot commented Nov 26, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3175

Built from a5588af

Copy link
Contributor

@darshankabariya darshankabariya left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM !

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.

LGTM! Thanks for it! 💯
I just added a nitpick comment

@@ -400,3 +439,6 @@ proc stop*(waku: Waku): Future[void] {.async: (raises: [Exception]).} =

if not waku.node.isNil():
await waku.node.stop()

if waku.dnsRetryLoopHandle.isSome():
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it could be a little bit simpler by just checking if dnsRetryLoopHandle is not nil. I'd suggest to avoid using Option as much as possible but is just a personal nitpick, not a big difference though ;P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Superr. good point! Updated it - I agree that it's nicer and simpler without the Option :)

Thank you!

Copy link
Member

@richard-ramos richard-ramos left a comment

Choose a reason for hiding this comment

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

LGTM!
The only observation i have is that in status-go it is possible to specify more than one enrtree. We don't use that tho since we have a single one, but i thought that it would be a good idea to mention it.
Good work, sir!

@gabrielmer gabrielmer merged commit d7d00bf into master Dec 3, 2024
10 of 11 checks passed
@gabrielmer gabrielmer deleted the feat-dns-discovery-backoff branch December 3, 2024 13:39
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.

4 participants