Skip to content

@fed/reqwest impl parameters#3169

Open
fedpre wants to merge 6 commits intoProvableHQ:stagingfrom
fedpre:@fed/reqwest-impl-parameters
Open

@fed/reqwest impl parameters#3169
fedpre wants to merge 6 commits intoProvableHQ:stagingfrom
fedpre:@fed/reqwest-impl-parameters

Conversation

@fedpre
Copy link
Copy Markdown

@fedpre fedpre commented Mar 2, 2026

Motivation

Updated the remote fetching implementation to use reqwest instead of curl to avoid issues with CA certificate. This changes uses the native-tsl from reqwuest without any additional step.

Test Plan

Tested on both iOS and Android devices and the change works.

Backwards compatibility

Please review backwards compatibility. Does any functionality need to be guarded by an existing or new ConsensusVersion?

fedpre added 4 commits March 2, 2026 11:40
Updated the remote fetching implementation to use reqwest instead of curl, improving compatibility and simplifying error handling. Adjusted Cargo.toml to reflect the change in dependencies and removed obsolete curl configurations from Cargo.lock. This change enhances the overall performance and maintainability of the code.
…o.toml

Added new dependencies including foreign-types, hyper-tls, native-tls, and openssl-related packages to Cargo.lock. Updated reqwest configuration in Cargo.toml to disable default features and enable blocking and native-tls features for improved functionality.
…features in Cargo.toml

Removed several obsolete dependencies from Cargo.lock to streamline the project. Updated reqwest configuration in Cargo.toml to disable default features while enabling json and native-tls for enhanced functionality.
[dependencies.reqwest]
version = "0.13"
features = [ "json" ]
default-features = false
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? If not can you revert (i.e. remove this line)

Copy link
Copy Markdown
Author

@fedpre fedpre Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is and the reason is that with version 0.13 it installs by default some aws-ls-* libraries that break android. In this way, we avoid that. I tried several ways but android keeps crashing.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to make this a target-dependent exception like we have inparameters/Cargo.toml? It's hard to test on all possible platforms and we want to avoid breaking changes

Copy link
Copy Markdown
Author

@fedpre fedpre Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take a look if it is possible to do

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: this seems impossible: rust-lang/cargo#1197

Let's take the risk, if some client software depending on snarkVM breaks then we can figure out a resolution

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sounds good. Let's wait on @iamalwaysuncomfortable review and then I guess we can proceed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: this seems impossible: rust-lang/cargo#1197 Let's take the risk, if some client software depending on snarkVM breaks then we can figure out a resolution

@vicsn @fedpre It's impossible not with resolver v2, we do it on the very next line of this Cargo.toml.

[target.'cfg(target_arch="wasm32")'.dependencies.ureq]
workspace = true
features = [ "json", "gzip" ]
optional = true

[target.'cfg(not(target_arch="wasm32"))'.dependencies.ureq]
workspace = true
features = [ "json", "gzip", "rustls" ]
optional = true

Therefore this should work:

[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "json", "native-tls" ]
optional = true

[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "json" ]
optional = true

@iamalwaysuncomfortable
Copy link
Copy Markdown
Member

@vicsn is this still mergeable?

[dependencies.reqwest]
version = "0.13"
features = [ "json" ]
default-features = false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: this seems impossible: rust-lang/cargo#1197 Let's take the risk, if some client software depending on snarkVM breaks then we can figure out a resolution

@vicsn @fedpre It's impossible not with resolver v2, we do it on the very next line of this Cargo.toml.

[target.'cfg(target_arch="wasm32")'.dependencies.ureq]
workspace = true
features = [ "json", "gzip" ]
optional = true

[target.'cfg(not(target_arch="wasm32"))'.dependencies.ureq]
workspace = true
features = [ "json", "gzip", "rustls" ]
optional = true

Therefore this should work:

[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "json", "native-tls" ]
optional = true

[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "json" ]
optional = true

Comment on lines +70 to +71
default-features = false
features = [ "json", "native-tls" ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Native-tls will break wasm targets and have easily the capability of breaking multiple other Rust implementations who are using rust-tls as this will enforce native-tls.

To avoid downstream breakage, the change should be this:

[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "json", "native-tls" ]
optional = true

[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "json" ]
optional = true

Comment on lines +96 to +99
[target.'cfg(all(not(target_family = "wasm"), not(target_env = "sgx")))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "blocking", "native-tls" ]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again native-tls would break wasm and easily break other could tls stacks as it'd enforce native-tls usage. Just target the mobile platforms specifically.

Suggested change
[target.'cfg(all(not(target_family = "wasm"), not(target_env = "sgx")))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "blocking", "native-tls" ]
[target.'cfg(all(
any(target_os = "android", target_os = "ios"),
not(target_family = "wasm"),
not(target_env = "sgx")
))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "blocking", "native-tls" ]
[target.'cfg(all(
not(any(target_os = "android", target_os = "ios")),
not(target_family = "wasm"),
not(target_env = "sgx")
))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = [ "blocking" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants