Page MenuHomePhabricator

Seeder sends GETHEADERS message
Changes PlannedPublic

Authored by nakihito on May 28 2020, 19:30.

Details

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

Adds trigger for the seeder to request a HEADERS message to get information
about the connected node's chain state using the most recent checkpoint as a
locator hash.

This should not noticibly affect current behavior.

Depends on D6357

Test Plan
src/seeder/bitcoin-seeder -host=localhost -ns=blah.bitframe.org -port=8888 -mbox=info@bitframe.org -wipeban -wipeignore

Verify normal operation

Event Timeline

nakihito created this revision.May 28 2020, 19:30
Owners added a reviewer: Restricted Owners Package.May 28 2020, 19:30
Herald added a reviewer: Restricted Project. · View Herald TranscriptMay 28 2020, 19:30
nakihito requested review of this revision.May 28 2020, 19:30
nakihito planned changes to this revision.
nakihito requested review of this revision.May 29 2020, 01:43
Fabien requested changes to this revision.Jun 1 2020, 07:13
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/seeder/bitcoin.cpp
182 ↗(On Diff #20679)

As far as I can tell this is the only line that differentiate this block from the above one. Please wrap this into a function to avoid copy and paste.

This revision now requires changes to proceed.Jun 1 2020, 07:13
nakihito updated this revision to Diff 20762.Jun 1 2020, 17:36

Added function.

deadalnix requested changes to this revision.Jun 1 2020, 23:03

The trigger for getheaders call doesn't not make a lot of sense.

src/seeder/bitcoin.cpp
104 ↗(On Diff #20762)

This only uses vSend from the object, so that a good tell it doesn't really belong as a member function.

177 ↗(On Diff #20762)

It does not make sense to respond a an addr request by a getheaders request.

This revision now requires changes to proceed.Jun 1 2020, 23:03
nakihito planned changes to this revision.Jun 2 2020, 18:59
nakihito updated this revision to Diff 20969.Jun 5 2020, 22:59

Rebased off D6357. Adjusted trigger for GETHEADERS message to occur with GETADDR.

nakihito planned changes to this revision.Jun 5 2020, 22:59
nakihito updated this revision to Diff 20975.Jun 6 2020, 00:27

Make use of CBlockLocator class.

nakihito planned changes to this revision.Jun 6 2020, 00:27
nakihito requested review of this revision.Jun 6 2020, 00:41
Fabien requested changes to this revision.Mon, Jun 15, 08:50

Clearing my queue for now, this is subject to changes depending on D6357

src/seeder/bitcoin.cpp
9 ↗(On Diff #20975)

You also need to #include <primitives/blockhash.h> and chainparams.h

This revision now requires changes to proceed.Mon, Jun 15, 08:50
nakihito updated this revision to Diff 21612.Mon, Jun 22, 22:55

Added includes for primitives/blockhash.h and chainparams.h.

nakihito planned changes to this revision.Mon, Jun 22, 22:55