Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Coding Enthusiast on May 02, 2021, 07:31:09 AM



Title: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: Coding Enthusiast on May 02, 2021, 07:31:09 AM
Considering the fact that nodes mainly dig DNS seeds when they start for the first time why are they returning pruned nodes (NodeNetworkLimited)?
Right now almost all IP addresses returned from DNS seeds are pruned nodes which has made downloading blocks impossible for me.

Another issue I noticed is that some of the addresses they return are not useful at all (I either get timeouts or the connection is refused or there isn't any node at all to connect to).
For example the following list is a handful of invalid IP addresses that seed.bitcoin.sipa.be returns:
Code:
95.116.33.86
15.185.229.194
34.101.110.211
68.104.65.149
52.78.217.89
34.86.209.19


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: gmaxwell on May 02, 2021, 08:21:33 AM
You can request which service flags you want from the seeds.

Pruned nodes do serve blocks-- though only ones near the tip.  (and if you need peers that can serve older blocks ... then ask for those.)

As far as the nodes that you couldn't reach-- they may have gone down recently.  The seeder checks them but only about once a day or so.


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: Coding Enthusiast on May 02, 2021, 09:09:09 AM
You can request which service flags you want from the seeds.
Could you please elaborate?


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: ranochigo on May 02, 2021, 12:29:53 PM
Could you please elaborate?
A nifty way to do so is to (prepend) the desired strings[1] as a subdomain to query. For example, nslookup x9.dnsseed.bluematt.me.

This will work if the DNS seeder supports service bits filtering[2].


[1] https://github.com/sipa/bitcoin-seeder/blob/a09d2870d1b7f4dd3c1753bbf4fd0bc3690b7ef9/main.cpp#L165
[2] https://github.com/bitcoin/bitcoin/blob/7cb0bcb6811070786937fb5cc0af82cf4ef21ff0/src/chainparams.cpp#L121


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: Coding Enthusiast on May 02, 2021, 12:55:26 PM
Could you please elaborate?
A nifty way to do so is to append the desired strings[1] as a subdomain to query. For example, nslookup x9.dnsseed.bluematt.me.

This will work if the DNS seeder supports service bits filtering[2].


[1] https://github.com/sipa/bitcoin-seeder/blob/a09d2870d1b7f4dd3c1753bbf4fd0bc3690b7ef9/main.cpp#L165
[2] https://github.com/bitcoin/bitcoin/blob/7cb0bcb6811070786937fb5cc0af82cf4ef21ff0/src/chainparams.cpp#L121
Thanks for the info, it is useful. But unfortunately this seems to return nodes that have these flags not nodes that have only these flags which means it still returns a node with NODE_NETWORK_LIMITED flag if it has the specified flag too.


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: ranochigo on May 02, 2021, 01:19:09 PM
Thanks for the info, it is useful. But unfortunately this seems to return nodes that have these flags not nodes that have only these flags which means it still returns a node with NODE_NETWORK_LIMITED flag if it has the specified flag too.
Yeah I get what you mean. But the NODE_NETWORK_LIMITED doesn't mean that the node is pruned. My node, which has the entire blockchain on disk also signals NODE_NETWORK_LIMITED with 1033 flag, 1024 for being able to serve last 288 blocks, 8 for NODE_WITNESS and 1 for NODE_NETWORK.

So, for a full node with the entire blockchain, it should not only signal NODE_NETWORK_LIMITED but also NODE_NETWORK.


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: gmaxwell on May 02, 2021, 05:21:22 PM
Thanks for the info, it is useful. But unfortunately this seems to return nodes that have these flags not nodes that have only these flags which means it still returns a node with NODE_NETWORK_LIMITED flag if it has the specified flag too.
Fair point.

Though I also should have mentioned, you shouldn't sync from just the DNSseed results, you should learn addresses from them.   Syncing just from them results in more uneven distributions of load.  Bitcoin Core works pretty hard to not contact dnsseeds at all and usually only does on first run or after being offline for a long time.


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: TangentC on May 02, 2021, 05:32:51 PM
[Start Rant]
Pruned Nodes have got to have been one of the lamest designs of all time.

By not requiring all nodes to maintain a full blockchain, this opens the potential that one day the full blockchain may be lost.
This in a coin, where blocksize is already limited to make sure more nodes are available.

Pruned Nodes were the dumbest invention in the Crypto World.

[End Rant]


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: odolvlobo on May 02, 2021, 05:48:47 PM
By not requiring all nodes to maintain a full blockchain, this opens the potential that one day the full blockchain may be lost.

You can't require nodes to do anything, and as long as your node holds the full block chain, it will never be lost.


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: ranochigo on May 02, 2021, 10:39:17 PM
[Start Rant]
Pruned Nodes have got to have been one of the lamest designs of all time.

By not requiring all nodes to maintain a full blockchain, this opens the potential that one day the full blockchain may be lost.
Pruned nodes are meant for those users who wants to run Bitcoin Core but cannot keep up with the storage requirements. It is not a substitute for archival nodes because they're different in certain aspects.

IMO, even if you don't allow people to use pruning, then they would simply not run a node at all. Eitherways, those running pruned nodes are still a net benefit to Bitcoin. As long as people are aware of the utility and differences between the both of them, there is really no problem about this. Some will continue running full archival nodes and the rest that can't will simply run a pruned full node.

...
But I think this is a better as an entirely separate topic instead of continuing it on this thread.


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: Coding Enthusiast on May 03, 2021, 01:54:04 AM
Though I also should have mentioned, you shouldn't sync from just the DNSseed results, you should learn addresses from them.   Syncing just from them results in more uneven distributions of load.  Bitcoin Core works pretty hard to not contact dnsseeds at all and usually only does on first run or after being offline for a long time.
That's what I was doing, but my list was old since I hadn't worked on it for over a month and I was checking 200+ IPs with a socket that has a 30 second connection timeout. So I had to do a manual reset and fall back to DNS seeds.
Plus for some reason the couple of nodes (from DNS) seed I connected to didn't reply to my GetAddr message.


Title: Re: Shouldn't DNS seeds avoid returning pruned nodes?
Post by: NotATether on May 03, 2021, 09:12:16 AM
Even if most NodeNetworkLimited nodes were pruned nodes, wouldn't it not make much difference whether DNS seeds return NodeNetworkLimited nodes or x1/x9 nodes since all those peers eventually go into a bucket where some are randomly selected to fetch their own non-pruned peer lists?