celo-org / celo-bls-snark-rs

Implements SNARK-friendly BLS signatures
https://celo.org
Apache License 2.0
83 stars 24 forks source link

Use patching to pin arkworks-rs dependencies (incl. transitively) #231

Closed huitseeker closed 2 years ago

huitseeker commented 2 years ago

Description

This is an alternative to #229 which use a hack to force a rewrite of all[^1] arkworks dependencies to what they currently are in the Cargo.lock. This improves on #226 in that it pins everything, including packages such as bench-utils, which no longer exist otherwise than transitively.

See the last commit for a scary message on the load-bearing workspace patch section.

[^1]: all but one, as there is one use of ark-std for telemetry that requires a newer ark-std, and is left unconstrainted through package aliasing.

Tested, etc ..

Please see #229

Related issues

/cc @nategraf @gtank

huitseeker commented 2 years ago

Ah, never mind, I have found why, as @gtank mentioned, this does not work: while the build of this crate will follow the [patch] section with precision, dependents of this crate will not pick up that same patch section and will instead do their own resolution.

Concretely, the observable on this PR is to try the process outlined in #228: create a new project in a negihbouring repo to a checkout of this PR, add the following to the Cargo.toml:

[dependencies]
bls-crypto = { path = "../celo-bls-snark-rs/crates/bls-crypto" }

And witness the same failures as #228

Which means dependents would either break or need to adopt the same exact (and exacting) patch-versioning of arkworks crates => the only solution seems to be vendoring (or upgrade).