HomePhabricator

Seeder: handle empty HEADERS messages more gracefully

Description

Seeder: handle empty HEADERS messages more gracefully

Summary:
D16465 assumed that a HEADERS message always has at least one header. This is no longer true at least since D14913, as empty header messages can be used to signal that our headers chain does not have enough chain work yet to be trusted.
Handle this case more explicitely, instead of relying on the deserialization error to be caught in ThreadCrawler. This changes behavior slightly as now a node with not enough chainwork might be considered reliable when previously it was marked as bad the same way as nodes sending malformed net messages.

Test Plan:
ninja check-seeder

Run the seeder for a while, see that we have the usual number of nodes connected.

Reviewers: #bitcoin_abc, roqqit

Reviewed By: roqqit

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

Details

Provenance
PiRKAuthored on Jul 15 2024, 16:13
PiRKPushed on Jul 16 2024, 06:02
Reviewer
roqqit
Differential Revision
D16467: Seeder: handle empty HEADERS messages more gracefully
Parents
rABC74baf6484f44: Seeder: Verify that nodes are on the correct chain
Branches
Unknown
Tags
Unknown