Page MenuHomePhabricator

Send BIP37 fRelay as false
ClosedPublic

Authored by thonkle on Sep 15 2021, 22:08.

Details

Reviewers
PiRK
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABCd3760663ae61: Send BIP37 fRelay as false
Summary

Backport of https://github.com/sipa/bitcoin-seeder/commit/36bd7f9a0f14b79e889715a05d71be1035f2a96b

This reduces network resource usage of the seeder by opting out of INV messaging from peers.

Relevant clipping from BIP37:

SPV clients that wish to use Bloom filtering would normally set fRelay to false in the version message, then set a filter based on their wallet (or a subset of it, if they are overlapping different peers). Being able to opt-out of inv messages until the filter is set prevents a client being flooded with traffic in the brief window of time between finishing version handshaking and setting the filter.

Source: https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki#extensions-to-existing-messages

Test Plan

Add this line as the first line of CSeederNode::ProcessMessage() in bitcoin.cpp:

tfm::format(std::cout, "RECV %s\n", strCommand);

Without the patch applied, you will see periodic activity from INV messages.
With the patch, you will not see these.

Diff Detail

Event Timeline

Owners added a reviewer: Restricted Owners Package.Sep 15 2021, 22:08
thonkle requested review of this revision.Sep 15 2021, 22:08
This revision is now accepted and ready to land.Sep 16 2021, 09:00
This revision was automatically updated to reflect the committed changes.