Skip to content

Conversation

@Davidson-Souza
Copy link
Member

What is the purpose of this pull request?

  • Bug fix
  • Documentation update
  • New feature
  • Test
  • Other: Improve dns seeds code

Which crates are being modified?

  • floresta-chain
  • floresta-cli
  • floresta-common
  • floresta-compact-filters
  • floresta-electrum
  • floresta-watch-only
  • floresta-wire
  • floresta
  • florestad
  • Other: .

Description

Depends on #454

The current code for dns seeds is very frustrating: it asks for
addresses even when we don't need, it takes a while to return (holding
the node meanwhile), can't be disabled.

This commit reworks that to fix those problems. The dns seed code now
only runs after we've been more than one minute and we haven't seen at
least one connection. It runs on the background and notifies the node
back one it's finished.

I've also added an option to disable the dns
seeds. This could be useful for privacy reasons (don't want to leak to
my dns provider that I use bitcoin).

Checklist

  • I've signed all my commits
  • I ran just lint
  • I ran cargo test
  • I've checked the integration tests
  • I've followed the contribution guidelines
  • I'm linking the issue being fixed by this PR (if any)

@Davidson-Souza Davidson-Souza added enhancement New feature or request chore Cleaning, refactoring, reducing complexity code quality Generally improves code readability and maintainability labels Apr 28, 2025
@Davidson-Souza Davidson-Souza added this to the v0.8.0 milestone Apr 29, 2025
@Davidson-Souza Davidson-Souza marked this pull request as ready for review April 30, 2025 18:14
@Davidson-Souza
Copy link
Member Author

Rebased with master after #454. Marking as ready for review.

@JoseSK999
Copy link
Contributor

I've also added an option to disable the dns
seeds. This could be useful for privacy reasons (don't want to leak to
my dns provider that I use bitcoin).

Yeah currently we always use the OS DNS resolver (via the dns-lookup crate). Another solution would be to route the DNS lookup through a proxy (if specified, ideally the Tor proxy). I have done a simple implementation for that.

Copy link
Collaborator

@jaoleal jaoleal left a comment

Choose a reason for hiding this comment

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

C ack e49681f

@Davidson-Souza
Copy link
Member Author

Updated with @jaoleal's comments

@jaoleal
Copy link
Collaborator

jaoleal commented May 2, 2025

ack 1bdde83

Copy link
Contributor

@JoseSK999 JoseSK999 left a comment

Choose a reason for hiding this comment

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

Nice! Only a couple of nits

@Davidson-Souza
Copy link
Member Author

Updated with @JoseSK999's comments.

The current code for dns seeds is very frustrating: it asks for
addresses even when we don't need, it takes a while to return (holding
the node meanwhile), can't be disabled.

This commit reworks that to fix those problems. The dns seed code now
only runs after we've been more than one minute and we haven't seen at
least one connection. It runs on the background and notifies the node
back one it's finished.

I've also added an option to disable the dns
seeds. This could be useful for privacy reasons (don't want to leak to
my dns provider that I use bitcoin).
Copy link
Contributor

@JoseSK999 JoseSK999 left a comment

Choose a reason for hiding this comment

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

ACK 9264e5c

@Davidson-Souza Davidson-Souza merged commit 015e669 into vinteumorg:master May 4, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Cleaning, refactoring, reducing complexity code quality Generally improves code readability and maintainability enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants