celo-org / celo-bls-snark-rs

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

Fragile dependencies on arkworks (build break for any dependent) #228

Open huitseeker opened 2 years ago

huitseeker commented 2 years ago

Steps to reproduce

Install cargo-edit, then adding a new project with a bls-crypto dependency fails to build:

cargo new celo-bug && cd celo-bug
cargo add --git https://github.com/celo-org/celo-bls-snark-rs bls-crypto
cargo check --all

Result:

error[E0438]: const `COFACTOR` is not a member of trait `ModelParameters`
  --> /Users/huitseeker/.cargo/git/checkouts/curves-a0d652819d10cde2/d1ced15/bls12_377/src/curves/g1.rs:23:5
   |
23 |     const COFACTOR: &'static [u64] = &[0x0, 0x170b5d4430000000];
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `ModelParameters`

error[E0438]: const `COFACTOR_INV` is not a member of trait `ModelParameters`
  --> /Users/huitseeker/.cargo/git/checkouts/curves-a0d652819d10cde2/d1ced15/bls12_377/src/curves/g1.rs:28:5
   |
28 |     const COFACTOR_INV: Fr = field_new!(Fr, "5285428838741532253824584287042945485047145357130994810877");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `ModelParameters`

error[E0438]: const `COFACTOR` is not a member of trait `ModelParameters`
  --> /Users/huitseeker/.cargo/git/checkouts/curves-a0d652819d10cde2/d1ced15/bls12_377/src/curves/g2.rs:16:5
   |
16 | /     const COFACTOR: &'static [u64] = &[
17 | |         0x0000000000000001,
18 | |         0x452217cc90000000,
19 | |         0xa0f3622fba094800,
...  |
24 | |         0x26ba558ae9562a,
25 | |     ];
   | |______^ not a member of trait `ModelParameters`

error[E0438]: const `COFACTOR_INV` is not a member of trait `ModelParameters`
  --> /Users/huitseeker/.cargo/git/checkouts/curves-a0d652819d10cde2/d1ced15/bls12_377/src/curves/g2.rs:30:5
   |
30 |     const COFACTOR_INV: Fr = field_new!(Fr, "6764900296503390671038341982857278410319949526107311149686707033187604810669");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a member of trait `ModelParameters`

For more information about this error, try `rustc --explain E0438`.
error: could not compile `ark-bls12-377` due to 4 previous errors

Full output : https://gist.github.com/c0ac46d14a6c1544a563d14519f2955c

Expected Behavior

Successful compilation.

Current Behavior

Though the repo in itself will compile (because of its checked-in Cargo.lock), the arkworks dependencies no longer seem to pull in dependencies compatible with each other.