HomePhabricator

[seeder] Mark nodes as unreliable until checkpoint verified

Description

[seeder] Mark nodes as unreliable until checkpoint verified

Summary:
This improves on D16465 by waiting for the response to GETHEADERS before considering a node to be reliable.
The GETADDR and GETHEADERS logic is reworked so that the messages are now send independantly of each other (GETADDR is only sent once a day for each node). There is still an issue caused by the fact that if the ADDR message arrives the node is done, and as such it can miss out on the HEADERS and incorrectly mark nodes as bad. This issue is fixed in a separate diff.

Upon first start of a seeder after this commit, all nodes from the existing are considered to have a verified checkpoint (until proven otherwise). This is to avoid clearing the entire db immediately and then have to repopulate it.

This is a partial backport of bchn#1820
https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/1820/diffs?commit_id=4c8604800ba9ea67c61dd8c7c426d260004d853e
https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/1820/diffs?commit_id=878d33146204d87b05697c1ada093013b1ff36ae
https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/1820/diffs?commit_id=02ebf3679f9c1db8e88b966c028656ebc7bd4619
https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/1820/diffs?commit_id=61dca262b3b411a4ec906c838e5587517d7fcc5d
https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/1820/diffs?commit_id=024473ee09dcc9371cd73b51bea74c69a7692949
https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/1820/diffs?commit_id=e702140c2afa957d83351522586a23a6cb73d388

Depends on D16499

Test Plan:
run the seeder before and after this change, confirm that we eventually get only Bitcoin ABC nodes (after waiting for long enough)

ninja bitcoin-seeder check-seeder
src/seeder/bitcoin-seeder -dumpinterval=60

After a very long time:

awk '{ if ($2 == 1) { print } }' dnsseed.dump

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
PiRKAuthored on Oct 14 2024, 09:51
PiRKPushed on Oct 15 2024, 20:08
Reviewer
Restricted Project
Differential Revision
D16500: [seeder] Mark nodes as unreliable until checkpoint verified
Parents
rABC11d9f816adfe: [ecash-lib] Add missing `modules/ecash-lib-wasm` to a few CI tests
Branches
Unknown
Tags
Unknown