Conversation
kevin-ip
previously approved these changes
Mar 13, 2026
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Rust SDK’s TLS setup to work out-of-the-box by defaulting to the platform-native TLS backend while optionally supporting rustls + aws-lc-rs, and reduces RNG dependency/version friction in secp256k1-related tests.
Changes:
- Introduce mutually-exclusive TLS feature flags (
tls-native-tlsdefault, optionaltls-rustls) and add a one-time TLS runtime initializer for rustls provider installation. - Update REST entrypoints to call
ensure_tls_runtime()before making API requests. - Update secp256k1 test RNG usage to use
secp256k1::rand::rng()and expand CI tocargo checkboth TLS configurations.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/src/tls_runtime.rs | Adds process-wide TLS runtime initialization + feature gating for TLS backends. |
| rust/src/lib.rs | Wires TLS runtime module + re-exports ensure_tls_runtime via prelude. |
| rust/src/env.rs | Calls ensure_tls_runtime() before exchange info REST calls. |
| rust/src/authenticate.rs | Calls ensure_tls_runtime() before auth REST calls; updates secp256k1 test RNG usage. |
| rust/src/create_order.rs | Updates secp256k1 test RNG usage. |
| rust/src/withdraw.rs | Updates secp256k1 test RNG usage. |
| rust/src/update_leverage.rs | Updates secp256k1 test RNG usage. |
| rust/src/adjust_isolated_margin.rs | Updates secp256k1 test RNG usage. |
| rust/src/account_authorization.rs | Updates secp256k1 test RNG usage (authorize/deauthorize tests). |
| rust/Cargo.toml | Adds TLS feature flags; makes reqwest default-features=false; adds optional rustls dep; updates dev rand version. |
| rust/README.md | Documents TLS backend selection and how to enable rustls. |
| .github/workflows/typecheck.yaml | Triggers on Rust changes; adds cargo check for default + rustls feature sets. |
| rust/Cargo.lock | Updates lockfile for new reqwest/rustls/native-tls dependency graph. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
kevin-ip
approved these changes
Mar 13, 2026
jeffs
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
secp256k1::rand::rng();to avoid dependency collisions.