Page MenuHomePhabricator

Seeder filters nodes by chainparams
Changes PlannedPublic

Authored by nakihito on Thu, Nov 14, 04:39.

Details

Reviewers
deadalnix
Fabien
jasonbcox
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

Seeder does not currently distiguish between whether or not a node is
following the correct chain or not. This is a step in that direction by
making the seeder filter out nodes that are not following the correct
chain. To do this, this patch allows the seeder to send GETHEADER
messages thereby activating code introduces earlier.

Depends on D4439

Test Plan

Hard code testnet_seeds in seeder/main.cpp to the following: static const std::string testnet_seeds[] = {"localhost", ""};

make check
./bitcoind --printtoconsole --testnet -whitelist=127.0.0.1 -listen=1 -connect=0 -debug=net -datadir=<New data dir>
./bitcoin-seeder -h localhost -n blah.bitframe.org -p 8888 -m info@bitframe.org --testnet -wipeban -wipeignore

The seeder should attempt to connect to the localhost node. The node
should then be banned because its chain is not up to date and it replied
with an empty header message.

./bitcoind --printtoconsole --testnet -whitelist=127.0.0.1 -listen=1 -connect=0 -debug=net
./bitcoin-seeder -h localhost -n blah.bitframe.org -p 8888 -m info@bitframe.org --testnet -wipeban -wipeignore

The seeder should attempt to connect to the localhost node. The node
should reply with a non-empty headers message and then continue to
receive an addr message from the seeder. It should then start
connecting to various other addresses received from the seeder.
Repeat the above for a node that is partially sync'd (but not all the way to the most recent checkpoint).

Diff Detail

Repository
rABC Bitcoin ABC
Branch
SendNewMsgForSeeder
Lint
Lint OK
Unit
No Unit Test Coverage

Event Timeline

nakihito created this revision.Thu, Nov 14, 04:39
Owners added a reviewer: Restricted Owners Package.Thu, Nov 14, 04:39
Herald added a reviewer: Restricted Project. · View Herald TranscriptThu, Nov 14, 04:39
nakihito planned changes to this revision.Thu, Nov 14, 04:40
nakihito requested review of this revision.Thu, Nov 14, 04:42
deadalnix requested changes to this revision.Thu, Nov 14, 14:57

I don't see any filtering going on anywhere is that patch.

src/seeder/bitcoin.cpp
108 ↗(On Diff #14124)

Function is called RequestChainPrams, doesn't request chain params.

114 ↗(On Diff #14124)

You wouldn't have to do this is you actually used the chain params.

121 ↗(On Diff #14124)

What does this do?

This revision now requires changes to proceed.Thu, Nov 14, 14:57
nakihito edited the summary of this revision. (Show Details)Fri, Nov 15, 06:50
nakihito edited the test plan for this revision. (Show Details)Fri, Nov 15, 20:11
nakihito updated this revision to Diff 14157.Fri, Nov 15, 20:16

Updated release notes, rebased, and renamed some functions.

nakihito added inline comments.Fri, Nov 15, 20:32
src/seeder/bitcoin.cpp
121 ↗(On Diff #14124)

This is the time out for the socket connection.

nakihito planned changes to this revision.Mon, Nov 18, 22:49