HomePhabricator

[addrman] Make addrman consistency checks a runtime option

Description

[addrman] Make addrman consistency checks a runtime option

Summary:

Currently addrman consistency checks are a compile time option, and are not enabled in our CI. It's unlikely anyone is running these consistency checks.
Make them a runtime option instead, where users can enable addrman consistency checks every n operations (similar to mempool tests). Update the addrman unit tests to do internal consistency checks every 100 operations (checking on every operations causes the test runtime to
increase by several seconds).

Completes backport of core#20233:
https://github.com/bitcoin/bitcoin/pull/20233/commits/a4d78546b0858602c60c03fdf8b35ca666ab2e56#diff-259675a17ed61244b5f1f5857285bdab63cc81f41334ed64c74ba623b61cf2a2

Includes a fix to prevent the build from failing on 32 bits platforms.

Depends on D12271.

Test Plan:

ninja all check
ninja bitcoin-fuzzers

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Oct 17 2022, 10:10
FabienPushed on Oct 17 2022, 14:33
Reviewer
Restricted Project
Differential Revision
D12272: [addrman] Make addrman consistency checks a runtime option
Parents
rABC470b579bbb4e: [tests] Make deterministic addrman use nKey = 1
Branches
Unknown
Tags
Unknown