Socket benchmark failed

I tried to run the memsocket + noise benchmark, but got an error:
thread 'thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', /home/kz/fork/diem/network/src/noise/handshake.rs:178:69

I just followed the steps in the comment:
TCP_NOISE_ADDR=/ip6/::1/tcp/12345 cargo run --release -p socket-bench-server
TCP_NOISE_ADDR=/ip6/::1/tcp/12345 cargo x bench -p network noise_connections

And got error messages:
(in client)

thread 'thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code', /home/kz/fork/diem/network/src/noise/handshake.rs:178:69

(in server)
2021-06-06T02:30:11.358480Z [tokio-runtime-worker] ERROR network/socket-bench-server/src/lib.rs:151 Connection upgrade failed Custom { kind: Other, error: ServerReadFailed(Kind(UnexpectedEof)) } {"error":"Custom { kind: Other, error: ServerReadFailed(Kind(UnexpectedEof)) }"}

I ran cargo bench -p network and also met this problem when the bench start running memsocket + noise (and tcp + noise). According to the error message, the remote public key input into upgrade_with_noise is None, which is extracted from addr in the closure in build_memsocket_noise_transport (and in tcp+noise, itโ€™s build_tcp_noise_transport ). I tried to print the addr in the closure, but found nothing that can be extracted to a x25519 public key.

My execution environment:

  • Diem version: Current main branch
  • Rust version: cargo 1.51.0
  • OS: Ubuntu 16.04

Thanks for the report!