Page MenuHomePhabricator

Seeder: handle empty HEADERS messages more gracefully
ClosedPublic

Authored by PiRK on Jul 15 2024, 16:20.

Details

Reviewers
roqqit
Group Reviewers
Restricted Project
Commits
rABC1fac2f8fc7f7: 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.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable