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

[Bug] run start_cli_testnet.sh fails on WrongLengthError #358

Closed
oleiba opened this issue Jul 28, 2019 · 6 comments
Closed

[Bug] run start_cli_testnet.sh fails on WrongLengthError #358

oleiba opened this issue Jul 28, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@oleiba
Copy link
Contributor

oleiba commented Jul 28, 2019

🐛 Bug

Running /scripts/cli/start_cli_testnet.sh fails with WrongLengthError due to parsing failure of the network_signing_pubkey in the trusted_peers.config.toml.

To reproduce

** Code snippet to reproduce **

/scripts/cli/start_cli_testnet.sh

** Stack trace/error message **

C0728 14:37:41.459876 4643923392 common/crash_handler/src/lib.rs:36] details = '''panicked at 'Unable to parse Config: Error { inner: ErrorInner { kind: Custom, line: None, col: 0, message: "WrongLengthError", key: ["peers", "9102bd7b1ad7e8f31023c500371cc7d2971758b450cfa89c003efb3ab192a4b8", "network_signing_pubkey"] } }', src/libcore/result.rs:999:5'''
backtrace = '''
stack backtrace:
   0: backtrace::backtrace::libunwind::trace::h610d043c6c306801 (0x10a6a051d)
             at /Users/odedleiba/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.33/src/backtrace/libunwind.rs:88
      backtrace::backtrace::trace_unsynchronized::hb91189c564c1f561
             at /Users/odedleiba/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.33/src/backtrace/mod.rs:66
   1: backtrace::backtrace::trace::h396cf29193962cde (0x10a6a04a3)
             at /Users/odedleiba/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.33/src/backtrace/mod.rs:53
   2: backtrace::capture::Backtrace::create::hf69a3fc527652965 (0x10a692bd7)
             at /Users/odedleiba/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.33/src/capture.rs:165
   3: backtrace::capture::Backtrace::new::hf920e6ceb129e06d (0x10a692ad5)
             at /Users/odedleiba/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.33/src/capture.rs:128
   4: crash_handler::handle_panic::hd9cad60b9b905745 (0x108ff0629)
             at common/crash_handler/src/lib.rs:33
   5: crash_handler::setup_panic_handler::{{closure}}::h8277bf2f84d90853 (0x108ff0e59)
             at common/crash_handler/src/lib.rs:25
   6: std::panicking::rust_panic_with_hook::hf20623e8d9ad0220 (0x10a6edd01)
             at src/libstd/panicking.rs:481
   7: std::panicking::continue_panic_fmt::he496f37e6b9d5a04 (0x10a6ed75d)
             at src/libstd/panicking.rs:384
   8: rust_begin_unwind (0x10a6ed649)
             at src/libstd/panicking.rs:311
   9: core::panicking::panic_fmt::hdf53d06fd5585318 (0x10a70cf82)
             at src/libcore/panicking.rs:85
  10: core::result::unwrap_failed::hc96189c6a0347f7c (0x109ad6c66)
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/macros.rs:18
  11: core::result::Result<T,E>::expect::hf6aa5fd50a3deb54 (0x109ad80c2)
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libcore/result.rs:827
  12: config::trusted_peers::TrustedPeersConfig::parse::h84eb8006bb27134f (0x109aa9b9b)
             at config/src/trusted_peers.rs:211
  13: config::trusted_peers::TrustedPeersConfig::load_config::hda7e49e63d38f254 (0x109252d9a)
             at /Users/odedleiba/MyWorkspace/libra-fork/config/src/trusted_peers.rs:147
  14: client::client_proxy::ClientProxy::new::h35a39be243e47de2 (0x109231416)
             at client/src/client_proxy.rs:117
  15: client::main::h185df47c469dfc82 (0x108fc6c93)
             at client/src/main.rs:61
  16: std::rt::lang_start::{{closure}}::h2d6c2dca3a64c062 (0x108fc2001)
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libstd/rt.rs:64
  17: std::rt::lang_start_internal::{{closure}}::hb7a69e6654bc39f4 (0x10a6ed5c8)
             at src/libstd/rt.rs:49
      std::panicking::try::do_call::he8e4ea304145861e
             at src/libstd/panicking.rs:296
  18: __rust_maybe_catch_panic (0x10a6f499f)
             at src/libpanic_unwind/lib.rs:82
  19: std::panicking::try::h6fa958a2046f56d3 (0x10a6edfde)
             at src/libstd/panicking.rs:275
      std::panic::catch_unwind::h2259cd01add01b88
             at src/libstd/panic.rs:394
      std::rt::lang_start_internal::h35126c8f0646029a
             at src/libstd/rt.rs:48
  20: std::rt::lang_start::h88e2fdc16f1dba3b (0x108fc1fd2)
             at /rustc/6e310f2abae97323ca1d5469657b83aa1a9407e0/src/libstd/rt.rs:64
  21: client::Args::augment_clap::hf13b41390b64852c (0x108fc9162)'''

Expected Behavior

The script should work and display a CLI console.

System information

Please complete the following information:

  • Libra version:
    master, commit a72e606
  • Rust Version:
    rustc 1.38.0-nightly (6e310f2ab 2019-07-07)
  • Computer OS:
    macOS Mojave (10.14.6)
@oleiba oleiba added the bug Something isn't working label Jul 28, 2019
@oleiba
Copy link
Contributor Author

oleiba commented Jul 28, 2019

The cause of this is probably the change in config::KeyPairs in d318c55

oleiba referenced this issue Jul 28, 2019
* This diff modifies the following behavior:

- `config::KeyPairs` now contains `nextgen_crypto:ed5519::Ed25519PrivateKey` instances where `signing::PrivateKey` was used,
- `NodeConfig`, `BaseConfig` et al, only allow Clone under conditional compilations,
- The n copies of private key material per node (where n = # of peers) in `KeyPairs::load_config` are eliminated using the [mem::replace](https://github.com/rust-unofficial/patterns/blob/master/idioms/mem-replace.md) pattern
- The 2 copies of private key material per node (in `chained_bft_consensus_provider::initialize_setup` and `main_node::setup_network`) are eliminated in the same way

* Why this is better:

- pursues the conversion to nextgen_crypto API
- the number of memory copies of private key material is brought down to one (the minimum)

* Why this is worse:

- the second access to the same owned private key from a `&mut NodeConfig` will panic

* Future (planned) work

- convert `LedgerInfo`, `QuorumCert` to use the nextgen crypto API
- use of X25519 keys should equally be converted to the nextgen crypto API, once the scheme is made available there
@fbandersnatch
Copy link

We recommend that you work on the testnet branch when interacting with testnet.
We forward the branch when we release, but master is not guaranteed to remain compatible.

@kanthgithub
Copy link

Hi @fbandersnatch
Thanks for response. I tried to follow the instructions as mentioned in the https://developers.libra.org/docs/my-first-transaction#setup

I ended up getting same issue.
Should we changing any configuration to make it to testnet?

while setup, we followed step to checkout testnet branch.

@fbandersnatch
Copy link

Good call @kanthgithub. We should update it.

@huitseeker
Copy link
Contributor

Fix in #352 afaict.

@fbandersnatch
Copy link

Closing this. The fix is in master and documentation is updated.

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

No branches or pull requests

4 participants