HomePhabricator

Respond to getheaders if we have sufficient chainwork

Description

Respond to getheaders if we have sufficient chainwork

Summary:
Previously, we would check to see if we were in IBD and ignore getheaders
requests accordingly. However, the IBD criteria -- an optimization mostly
targeted at behavior when we have peers serving us many blocks we need to
download -- is difficult to reason about in edge-case scenarios, such as if the
network were to go a long time without any blocks found and nodes getting
restarted during that time.

To make things simpler to reason about, just use nMinimumChainWork as our
anti-DoS threshold; as long as our chain has that much work, it should be fine
to respond to a peer asking for our headers (and this should allow such a peer
to request blocks from us if needed).

This is a backport of core#24178

Test Plan:
ninja all check-all

Run an IBD

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Suhas Daftuar <sdaftuar@gmail.com>Authored on Jan 26 2022, 23:29
PiRKCommitted on Dec 2 2023, 10:01
PiRKPushed on Dec 2 2023, 10:01
Reviewer
Restricted Project
Differential Revision
D14882: Respond to getheaders if we have sufficient chainwork
Parents
rABC90dc50de1e1f: [Cashtab][Alias] Open the pending aliases dropdown by default
Branches
Unknown
Tags
Unknown