HomePhabricator

Reduce spurious messages during headers sync

Description

Reduce spurious messages during headers sync

Summary:
Delay sending SENDHEADERS (BIP 130) message until we know our peer's best
header's chain has more than nMinimumChainWork. This reduces inadvertent
headers messages received during initial headers sync due to block
announcements, which throw off our sync algorithm.

This is a partial backport of core#25717
https://github.com/bitcoin/bitcoin/pull/25717/commits/83c6a0c5249c4ecbd11f7828c84a50fb473faba3

Depends on D15130

Test Plan:
ninja all check-all

Run header sync on mainnet and testnet

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15164

Details

Provenance
Suhas Daftuar <sdaftuar@gmail.com>Authored on Mar 3 2022, 22:40
PiRKCommitted on Jan 16 2024, 08:11
PiRKPushed on Jan 16 2024, 08:11
Reviewer
Restricted Project
Differential Revision
D15164: Reduce spurious messages during headers sync
Parents
rABC5c9b2424f7bd: Require callers of AcceptBlockHeader() to perform anti-dos checks
Branches
Unknown
Tags
Unknown