init, test: improve network reachability test coverage and safety#24205
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
vasild
left a comment
There was a problem hiding this comment.
ACK d1d04469a96d15b4d0a30881cbe6760d916e0762
|
Note, this pull has a trivial one-line test conflict with #22834 that IMO should be reviewed/merged first so this pull doesn't invalidate the review there. |
The default network reachability values are implicitly set
by this line in net.cpp:
static bool vfLimited[NET_MAX] GUARDED_BY(g_maplocalhost_mutex) = {};
This commit asserts that each network is reachable during
the first loop through them during bitcoind init.
d1d0446 to
2dc734f
Compare
|
Rebased following the merge of #22834 and added further test coverage and doc follow-ups to that pull. |
2dc734f to
58a1479
Compare
…ated tor/i2p documentation a1db99a init, doc: improve -onlynet help and tor/i2p documentation (Jon Atack) Pull request description: including review feedback from bitcoin/bitcoin#22834 (comment) and bitcoin/bitcoin#24205 (comment) concerning `src/init.cpp`, `doc/tor.md` and `doc/i2p.md` - s/outgoing/automatic outbound/ - s/Incoming/Inbound and manual/ (are not affected by this option.) - s/only through network/only to network/ - s/this option. This option/this option. It/ - s/network types/networks/ and pick up a few nits in `doc/p2p-bad-ports.md` from bitcoin/bitcoin#23542 (review). ACKs for top commit: laanwj: ACK a1db99a w0xlt: ACK a1db99a theStack: ACK a1db99a Tree-SHA512: dd727904b9b3dadb16053e2b0350e6c0814ef68fb0cca7d34880b883123cfe3aa03b15813b40a863f6367d596d17ee4517eab55281cfe35cd00767b8a39593ca
…/i2p documentation a1db99a init, doc: improve -onlynet help and tor/i2p documentation (Jon Atack) Pull request description: including review feedback from bitcoin#22834 (comment) and bitcoin#24205 (comment) concerning `src/init.cpp`, `doc/tor.md` and `doc/i2p.md` - s/outgoing/automatic outbound/ - s/Incoming/Inbound and manual/ (are not affected by this option.) - s/only through network/only to network/ - s/this option. This option/this option. It/ - s/network types/networks/ and pick up a few nits in `doc/p2p-bad-ports.md` from bitcoin#23542 (review). ACKs for top commit: laanwj: ACK a1db99a w0xlt: ACK a1db99a theStack: ACK a1db99a Tree-SHA512: dd727904b9b3dadb16053e2b0350e6c0814ef68fb0cca7d34880b883123cfe3aa03b15813b40a863f6367d596d17ee4517eab55281cfe35cd00767b8a39593ca
brunoerg
left a comment
There was a problem hiding this comment.
|
I think this has been ready for a few weeks now, if anyone would like to do a final review or merge. |
dongcarl
left a comment
There was a problem hiding this comment.
Code Review ACK 58a1479
Change seems straightforward. Had to convince myself of the assert in src/init.cpp, but it seems right that we don't want users to specify -onlynet=foo and foo be somehow default disabled, and now bitcoind is silently operating without foo.
|
Post-merge ACK 58a1479 Built on MacOS Big Sur, reviewed code changes and checked the functional test was covering the errors in the PR description. |
…verage and safety 58a1479 test: passing -onlynet=onion with -onion=0/-noonion raises expected init error (Jon Atack) 7000f66 test: passing -onlynet=onion without -proxy/-onion raises expected init error (Jon Atack) 8332e6e test: passing invalid -onion raises expected init error (Jon Atack) d5edb08 test: passing invalid -proxy raises expected init error (Jon Atack) bd57dcb test: hoist proxy out of 2 network loops in feature_proxy.py (Jon Atack) afdf2de test: add CJDNS to LimitedAndReachable_Network unit tests (Jon Atack) 2b7a818 net, init: assert each network reachability is true by default (Jon Atack) Pull request description: Adds missing network reachability test coverage and an assertion during init, noticed while reviewing bitcoin#22834: - assert during init that each network reachability is true by default - add CJDNS to the `LimitedAndReachable_Network` unit tests - hoist proxy out of two network loops in feature_proxy.py - test that passing invalid `-proxy` raises expected init error - test that passing invalid `-onion` raises expected init error - test that passing `-onlynet=onion` without `-proxy` and `-onion` raises expected init error - test that passing `-onlynet=onion` with `-onion=0` and with `-noonion` raises expected init error ACKs for top commit: vasild: ACK 58a1479 brunoerg: ACK 58a1479 dongcarl: Code Review ACK 58a1479 Tree-SHA512: bdee6dd0c12bb63591ce7c9321fe77b509ab1265123054e774adc38a187746dddafe1627cbe89e990bcc78b45e194bfef8dc782710d5b217e2e2106ab0158827
Adds missing network reachability test coverage and an assertion during init, noticed while reviewing #22834:
LimitedAndReachable_Networkunit tests-proxyraises expected init error-onionraises expected init error-onlynet=onionwithout-proxyand-onionraises expected init error-onlynet=onionwith-onion=0and with-noonionraises expected init error