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

Can't run both CCLST keygen and sign test at the same time #78

Open
omershlo opened this issue Sep 14, 2019 · 8 comments
Open

Can't run both CCLST keygen and sign test at the same time #78

omershlo opened this issue Sep 14, 2019 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@omershlo
Copy link
Contributor

While running protocols::two_party_ecdsa::cclst_2019::test::tests::test_two_party_sign or protocols::two_party_ecdsa::cclst_2019::test::tests::test_full_key_gen is always working and passing. Trying to just cargo test --features=cclst returns a PARI error. Each time a different one:

It can sometimes work, while other times the following errors are received:

  ***   the PARI stack overflows !
  current stack size: 10000000 (9.537 Mbytes)
  [hint] set 'parisizemax' to a non-zero value in your GPRC

  ***   ***   Error in the PARI system. End of program.
  unknown type 31.  ***   Error in the PARI system. End of program
  ***   
the PARI stack overflows !
  current stack size: 10000000 (9.537 Mbytes)
  [hint] set 'parisizemax' to a non-zero value in your GPRC
  ***   Error in the PARI system. End of program.
  ***   unknown type 26.  ***   Error in the PARI system. End of program.

Might be connected topari_init in class_groups lib

@omershlo omershlo added the bug Something isn't working label Sep 14, 2019
@trepca
Copy link

trepca commented Sep 23, 2019

happening to me too on MacOS 10.14.6 (PARI installed using homebrew). Have enabled parisizemax in .gprc but didn't help.

@omershlo omershlo added the help wanted Extra attention is needed label Sep 23, 2019
@omershlo
Copy link
Contributor Author

thanks for reporting

@omershlo
Copy link
Contributor Author

I got two reports for users that on their machines the problem did not occur. I will get more details on their setups. They suggested to consult : http://pari.math.u-bordeaux.fr/pub/pari/manuals/2.11.1/libpari.pdf page 17

@omershlo
Copy link
Contributor Author

here are the setups that report of NO error:
1)
Ubuntu 19.04, with rustc 1.39.0-nightly, gp/pari 2.11.1. I ran
60 times the cargo test --features=cclst without errors.

macOS Mojave 10.14.6 and installed rust in a virtualbox
6.0.10 r132072 with debian stable 10.1, rustc 1.39.0-nightly

@trepca
Copy link

trepca commented Sep 26, 2019

I setup a fresh Ubuntu 19.04 on Digital Ocean with apt-get install build-essential llvm clang, installed with rustup nightly and still not working. I got a

  process didn't exit successfully: `/root/multi-party-ecdsa/target/debug/build/class_group-2cc3d835d71af03f/build-script-build` (exit code: 101)
--- stderr
wrapper.h:2:10: fatal error: 'pari/pari.h' file not found
wrapper.h:2:10: fatal error: 'pari/pari.h' file not found, err: true
thread 'main' panicked at 'Unable to generate bindings: ()', src/libcore/result.rs:1165:5

Then tried to install PARI via apt-get install pari-gp2c and it build but got a different error:

root@ubuntu-s-2vcpu-2gb-lon1-01:~/multi-party-ecdsa# RUST_BACKTRACE=1 cargo test --features=cclst
   Compiling class_group v0.1.4 (https://github.com/KZen-networks/class-groups?tag=v0.1.4#4501c2b8)
   Compiling multi-party-ecdsa v0.2.3 (/root/multi-party-ecdsa)
error[E0308]: mismatched types
   --> src/protocols/two_party_ecdsa/cclst_2019/party_one.rs:278:13
    |
278 |             GE::generator() * &party_one_private.x1,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `curv::elliptic::curves::secp256_k1::Secp256k1Point`, found a different struct `curv::elliptic::curves::secp256_k1::Secp256k1Point`
    |
    = note: expected type `curv::elliptic::curves::secp256_k1::Secp256k1Point` (struct `curv::elliptic::curves::secp256_k1::Secp256k1Point`)
               found type `curv::elliptic::curves::secp256_k1::Secp256k1Point` (struct `curv::elliptic::curves::secp256_k1::Secp256k1Point`)
note: Perhaps two different versions of crate `curv` are being used?
   --> src/protocols/two_party_ecdsa/cclst_2019/party_one.rs:278:13
    |
278 |             GE::generator() * &party_one_private.x1,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

🤷‍♂️

@omershlo
Copy link
Contributor Author

@trepca the error you got was my fault. I fixed this error and now it should work. Please confirm

@omershlo
Copy link
Contributor Author

I check the idea of @amanusk from ZenGo-X/class#20 .
It appears that running single thread all the tests solves the problem:
cargo test --features=cclst -- --test-threads=1

We do need to find a way to run Pari in parallel

@trepca
Copy link

trepca commented Sep 26, 2019

great, that works, even natively on MacOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants