Page MenuHomePhabricator

Overwrite db services with version message results
ClosedPublic

Authored by thonkle on Oct 18 2021, 21:56.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC06a1965066aa: Overwrite db services with version message results
Summary

Seeder dumps incorrect service flags under these circumstances:

  1. When a seed node is provided manually with -overridednsseed
  2. When a seed node address is fetched from other seeders

The service flags may be corrected only if the node is re-rumored via getaddr by some other node. This does not happen for situation 1 above unless the node is public facing.
This patch makes version messages set the service bits correctly.

This is a backport of https://github.com/sipa/bitcoin-seeder/commit/a1e93942842316b60685008f589290d5bdde2058

Test Plan
./bitcoind -daemon
./bitcoin-seeder -host=127.0.0.1 -ns=localhost -mbox=thonkle@protonmail.com -port=5555 -overridednsseed=127.0.0.1
cat dnsseed.dump

Result without patch:

127.0.0.1:8333                                      0   1634593390   12.97%   3.41%   1.15%   0.17%   0.04%  709666  00000000  70016 "/Bitcoin ABC:0.24.3(EB32.0)/"

Result with patch:

127.0.0.1:8333                                      0   1634593493   12.97%   3.41%   1.15%   0.17%   0.04%  709666  00000404  70016 "/Bitcoin ABC:0.24.3(EB32.0)/"

Diff Detail

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

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 18 2021, 21:56
thonkle requested review of this revision.Oct 18 2021, 21:56
Fabien requested changes to this revision.Oct 20 2021, 06:56
Fabien added a subscriber: Fabien.

The code looks correct but the summary is confusing. The seeder works OK, only overriding the service bits from our seeds is delayed by a large amount of time, which makes it difficult to write functional tests for this behavior. Note that this is not limited to manually added seeds.
Can you update the summary to describe more accurately what is the problem this is solving ?

This revision now requires changes to proceed.Oct 20 2021, 06:56
thonkle requested review of this revision.Oct 20 2021, 18:56

When a seed node address is fetched from other seeders

AFAIK these seeds are pulled from a hardcoded list and not fetched from the network. Are you referring to something else ?

When a seed node address is fetched from other seeders

AFAIK these seeds are pulled from a hardcoded list and not fetched from the network. Are you referring to something else ?

seeder inits with GetRandomizedDNSSeeds which uses vSeed list of seeders. Peers are fetched from these seeders.

This revision is now accepted and ready to land.Oct 25 2021, 08:00