Conversation
925a9f6 to
ce7a0eb
Compare
oleonardolima
left a comment
There was a problem hiding this comment.
I've tested it a bit with the examples we have in the repository, see the comment above.
The same problem above occurs when trying to use proxy feature to connect via tor to a tcp:// server
Also, I wasn't able to use the proxy via Tor with TLS, still unsure if it's related to mempool.space server though.
As a general comment, we don't have any integration test or CI for the proxy feature (besides the ones in socks module), I think it's a good idea add it in the future.
| run: cargo test -- --ignored test_local_timeout | ||
| - run: cargo check --verbose --features=use-openssl | ||
| - run: cargo check --verbose --no-default-features --features=proxy | ||
| - run: cargo check --verbose --no-default-features --features=minimal |
There was a problem hiding this comment.
nit: it could be addressed in a follow-up, but I think we should take advantage of a matrix strategy here, instead of having each combination written down.
src/lib.rs
Outdated
| all(feature = "proxy", feature = "use-rustls"), | ||
| all(feature = "proxy", feature = "use-rustls-ring") | ||
| ))] | ||
| #[cfg(any(feature = "openssl", feature = "rustls", feature = "rustls-ring"))] |
There was a problem hiding this comment.
I was trying to test the client usage through plaintext (with --no-default-features), but it's not possible due to the way we have these features here.
It wasn't even working on master, though.
There was a problem hiding this comment.
I added a commit c2976cf to address this.
|
@ValuedMammal Are you still looking to move this one forward ? |
51cfd77 to
65cfde0
Compare
|
Sure I can rebase it. If you like I can implement a matrix strategy in CI to check the different feature configurations, and update the |
8f8d863 to
e48f646
Compare
|
I left the test job the same in that the tests are run using |
4110241 to
bd4c0ef
Compare
Before, the `client` module was gated on the `proxy` feature, which caused unnecessary coupling since proxy is only required for the Socks5 client type. This change removes the client module's dependency on the `proxy` feature in favor of more precise feature gating of the Socks5 client type and related functions calling into the `socks` module. Note that `Client` still requires a TLS backend to be enabled by one of `use-openssl`, `use-rustls` or `use-rustls-ring`.
The `default` feature argument is redundant and unclear, as it requires the developer to know which aspects of the default features apply to a particular cfg attribute. This change simplifies feature gating logic by only requiring the features necessary to build with a given feature set.
Introduce simpler feature names `openssl`, `rustls`, and `rustls-ring`. The original `use-` style names are still available for backwards compatibility.
Previously the `client` module required one of `openssl`, `rustls`, or `rustls-ring` to be enabled, which prevented the use of `ClientType::TCP` when `--no-default-features` was set. To fix it, we instead use conditional compilation for `ClientType::SSL` so that `Client` may be used over a plaintext TcpStream. `ClientType::from_config` will now error if the url starts with "ssl://" but none of the SSL-related features are enabled.
Removes conditional compilation of `ElectrumApi::calls_made` so that we always increment `RawClient::calls` after each call made. As a result the `debug-calls` feature flag can be removed.
bd4c0ef to
405311a
Compare
Alright, thanks! I'm going over it right now. |
Description
This PR is meant to streamline the handling of feature flags in the library, in particular by removing the Client's dependency on the
proxyfeature and overall simplifying the feature gating logic. Additionally, we move away from the olduse-*feature naming convention by introducing simpler feature names, remove the unusedminimalfeature, and get rid of conditional compilation fordebug-callswhile retaining the ability to atomically count calls made.fixes #91
fixes #42