-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Validate ignored peers and BTC nodes #3895
Validate ignored peers and BTC nodes #3895
Conversation
This will allow for a custom validation error message to be defined, particularly useful for providing a user-friendly message for regex validation.
Ignored peers and BTC nodes input fields will now only accept IPv4 and V2 onion addresses, with multiple addresses separated using a comma.
The shutdown popup was appearing when the BTC nodes input field lost focus regardless if the input had changed or not.
If the user entered an invalid hostname for a custom BTC node, such as a V3 onion address, after restarting Bisq they would be presented with an error due to the node being unreachable and unable to continue nor correct the config. So now a warning message will be shown in this situation informing the user of an invalid config and once they restart their client they will connect to the provided BTC nodes. Fixes bisq-network#3137
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
It's good bisq can start to allow reconfig of btc nodes without it automatically connecting to the default nodes.
@devinbileck it seems your new input validation is too strict, totally valid FQDNs like |
assertFalse(regexValidator.validate("onion:9999,abcdefghijklmnop.onion:9999").isValid); | ||
assertFalse(regexValidator.validate("abcdefghijklmnop.onion:").isValid); | ||
assertFalse(regexValidator.validate("32zzibxmqi2ybxpqyggwwuwz7a3lbvtzoloti7cxoevyvijexvgsfeid.onion:8333").isValid); | ||
|
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.
assertTrue(regexValidator.validate("example.com").isValid); |
@@ -1107,4 +1108,14 @@ public static MaterialDesignIcon getIconForSignState(AccountAgeWitnessService.Si | |||
state.equals(AccountAgeWitnessService.SignState.PEER_SIGNER)) ? | |||
MaterialDesignIcon.APPROVAL : MaterialDesignIcon.ALERT_CIRCLE_OUTLINE; | |||
} | |||
|
|||
public static RegexValidator addressRegexValidator() { | |||
RegexValidator regexValidator = new RegexValidator(); |
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.
Missing the regex to validate example.com
here?
Also need to handle IPv6 addresses, i.e. |
Thanks. I will submit a PR shortly. |
The original implementation of bisq-network#3895 did not validate IPv6 nor FQDN addresses.
The original implementation of bisq-network#3895 did not validate IPv6 nor FQDN addresses.
The original implementation of #3895 did not validate IPv6 nor FQDN addresses.
In addition to adding input validation for ignored peers and BTC nodes, this PR also fixes #3137.
Since with input validation the user is no longer able to enter an invalid BTC host, to verify #3137 start the app with the following option:
--btcNodes=32zzibxmqi2ybxpqyggwwuwz7a3lbvtzoloti7cxoevyvijexvgsfeid.onion:8333
You will be presented with the following:
After shutting down the app, restart it without the previous option and observe the BTC config. You will see the invalid custom BTC config but it will be using the provided BTC nodes.