ZenGo-X / multi-party-ecdsa

Rust implementation of {t,n}-threshold ECDSA (elliptic curve digital signature algorithm).
GNU General Public License v3.0
975 stars 308 forks source link

Failed to run examples #93

Closed flyq closed 4 years ago

flyq commented 4 years ago

Here is my step:

  1. Git clone this repository, and build the examples
  2. Copy the Rocket.toml to ./target/release/examples
  3. Run the demo: ./demo/run.sh

Here is error logs:

$ ./demo/run.sh 
    Finished release [optimized] target(s) in 0.12s
Params: {"parties":"3", "threshold":"1"}
./demo/run.sh: Multi-party ECDSA parties:3 threshold:1
🔧 Configured for production.
    => address: 0.0.0.0
    => port: 8001
    => log: critical
    => workers: 12
    => secret key: private-cookies disabled
    => limits: forms = 32KiB
    => keep-alive: 5s
    => tls: disabled
🚀 Rocket has launched from http://0.0.0.0:8001
keygen part
key gen for client 1 out of 3
number: 1, uuid: "f2d83d40-c967-43f0-b468-4b1b5fdf0952"
key gen for client 2 out of 3
number: 2, uuid: "f2d83d40-c967-43f0-b468-4b1b5fdf0952"
["round1"] party 2 => party 1
["round1"] party 1 => party 2
key gen for client 3 out of 3
number: 3, uuid: "f2d83d40-c967-43f0-b468-4b1b5fdf0952"
["round1"] party 3 => party 2
["round1"] party 3 => party 1
["round1"] party 1 => party 3
["round2"] party 1 => party 2
["round2"] party 2 => party 1
["round1"] party 2 => party 3
["round2"] party 3 => party 2
["round2"] party 3 => party 1
["round2"] party 1 => party 3
["round2"] party 2 => party 3
["round3"] party 1 => party 2
["round3"] party 2 => party 1
["round3"] party 3 => party 2
["round3"] party 1 => party 3
["round3"] party 3 => party 1
["round4"] party 1 => party 2
["round3"] party 2 => party 3
["round4"] party 2 => party 1
["round4"] party 3 => party 2
["round4"] party 1 => party 3
["round4"] party 3 => party 1
["round5"] party 1 => party 2
["round4"] party 2 => party 3
["round5"] party 2 => party 1
["round5"] party 3 => party 2
["round5"] party 1 => party 3
["round5"] party 3 => party 1
["round5"] party 2 => party 3
sign
signing for client 1 out of 2
number: 1, uuid: "051bea03-eb9c-43ec-9532-4251ffdbdfcd"
signing for client 2 out of 2
number: 2, uuid: "051bea03-eb9c-43ec-9532-4251ffdbdfcd"
["round0"] party 2 => party 1
["round0"] party 1 => party 2
["round1"] party 2 => party 1
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: map, expected BigInt", line: 1, column: 77)', src/libcore/result.rs:1051:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
["round1"] party 1 => party 2
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: map, expected BigInt", line: 1, column: 77)', src/libcore/result.rs:1051:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
flyq commented 4 years ago

I modify the run.sh to show the verbose backtrace.

sign
signing for client 1 out of 2
number: 1, uuid: "ac923a16-b908-4545-9630-fcfc1a7dd542"
signing for client 2 out of 2
number: 2, uuid: "ac923a16-b908-4545-9630-fcfc1a7dd542"
["round0"] party 2 => party 1
["round0"] party 1 => party 2
["round1"] party 2 => party 1
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: map, expected BigInt", line: 1, column: 77)', src/libcore/result.rs:1051:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: rust_begin_unwind
             at src/libstd/panicking.rs:311
["round1"] party 1 => party 2
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: map, expected BigInt", line: 1, column: 77)', src/libcore/result.rs:1051:5
stack backtrace:
   9: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  10: core::result::unwrap_failed
  11: gg18_sign_client::main
  12: std::rt::lang_start::{{closure}}
  13: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  14: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  15: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:82
  16: std::panicking::try
             at src/libstd/panicking.rs:275
  17: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  18: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  19: main
  20: __libc_start_main
  21: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: rust_begin_unwind
             at src/libstd/panicking.rs:311
   9: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  10: core::result::unwrap_failed
  11: gg18_sign_client::main
  12: std::rt::lang_start::{{closure}}
  13: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  14: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  15: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:82
  16: std::panicking::try
             at src/libstd/panicking.rs:275
  17: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  18: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  19: main
  20: __libc_start_main
  21: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
flyq commented 4 years ago

I think it's coursed by the params.json.

I copy the params.json to ./target/release/examples, and modified it:

case 0:

params.json:

{"parties":"", "threshold":""}

error:

$ ./gg18_sign_client http://127.0.0.1:8001 keys1.store "KZen Networks"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { kind: Empty }', src/libcore/result.rs:1051:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

case 1:

params.json:

{"parties":3, "threshold":1}

error:

./gg18_sign_client http://127.0.0.1:8001 keys1.store "KZen Networks"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: integer `3`, expected a string", line: 1, column: 12)', src/libcore/result.rs:1051:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

case 2:

params.json:

{"parties":"3", "threshold":"1"}

log:
when I only run the keys1:

$ ./gg18_sign_client http://127.0.0.1:8001 keys1.store "KZen Networks"
number: 1, uuid: "99e33651-1ea3-49e0-abf5-71269e0a1bab"

when I run the keys2: error:

...
["round0"] party 2 => party 1
["round1"] party 2 => party 1
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid type: map, expected BigInt", line: 1, column: 77)', src/libcore/result.rs:1051:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

The params.json is ignored by .gitignore, anyone can supply the current one?

omershlo commented 4 years ago

Hi, I am looking into it. We recently introduced some changes to master branch that probably caused the example to fail. You can try earlier tags meanwhile.

flyq commented 4 years ago

OK, I'll try it. Thx

omershlo commented 4 years ago

Fixed now