-
Notifications
You must be signed in to change notification settings - Fork 36.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init: abort if i2p/cjdns are chosen via -onlynet but are unreachable #25989
Conversation
Concept ACK |
It's mentioned in the i2p doc that
Is this commit related to first change in any way? |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK b3576b7
@@ -332,6 +332,16 @@ def networks_dict(d): | |||
msg = "Error: Invalid -i2psam address or hostname: 'def:xyz'" | |||
self.nodes[1].assert_start_raises_init_error(expected_msg=msg) | |||
|
|||
self.log.info("Test passing invalid -onlynet=i2p without -i2psam raises expected init error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "invalid" looks unnecessary here and below:
self.log.info("Test passing invalid -onlynet=i2p without -i2psam raises expected init error") | |
self.log.info("Test passing -onlynet=i2p without -i2psam raises expected init error") |
This approach is ok for me. But I slightly prefer a warning and it could set up |
Not directly, it's a small and imo uncontroversial improvement to addpeeraddrress, which also deals with cjdns (and which might help to manually add cjdns peers to addrman if we can't find any, even if it's currently debug-only), so I thought might make sense to include here. If preferred, I could drop it.
I chose an error because of the existing behavior with
I think that soft-setting |
You're right. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set -onlynet=cjdns -onlynet=ipv6
, it shouldn't fail IMO. Maybe a warning.
Requesting In particular, that means:
regardless of whether additional |
...because -i2psam or -cjdnsreachable are not provided. This mimics existing behavior for -onlynet=onion and non-specified proxy.
This allows us to add cjdns addresses to addrman for testing and debug purposes (if -cjdnsreachable is true)
b3576b7
to
68209a7
Compare
@fanquake: I don't see a strong need to push this last-minute in 24.0, at least it shouldn't delay anything. In contrast to #24991 which fixed a bug (users with a reasonable configuration would get an InitError at startup) this is just a nice-to-have (users who don't read the docs and choose an unreasonable configuration will get an InitError now instead of getting no peers from that network). |
@mzumsande I've added the milestone as a nice-to-fix for 24.x, and this should be simple to backport. This wont be blocking branch-off. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 68209a7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 68209a7
fun fact: passing -onlynet=i2p
takes a lot longer to error than passing -onlynet=cjdns
because we load the chainstate (and other chain related data structures) before the i2p checks but after the cjdns checks. Not sure if that is worth a refactor (in a follow up) but in my opinion there is really no reason to have the chainstate loaded before doing all networking checks.
...because -i2psam or -cjdnsreachable are not provided. This mimics existing behavior for -onlynet=onion and non-specified proxy. GitHub-Pull: bitcoin#25989 Rebased-From: a8a9ed6
This allows us to add cjdns addresses to addrman for testing and debug purposes (if -cjdnsreachable is true) GitHub-Pull: bitcoin#25989 Rebased-From: 68209a7
… but are unreachable 68209a7 rpc: make addpeeraddress work with cjdns addresses (Martin Zumsande) a8a9ed6 init: Abort if i2p/cjdns are chosen via -onlynet but unreachable (Martin Zumsande) Pull request description: Identical commit from #25989 ACKs for top commit: fanquake: ACK 68209a7 Tree-SHA512: eec335df06b4c209cfe3473cb623828effd00c45a5dd605bb920edd265de1c789627482b005a51e89b8fc79cc4c5d26ff1fc306f2e4573897c5c7f083aa22861
… but are unreachable 68209a7 rpc: make addpeeraddress work with cjdns addresses (Martin Zumsande) a8a9ed6 init: Abort if i2p/cjdns are chosen via -onlynet but unreachable (Martin Zumsande) Pull request description: If the networks i2p / cjdns are chosen via `-onlynet` but the user forgot to provide `-i2psam` / `-cjdnsreachable`, no outbound connections will be made - it would be nice to inform the user about that. The solution proposed here mimics existing behavior for `-onlynet=onion` and non-specified `-onion`/`-proxy` where we already abort with an InitError - if reviewers would prefer to just print a warning, please say so. The second commit adds CJDNS support to the debug-only `addpeeraddress` RPC allowing to add CJDNS addresses to addrman for testing and debug purposes. (if `-cjdnsreachable=1`) This is the result of an [IRC discussion](https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2022-09-01#848066;) with vasild. ACKs for top commit: vasild: ACK 68209a7 dergoegge: ACK 68209a7 Tree-SHA512: 6db9787f01820190f14f90a0b39e4206603421eb7521f792879094d8bbf4d4d0bfd70665eadcc40994ac7941a15ab5a8d65c4779fba5634c0e6fa66eb0972b8d
If the networks i2p / cjdns are chosen via
-onlynet
but the user forgot to provide-i2psam
/-cjdnsreachable
, no outbound connections will be made - it would be nice to inform the user about that.The solution proposed here mimics existing behavior for
-onlynet=onion
and non-specified-onion
/-proxy
where we already abort with an InitError - if reviewers would prefer to just print a warning, please say so.The second commit adds CJDNS support to the debug-only
addpeeraddress
RPC allowing to add CJDNS addresses to addrman for testing and debug purposes. (if-cjdnsreachable=1
)This is the result of an IRC discussion with vasild.