Page MenuHomePhabricator

[backport#15558] Do not query all DNS seed at once
ClosedPublic

Authored by PiRK on Oct 22 2020, 15:18.

Details

Reviewers
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC30f2e10ee7a7: [backport#15558] Do not query all DNS seed at once
Summary

Before this PR, when we don't have enough connections after 11 seconds, we proceed to query all DNS seeds in a fixed order, loading responses from all of them.

Change this to to only query three randomly-selected DNS seed. If 11 seconds later we still don't have enough connections, try again with another one, and so on.

This reduces the amount of information DNS seeds can observe about the requesters by spreading the load over all of them.

This is a backport of Core PR15558

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 22 2020, 15:18
PiRK requested review of this revision.Oct 22 2020, 15:18
src/net.cpp
1682 ↗(On Diff #24952)

Not sure about this one. In some other part of the file we use `config->GetChainParams().DNSSeeds()

jasonbcox requested changes to this revision.Oct 22 2020, 17:38
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/net.cpp
1682 ↗(On Diff #24952)

Please use the config. It helps us get a small step closer to removing global state.

I see a couple other places in this file that could use it as well, but those can go in a separate diff.

This revision now requires changes to proceed.Oct 22 2020, 17:38

use the config to get the DNS seeds

This revision is now accepted and ready to land.Oct 22 2020, 21:17