HomePhabricator

[seeder] Fix such that seeder node awaits both headers and addr messages

Description

[seeder] Fix such that seeder node awaits both headers and addr messages

Summary:
The current code assumes that if the ADDR message arrives, the node
is done. As such, it can miss out on the HEADERS message and incorrectly
mark nodes as bad.

This commit fixes the situation by making it that the node must both
receive ADDR messages *and* HEADERS messages to be satisfied.

Note that in some cases it won't be expecting ADDR messages (if
calling code didn't supply a vAddr pointer), and so in that case it will
just await a HEADERS reply iff we have a checkpoint.

With this commit, the seeder header verification facility should be working
now as expected.

Note that we had to update the unit tests to work ok with the logic
changes.

This is a partial backport of bchn#1820
https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/1820/diffs?commit_id=4f544286f0e2092e0eb466708784f041d5462645

Depends on D16500

Test Plan: TBD (we need to run the seeder for a very long time or else tweak some code to make the node acceptation logic faster)

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
PiRKAuthored on Oct 14 2024, 18:40
PiRKPushed on Oct 15 2024, 20:08
Reviewer
Restricted Project
Differential Revision
D16908: [seeder] Fix such that seeder node awaits both headers and addr messages
Parents
rABCdf673a6df8aa: [seeder] Mark nodes as unreliable until checkpoint verified
Branches
Unknown
Tags
Unknown