-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Add support for dnsseeds with option to filter by servicebits #8083
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
Conversation
|
Concept ACK, but I think it'd be simpler to have this be based on a bitmask rather than service-specific letters. |
|
Yes. Agreed. Will change it to a bitmask. Maybe a hex representation of the uint64_t as subdomain. |
|
Do we actually connect to DNS Seeds, or is it only for Tor where we connect to them, get a list of addresses, and then immediately disonnect? |
|
When on Tor, we connect to one of the seed's results directly, and ask it
for getaddr. This does not need filtering.
When not on Tor, we read in the list of IPs returned by the seed, and add
it to addrman, without any TCP involved.
|
2b043f6 to
6f9bbd5
Compare
|
Updated this PR and sipa/bitcoin-seeder#36 to support non-bitflags-to-string mapping. Example: A bar main domain query will still result with the default NODE_NETWORK filter: |
|
RBF nodes! Something I noticed was you could also query |
|
RFC 952 did not permit hostnames to begin with a number. This has since been relaxed but many implementations still manage to screw this up (treating the names that begin with numbers as IP addresses), it might be better to begin the mask with a x, and also require it to be zero extended so that caching isn't degraded by clients using x00000005 vs x5. |
|
Can one of the admins verify this patch? |
6f9bbd5 to
fa427b6
Compare
|
@gmaxwell: Good point. leading zeros will be ignored: |
|
@jonasschnelli Better to not allow multiple encodings for the same request,
as that may interfere with caching (see @gmaxwell's comment).
|
|
@sipa: Good point. |
|
How will you pass in the required flags to addrman? I was imagining something simpler here, where a DNSSeedData struct just has a hostname and a servicebits value. For hosts where it is supported, we use ("x9.seeder.host.tld", 9), for others we use ("seeder.host.tld", 1). |
fa427b6 to
2d83013
Compare
|
@sipa: Right. The code is currently pretty much unused. However, this will be required for SW and I though instead of extending the SW PR, try to get this into master because it can be useful anyways. This also adds a testnet seed (last weekend only one testnet seed was running). |
|
utACK 2d83013
I think there's something (for consistency / future-proofness) to be said for always using filtering when the seed supports this, even to just request NODE_NETWORK, instead of relying on a default being the same server-side. Though this would remove the flexibility for the DNS seed operator to change the default and have everyone use that by default, if that turns out to be necessary - which has been discussed in the context of segwit. So I'm not sure. |
|
What is there to be done here? |
|
utACK 2d83013 |
…ebits 2d83013 Add support for dnsseeds with option to filter by servicebits (Jonas Schnelli)
… servicebits 2d83013 Add support for dnsseeds with option to filter by servicebits (Jonas Schnelli)
… servicebits 2d83013 Add support for dnsseeds with option to filter by servicebits (Jonas Schnelli)
…servicebits 9a364e1 Add support for dnsseeds with option to filter by servicebits (Jonas Schnelli) Pull request description: Backport of bitcoin#8083 This adds the ability to filter DNS seed requests by service bit, but does not actually implement any filtering other than the default `NODE_NETWORK` (for now). Further related upstream backports will follow. ACKs for top commit: random-zebra: ACK 9a364e1 furszy: ACK 9a364e1 Tree-SHA512: cc95d042a8144e31a10e58ed02460cfb2d1801f91c4f988b3e3ae5a5bdf2537c1ffc7ea3c736dabd998d369761bef54863b8aa1e27ad8bdf8ece72f121a1ca31
…o filter by servicebits 9a364e1 Add support for dnsseeds with option to filter by servicebits (Jonas Schnelli) Pull request description: Backport of bitcoin#8083 This adds the ability to filter DNS seed requests by service bit, but does not actually implement any filtering other than the default `NODE_NETWORK` (for now). Further related upstream backports will follow. ACKs for top commit: random-zebra: ACK 9a364e1 furszy: ACK 9a364e1 Tree-SHA512: cc95d042a8144e31a10e58ed02460cfb2d1801f91c4f988b3e3ae5a5bdf2537c1ffc7ea3c736dabd998d369761bef54863b8aa1e27ad8bdf8ece72f121a1ca31
Opposite part of sipa/bitcoin-seeder#36.
Including new testnet seed that supports filtering.
Required for SW #7910.