Skip to content
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

Fix ring params #92

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Fix ring params #92

merged 1 commit into from
Jul 24, 2024

Conversation

stepanLav
Copy link
Contributor

@stepanLav stepanLav commented Jul 24, 2024

Got an error when try to build from master:

❯ cargo build -r
   Compiling bandersnatch_vrfs v0.0.4 (/Users/stepanlavrentev/ring-vrf/bandersnatch_vrfs)
error[E0308]: arguments to this function are incorrect
   --> bandersnatch_vrfs/src/ring.rs:132:9
    |
132 |         ring::index(self.pcs_params.clone(), &self.piop_params, pks).0
    |         ^^^^^^^^^^^
    |
note: expected `&_`, found `URS<Bls12<Config>>`
   --> bandersnatch_vrfs/src/ring.rs:132:21
    |
132 |         ring::index(self.pcs_params.clone(), &self.piop_params, pks).0
    |                     ^^^^^^^^^^^^^^^^^^^^^^^
    = note: expected reference `&_`
                  found struct `URS<Bls12<ark_bls12_381::Config>>`
note: expected `&[Affine<BandersnatchConfig>]`, found `Vec<Affine<BandersnatchConfig>>`
   --> bandersnatch_vrfs/src/ring.rs:132:65
    |
132 |         ring::index(self.pcs_params.clone(), &self.piop_params, pks).0
    |                                                                 ^^^
    = note: expected reference `&[ark_ec::short_weierstrass::Affine<BandersnatchConfig>]`
                  found struct `Vec<ark_ec::short_weierstrass::Affine<BandersnatchConfig>>`
note: function defined here
   --> /Users/stepanlavrentev/.cargo/git/checkouts/ring-proof-e9e49c3c86c409a2/665f5f5/ring/src/piop/mod.rs:222:8
    |
222 | pub fn index<F: PrimeField, CS: PCS<F>, Curve: SWCurveConfig<BaseField=F>>(
    |        ^^^^^
help: consider borrowing here
    |
132 |         ring::index(&self.pcs_params.clone(), &self.piop_params, pks).0
    |                     +
help: consider borrowing here
    |
132 |         ring::index(self.pcs_params.clone(), &self.piop_params, &pks).0
    |                                                                 +

error[E0308]: arguments to this function are incorrect
   --> bandersnatch_vrfs/src/ring.rs:136:9
    |
136 |         ring::index(self.pcs_params.clone(), &self.piop_params, pks).1
    |         ^^^^^^^^^^^
    |
note: expected `&_`, found `URS<Bls12<Config>>`
   --> bandersnatch_vrfs/src/ring.rs:136:21
    |
136 |         ring::index(self.pcs_params.clone(), &self.piop_params, pks).1
    |                     ^^^^^^^^^^^^^^^^^^^^^^^
    = note: expected reference `&_`
                  found struct `URS<Bls12<ark_bls12_381::Config>>`
note: expected `&[Affine<BandersnatchConfig>]`, found `Vec<Affine<BandersnatchConfig>>`
   --> bandersnatch_vrfs/src/ring.rs:136:65
    |
136 |         ring::index(self.pcs_params.clone(), &self.piop_params, pks).1
    |                                                                 ^^^
    = note: expected reference `&[ark_ec::short_weierstrass::Affine<BandersnatchConfig>]`
                  found struct `Vec<ark_ec::short_weierstrass::Affine<BandersnatchConfig>>`
note: function defined here
   --> /Users/stepanlavrentev/.cargo/git/checkouts/ring-proof-e9e49c3c86c409a2/665f5f5/ring/src/piop/mod.rs:222:8
    |
222 | pub fn index<F: PrimeField, CS: PCS<F>, Curve: SWCurveConfig<BaseField=F>>(
    |        ^^^^^
help: consider borrowing here
    |
136 |         ring::index(&self.pcs_params.clone(), &self.piop_params, pks).1
    |                     +
help: consider borrowing here
    |
136 |         ring::index(self.pcs_params.clone(), &self.piop_params, &pks).1
    |                                                                 +

For more information about this error, try `rustc --explain E0308`.
error: could not compile `bandersnatch_vrfs` (lib) due to 2 previous errors

@stepanLav stepanLav changed the title change ring params Fix ring params Jul 24, 2024
@h4n0
Copy link

h4n0 commented Jul 24, 2024

I got the same error while compiling my substrate node:

error[E0308]: arguments to this function are incorrect
   --> /Users/h/.cargo/git/checkouts/ring-vrf-fa8519651343a7ee/4b09416/bandersnatch_vrfs/src/ring.rs:89:9
    |
89  |         ring::index(self.pcs_params.clone(), &self.piop_params, pks).1
    |         ^^^^^^^^^^^
    |
note: expected `&_`, found `URS<Bls12<Config>>`

Are there some updates that caused this? Any quick fixes?


Update:

Rolling back the ring version solves this issue. Do the following command and build again:

cargo update -p ring@0.1.0 --precise 626c9598

It turned out that the new commit 665f5f51 of ring-proof introduced this issue. w3f/ring-proof#26

@davxy davxy merged commit 5821f59 into w3f:master Jul 24, 2024
4 checks passed
github-merge-queue bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Jul 24, 2024
Ring-proof backend API changed to take some params by ref.
Bandersnatch-VRF was not updated

(Fixed by: w3f/ring-vrf#92 and
w3f/ring-vrf#93)
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
Ring-proof backend API changed to take some params by ref.
Bandersnatch-VRF was not updated

(Fixed by: w3f/ring-vrf#92 and
w3f/ring-vrf#93)
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