-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: add new AsyncAnonymizedClient
using arti-hyper
#67
base: master
Are you sure you want to change the base?
feat: add new AsyncAnonymizedClient
using arti-hyper
#67
Conversation
86103c8
to
9eef99f
Compare
Please rebase to pick up changes in #69 that fix CI. |
d6e6b42
to
53c089b
Compare
AsyncAnonymizedClient
using arti-hyper
AsyncAnonymizedClient
using arti-hyper
Most of the implementation is done, and it currently works on rust 1.70, also good to review and get inputs from it's being done. But it does not work with our current MSRV, how do you usually go forward? just pin some of the dependencies? |
73db1cd
to
fd945b0
Compare
85532de
to
f2707e4
Compare
48799f5
to
0b196d1
Compare
@oleonardolima can your rebase and rework this now that #75 is merged? hopefully not too big a change. |
0b196d1
to
0659252
Compare
WalkthroughThis update introduces Tor support to the Changes
Assessment against linked issues
This assessment concludes that the primary objectives have been largely met, with potential ambiguity regarding the strategic planning for future transport layer integrations. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
0659252
to
b9b0c1b
Compare
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.
Review Status
Actionable comments generated: 3
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
Cargo.toml
is excluded by:!**/*.toml
Files selected for processing (3)
- .github/workflows/cont_integration.yml (2 hunks)
- src/async.rs (10 hunks)
- src/lib.rs (26 hunks)
Files skipped from review as they are similar to previous changes (2)
- .github/workflows/cont_integration.yml
- src/async.rs
Additional comments: 3
src/lib.rs (3)
- 80-85: The new feature flags
async-arti-hyper
,async-arti-hyper-native
, andasync-arti-hyper-rustls
are correctly introduced to enable the anonymized async client and its variations. This approach allows for flexible configuration and usage based on the user's needs and environment.- 99-108: The conditional compilation logic for the
r#async
module and the exposure ofAsyncAnonymizedClient
based on theasync-arti-hyper
feature is correctly implemented. This ensures that the anonymized async client is only available when the corresponding feature flag is enabled, maintaining modularity and feature flag consistency.- 195-212: The introduction of new error types specific to the anonymized async client (
Hyper
,InvalidUri
,InvalidBody
,ArtiClient
,TlsConnector
,ResponseDecoding
) enhances error handling and provides more granular feedback to the users. It's crucial to ensure that these errors are adequately documented and that their handling is consistent across the client's usage.
b9b0c1b
to
e1893fa
Compare
- rename the workflow from Rust to CI - add name to build-test step of Build & Test
- adds two new jobs for `fmt` and `clippy`. - use `dtolnay/rust-toolchain@v1` instead of `actions-rs/toolchain@v1`
- bumps the `edition` on `Cargo.toml` to `2021. - add `.clippy.toml` with `msrv=1.63.0` file.
- apply some standard on `Cargo.toml` deps. - minor docstring improvements, and fix missing docstrings.
- remove duplicated HTTP client code for handling GET and POST requests. - adds a few new methods to `AsyncClient` implementation, the new methods are responsible to handle common HTTP requests and parsing. It was previously duplicated throughout the Esplora API implementation, but now it follows the same approach already implemented for blocking client (`BlockingClient`).
f3360c0
to
75e32db
Compare
1a4d5cf chore(rust+clippy): bump `edition` to 2021, and add `.clippy.toml` (Leonardo Lima) b7636e8 fix(fmt): apply suggested fixes from `rustfmt` (Leonardo Lima) 3f2ca2f refactor(ci)!: add new `fmt` and `clippy` jobs (Leonardo Lima) 9f888c1 chore(deps): bump `actions/checkout` from v3 to v4 (Leonardo Lima) Pull request description: <!-- You can erase any parts of this template not applicable to your Pull Request. --> ### Description This PR does some improvements on CI, these are some changes that I ended up doing on other refactoring and feature PRs (making them too convoluted), but had a specific CI scope so I'm moving them to a specific PR. This PR does: - bump the `actions/checkout@v3` to `actions/checkout@v4`. - adds two new jobs for `fmt` and `clippy` (clippy has been moved to a specific job). - fix the newly found `fmt` problems. - bump the rust edition to `2021`. - adds `.clippy.toml` file with `msrv=1.63.0`. <!-- Describe the purpose of this PR, what's being adding and/or fixed --> ### Notes to the reviewers I hope this PR reduces the scope convolution from the other ones #67 #93, and makes the review easier. <!-- In this section you can include notes directed to the reviewers, like explaining why some parts of the PR were done in a specific way --> ### Changelog notice - Bump the `actions/checkout@v3` to `actions/checkout@v4`. - Adds two new jobs for `fmt` and `clippy` (clippy has been moved to a specific job). - Multiple fixes for the newly found `fmt` problems. - Bump the rust edition to `2021`. - Adds `.clippy.toml` file with `msrv=1.63.0`. <!-- Notice the release manager should include in the release tag message changelog --> <!-- See https://keepachangelog.com/en/1.0.0/ for examples --> ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing ACKs for top commit: ValuedMammal: ACK 1a4d5cf notmandatory: ACK 1a4d5cf Tree-SHA512: e693baeea112dffa12ccc576271f38f3188dc24669a70af7196e33e5eea08c5d82940792330682b8a4b1ec48ef98e1cbaa2f713736f393555744fdf44d79a26a
75e32db
to
f32c8d1
Compare
- feat(tor): add new async client, `AsyncTorClient`, which uses `arti-client` to establish Tor connections, and `hyper` as HTTP client over custom Tor anonymized data stream. - feat(tor): implements the common methods: `get_response`, `get_response_json`, `get_response_hex` and their `opt` versions too.
f32c8d1
to
8f7fff7
Compare
…ntation improvements 1103936 chore(style+docs): style and docs retouch (Leonardo Lima) 442789c chore(style): update new methods style (Leonardo Lima) 565d79e refactor(async): add common GET and POST methods (Leonardo Lima) 31dfa4b chore(docs): minor improvements on docstrings (Leonardo Lima) Pull request description: <!-- You can erase any parts of this template not applicable to your Pull Request. --> ### Description It builds on top of #95. Applies minor improvements on some docstrings, and Cargo.toml standard. The main change is adding the common HTTP methods for the `AsyncClient`, it removes duplicated code from each Esplora API request, and follows the approach done for `BlockingClient`. It makes it easier to extract these methods into an `AsyncEsploraClient` trait (to be done in another PR, initially done here 9cbc387), which the user can implement with any HTTP client of its choice. Also, makes it simpler to rebase and update the `AsyncAnonymizedClient` from #67. <!-- Describe the purpose of this PR, what's being adding and/or fixed --> ### Notes to the reviewers It has some commits from #95, as it builds on top of it and should be merged afterward. Please let me know what you think about the proposed changes and approach. <!-- In this section you can include notes directed to the reviewers, like explaining why some parts of the PR were done in a specific way --> ### Changelog notice - Applies minor improvements on documentation. - Add common `get_response` and `post_request` methods to `AsyncClient`, previously duplicated through the esplora API calls. It follows the approach done for `BlockinClient`. <!-- Notice the release manager should include in the release tag message changelog --> <!-- See https://keepachangelog.com/en/1.0.0/ for examples --> ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing ACKs for top commit: ValuedMammal: ACK 1103936 notmandatory: ACK 1103936 Tree-SHA512: 5579e0cba105f553782e419a16c26fc75b38a2ab8ee523f5ce5e2b9a4560503ef7f81faac546429851802efb66cf125cb36b49f20f088969a6ad580e644d43e5
AsyncAnonymizedClient
, that usesarti-hyper
, andarti-client
to connect and do requests over the Tor network.fixes #61
Summary by CodeRabbit
AsyncClient
with multiple HTTP clients.AsyncAnonymizedClient
for anonymized requests using Tor.esplora_client
library for anonymized asynchronous communication over Tor.