electric-coin-company / jubjub-prototype Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
To install nightly Rust, you can use rustup.sh:
$ curl -s https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
when I use the following command to build the project, using alloc_system v0.1.2=
cargo +nightly run --release --bin bench_50
I found allocator error.
The log is
--> /home/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/alloc_system-0.1.2/src/lib.rs:4:12
|
4 | #![feature(allocator)]
| ^^^^^^^^^
error[E0658]: non-builtin inner attributes are unstable
--> /home/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/alloc_system-0.1.2/src/lib.rs:3:1
|
3 | #![allocator]
| ^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/54726
= help: add #![feature(custom_inner_attributes)] to the crate attributes to enable
error[E0658]: The attribute `allocator` is currently unknown to the compiler and may have meaning added to it in the future
--> /home/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/alloc_system-0.1.2/src/lib.rs:3:4
|
3 | #![allocator]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add #![feature(custom_attribute)] to the crate attributes to enable
error: aborting due to 3 previous errors
Some errors occurred: E0557, E0658.
For more information about an error, try `rustc --explain E0557`.
error: Could not compile `alloc_system`.
To learn more, run the command again with --verbose.
To enable mobile developers to make a z-addr enabled wallet.
In case that using CircuitInput to verify the public Input.
If I fetch prepared_vk from param file like bench_50.rs:
let mut params = ProverStream::new("p2cparams").unwrap();
let vk2 = params.get_vk(1).unwrap();
let prepared_vk = prepare_verifying_key(&vk2);
the function verify_proof throws an Error saying "MalformedVerifyingKey"
For example, I changed the code
let prepared_vk = prepare_verifying_key(¶ms.vk);
in #[test]test_lookup in lib.rs to
use std::fs::File;
params.write(&mut File::create("lookparams").unwrap()).unwrap();
let mut paramread = ProverStream::new("lookparams").unwrap();
let vk2 = paramread.get_vk(1).unwrap();
let prepared_vk = prepare_verifying_key(&vk2);
and left the rest unchanged, the test failed.
Thus problem doesn't occur when the CircuitInput is empty (like bench_50,rs).
Is it a bug of ProverStream or there is another way to deal with the situation?
pk@x1:~/jubjub-prototype$ cargo run --release --bin bench_50
Compiling pairing v0.11.0
error: invalid width `128` for integer literal
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/lib.rs:618:20
|
618 | let tmp = (1u128 << 64) + (a as u128) - (b as u128) - (*borrow as u128);
| ^^^^^
|
= help: valid widths are 8, 16, 32 and 64
error[E0554]: #[feature] may not be used on the stable release channel
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/lib.rs:4:39
|
4 | #![cfg_attr(feature = "u128-support", feature(i128_type))]
| ^^^^^^^^^^^^^^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:15:17
|
15 | pub(crate) x: $basefield,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:16:17
|
16 | pub(crate) y: $basefield,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:17:17
|
17 | pub(crate) infinity: bool
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:33:16
|
33 | pub(crate) x: $basefield,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:34:16
|
34 | pub(crate) y: $basefield,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:35:16
|
35 | pub(crate) z: $basefield
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:882:31
|
882 | pub struct G1Prepared(pub(crate) G1Affine);
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:15:17
|
15 | pub(crate) x: $basefield,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:16:17
|
16 | pub(crate) y: $basefield,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:17:17
|
17 | pub(crate) infinity: bool
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:33:16
|
33 | pub(crate) x: $basefield,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:34:16
|
34 | pub(crate) y: $basefield,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:35:16
|
35 | pub(crate) z: $basefield
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:1463:13
|
1463 | pub(crate) coeffs: Vec<(Fq2, Fq2, Fq2)>,
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/bls12_381/ec.rs:1464:13
|
1464 | pub(crate) infinity: bool
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/lib.rs:617:9
|
617 | pub(crate) fn sbb(a: u64, b: u64, borrow: &mut u64) -> u64 {
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/lib.rs:628:9
|
628 | pub(crate) fn adc(a: u64, b: u64, carry: &mut u64) -> u64 {
| ^^^^^
error: `pub(restricted)` syntax is experimental (see issue #32409)
--> /home/pk/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/lib.rs:639:9
|
639 | pub(crate) fn mac_with_carry(a: u64, b: u64, c: u64, carry: &mut u64) -> u64 {
| ^^^^^
error: aborting due to 19 previous errors
error: Could not compile `pairing`.
To learn more, run the command again with --verbose.
pk@x1:~/jubjub-prototype$
Seems that the code is different from g1^x1g2^x2 ...* gn^xn.
Is it just a "dummy" version for benchmark?
invite@linux:~/sources/app/jubjub-prototype$ cargo run --release --no-default-features --bin bench_50
Compiling pairing v0.11.0
error[E0554]: #![feature] may not be used on the stable release channel
--> /home/invite/.cargo/registry/src/github.com-1ecc6299db9ec823/pairing-0.11.0/src/lib.rs:4:39
|
4 | #![cfg_attr(feature = "u128-support", feature(i128_type))]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: Could not compile `pairing`.
Even changed the code in loop:
if i == 15 {
break
}
to
if i == 15 {
break
}
It halts for several hours in my host with 4G RAM and 1CPU. The other 4 test passed ok.
I wanna to know what's wrong?
invite@linux:~/sources/app/jubjub-prototype$ cargo run --release --bin bench_50
Compiling libc v0.2.54
Compiling byteorder v1.3.1
Compiling futures v0.1.26
Compiling crossbeam v0.3.2
Compiling bit-vec v0.4.4
Compiling rand v0.4.6
Compiling num_cpus v1.10.0
Compiling futures-cpupool v0.1.8
Compiling rand v0.3.23
Compiling pairing v0.11.0
Compiling bellman v0.0.3
Compiling jubjub v0.0.1 (/home/invite/sources/jubjub-prototype)
error[E0463]: can't find crate for `alloc_system`
--> src/lib.rs:4:1
|
4 | extern crate alloc_system;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: Could not compile `jubjub`.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.