Closed hopeyen closed 1 year ago
sni is an extension of TLS protocol. ref Hence, this should already by supported by the underlying go-libp2p. I doubt this is an error arising from go-waku or waku-rust-bindings.
Just to verify, i ran a go-waku node from my machine with the discv5 enr provided and did not run into any issues, and the node was able to connect to few of the relay peers discovered. This probably would not emulate all the protocols/services of go-waku you are trying to initialize.
Do help me with the following, so that i can debug this further:
waku-bindings-0.1.1/src/utils.rs:13:40
Hi @chaitanyaprem , thanks a lot for looking into this. It does look like it's coming from waku-rust-bindings though, more specifically this line here https://github.com/waku-org/waku-rust-bindings/blob/8d825ad22eadfcb6752a9d56813d7b919d667a39/waku-bindings/src/utils.rs#L13
This is our application - https://github.com/graphops/graphcast-sdk , maybe @hopeyen can give more info about when exactly this happens or more detailed error logs, but you can try it by running cargo run --example ping-pong -- --indexer-address=0x1234567890abcdef1234567890abcdef12345678 --private-key=abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
(mocked values)
I actually ran it now and right away it throws:
❯ RUST_BACKTRACE=1 cargo run --example ping-pong -- --indexer-address=0x1234567890abcdef1234567890abcdef12345678 --private-key=abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
Finished dev [unoptimized + debuginfo] target(s) in 0.67s
Running `target/debug/examples/ping-pong --indexer-address=0x1234567890abcdef1234567890abcdef12345678 --private-key=abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890`
thread 'main' panicked at 'JsonResponse should always succeed to deserialize: Error("unknown protocol string: sni", line: 1, column: 1297)', /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/waku-bindings-0.1.1/src/utils.rs:13:40
stack backtrace:
0: rust_begin_unwind
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
1: core::panicking::panic_fmt
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
2: core::result::unwrap_failed
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1651:5
3: core::result::Result<T,E>::expect
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1033:23
4: waku_bindings::utils::decode_and_free_response
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/waku-bindings-0.1.1/src/utils.rs:13:9
5: waku_bindings::node::peers::waku_peers
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/waku-bindings-0.1.1/src/node/peers.rs:153:5
6: waku_bindings::node::WakuNodeHandle<waku_bindings::node::Running>::peers
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/waku-bindings-0.1.1/src/node/mod.rs:148:9
7: graphcast_sdk::graphcast_agent::waku_handling::filter_peer_subscriptions
at ./src/graphcast_agent/waku_handling.rs:88:48
8: graphcast_sdk::graphcast_agent::GraphcastAgent::new::{{closure}}
at ./src/graphcast_agent/mod.rs:318:21
9: ping_pong::main::{{closure}}
at ./examples/ping-pong/src/main.rs:75:10
10: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/park.rs:283:63
11: tokio::runtime::coop::with_budget
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/coop.rs:107:5
12: tokio::runtime::coop::budget
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/coop.rs:73:5
13: tokio::runtime::park::CachedParkThread::block_on
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/park.rs:283:31
14: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/context/blocking.rs:66:9
15: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/scheduler/multi_thread/mod.rs:87:13
16: tokio::runtime::context::runtime::enter_runtime
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/context/runtime.rs:65:16
17: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/scheduler/multi_thread/mod.rs:86:9
18: tokio::runtime::runtime::Runtime::block_on
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/runtime.rs:313:45
19: ping_pong::main
at ./examples/ping-pong/src/main.rs:132:5
20: core::ops::function::FnOnce::call_once
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
This is with RUST_BACKTRACE=1
and this is with RUST_BACKTRACE=full
❯ RUST_BACKTRACE=full cargo run --example ping-pong -- --indexer-address=0x1234567890abcdef1234567890abcdef12345678 --private-key=abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
Finished dev [unoptimized + debuginfo] target(s) in 0.68s
Running `target/debug/examples/ping-pong --indexer-address=0x1234567890abcdef1234567890abcdef12345678 --private-key=abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890`
thread 'main' panicked at 'JsonResponse should always succeed to deserialize: Error("unknown protocol string: sni", line: 1, column: 10066)', /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/waku-bindings-0.1.1/src/utils.rs:13:40
stack backtrace:
0: 0x10608ec5c - std::backtrace_rs::backtrace::libunwind::trace::h65bc41667b946a9b
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x10608ec5c - std::backtrace_rs::backtrace::trace_unsynchronized::h11e85e00c64d2951
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x10608ec5c - std::sys_common::backtrace::_print_fmt::hd30f3b7be3b8d9bb
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:65:5
3: 0x10608ec5c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h56d7672c82815b65
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:44:22
4: 0x1060adaf4 - core::fmt::rt::Argument::fmt::h6ead82aa10d38e42
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/rt.rs:138:9
5: 0x1060adaf4 - core::fmt::write::h632b3cc8e66b4f04
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/fmt/mod.rs:1094:21
6: 0x10608bc58 - std::io::Write::write_fmt::hc28441b249a4971d
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/io/mod.rs:1714:15
7: 0x10608eab4 - std::sys_common::backtrace::_print::h0d2f8b8a08c5cc48
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:47:5
8: 0x10608eab4 - std::sys_common::backtrace::print::h8057ced4b0f9fdc1
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:34:9
9: 0x10608ffdc - std::panicking::default_hook::{{closure}}::h8157fa8f0f7934b5
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:269:22
10: 0x10608fd6c - std::panicking::default_hook::hdaefe3bfb5fe212c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:288:9
11: 0x10609050c - std::panicking::rust_panic_with_hook::h21091a3c79c5da9c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:705:13
12: 0x106090418 - std::panicking::begin_panic_handler::{{closure}}::hd2f65b958d3068b8
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:597:13
13: 0x10608f03c - std::sys_common::backtrace::__rust_end_short_backtrace::h53ec33e49ec66621
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:151:18
14: 0x106090184 - rust_begin_unwind
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:593:5
15: 0x1060ce624 - core::panicking::panic_fmt::h3bbf9265d206434c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/panicking.rs:67:14
16: 0x1060ce9e4 - core::result::unwrap_failed::h1cd46f955b5f93b7
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1651:5
17: 0x104abe0e0 - core::result::Result<T,E>::expect::h89aa20e98d8cfbdf
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/result.rs:1033:23
18: 0x104ab0d60 - waku_bindings::utils::decode_and_free_response::had79c841550fb6a5
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/waku-bindings-0.1.1/src/utils.rs:13:9
19: 0x104acaeec - waku_bindings::node::peers::waku_peers::h9a7e0efdaa9f1563
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/waku-bindings-0.1.1/src/node/peers.rs:153:5
20: 0x104ab0948 - waku_bindings::node::WakuNodeHandle<waku_bindings::node::Running>::peers::hb81fe83e1dfce314
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/waku-bindings-0.1.1/src/node/mod.rs:148:9
21: 0x104933b74 - graphcast_sdk::graphcast_agent::waku_handling::filter_peer_subscriptions::h2a8b950304dd638f
at /Users/petko/work/graphcast-sdk/src/graphcast_agent/waku_handling.rs:88:48
22: 0x1048ab774 - graphcast_sdk::graphcast_agent::GraphcastAgent::new::{{closure}}::h26ef6fd427cf30f0
at /Users/petko/work/graphcast-sdk/src/graphcast_agent/mod.rs:318:21
23: 0x1048515b8 - ping_pong::main::{{closure}}::hac949b72fe2f22ab
at /Users/petko/work/graphcast-sdk/examples/ping-pong/src/main.rs:75:10
24: 0x1048b2abc - tokio::runtime::park::CachedParkThread::block_on::{{closure}}::ha64c2ed8e95f77e3
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/park.rs:283:63
25: 0x1048b2964 - tokio::runtime::coop::with_budget::h251df98951bb0e47
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/coop.rs:107:5
26: 0x1048b2964 - tokio::runtime::coop::budget::h9ee102b187adb121
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/coop.rs:73:5
27: 0x1048b2964 - tokio::runtime::park::CachedParkThread::block_on::hec64cbd3f9615636
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/park.rs:283:31
28: 0x1048b1af4 - tokio::runtime::context::blocking::BlockingRegionGuard::block_on::h79ed4db1310aac5a
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/context/blocking.rs:66:9
29: 0x1048a3868 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}::h45189413df45eef1
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/scheduler/multi_thread/mod.rs:87:13
30: 0x1048b0640 - tokio::runtime::context::runtime::enter_runtime::h4a31a9b116977ce3
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/context/runtime.rs:65:16
31: 0x1048a3814 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::ha70684b9e2190887
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/scheduler/multi_thread/mod.rs:86:9
32: 0x1048b0ddc - tokio::runtime::runtime::Runtime::block_on::ha4a6facbd71196ee
at /Users/petko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/runtime/runtime.rs:313:45
33: 0x1048634f8 - ping_pong::main::h0d3741cffb5e936b
at /Users/petko/work/graphcast-sdk/examples/ping-pong/src/main.rs:132:5
34: 0x1048dca60 - core::ops::function::FnOnce::call_once::h45f001fadb20abaa
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:250:5
35: 0x1048b9880 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0609628949951765
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/sys_common/backtrace.rs:135:18
36: 0x10484f10c - std::rt::lang_start::{{closure}}::h6491b3e1d558b060
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/rt.rs:166:18
37: 0x106086e6c - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h8f1a958b1e63295e
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/function.rs:284:13
38: 0x106086e6c - std::panicking::try::do_call::h403ddbcfab80d70c
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:500:40
39: 0x106086e6c - std::panicking::try::h86020f276a1178f6
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:464:19
40: 0x106086e6c - std::panic::catch_unwind::hca64056869e30e18
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panic.rs:142:14
41: 0x106086e6c - std::rt::lang_start_internal::{{closure}}::h175bacddb568e418
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/rt.rs:148:48
42: 0x106086e6c - std::panicking::try::do_call::h46d09a6fd6e4d20f
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:500:40
43: 0x106086e6c - std::panicking::try::h71931ad3921173c5
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panicking.rs:464:19
44: 0x106086e6c - std::panic::catch_unwind::h3e4f4c1fc97c2483
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/panic.rs:142:14
45: 0x106086e6c - std::rt::lang_start_internal::heb9ef1177a8102d0
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/rt.rs:148:20
46: 0x10484f0d8 - std::rt::lang_start::h1e928ed46ccf2439
at /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/std/src/rt.rs:165:17
47: 0x1048635c0 - _main
@axiomatic-aardvark @hopeyen I wonder if this PR fixes the issue you're running into? it uses a more recent go-libp2p version. https://github.com/waku-org/waku-rust-bindings/pull/70
@richard-ramos hmm we will give it a try and get back to you! thank you
I think a good practice is for the program to panic at initial setup, and work around the errors once it get to a continuously operational stage. It isn't good to panic and fail when other operations are working fine; in this case, I think the waku node could just ignore the peer with that protocol and move on. (please correct me if the deserialization error was supposed to be fatal
Hi @@richard-ramos ! I bumped our dependency to the latest of your branch for #70, but the radio still failed with the same error. For the dep upgrade, we added None for both dns4_domain_name
and websocket_params
Just found out that the issue was not on go-waku side, but in https://github.com/multiformats/rust-multiaddr/blob/master/src/protocol.rs SNI is not in the list of protocols!, while in go it is https://github.com/multiformats/go-multiaddr/blob/master/protocols.go#L36
:shocked_pikachu: when the problem is the dependency's dependency's dependency
I see that rust-multiaddr have an issue on unsupported protocols: https://github.com/multiformats/rust-multiaddr/issues/88
In the meantime, do you think we can get a quick fix at https://github.com/waku-org/waku-rust-bindings/blob/8d825ad22eadfcb6752a9d56813d7b919d667a39/waku-bindings/src/utils.rs#L13 so that the problem doesn't panic but return an error?
@hopeyen I did the requested change! no more panics in that function. Also go-waku does filter SNI addresses. It would be nice to add SNI support to rust-multiaddr tho, to remove that filtering. I might try that later :)
v0.3.0 was just published with the fix!
We are running crate 0.1.1, and added a discv5 ENR as a standard bootstrapping node to the wider discovery network
enr:-P-4QJI8tS1WTdIQxq_yIrD05oIIW1Xg-tm_qfP0CHfJGnp9dfr6ttQJmHwTNxGEl4Le8Q7YHcmi-kXTtphxFysS11oBgmlkgnY0gmlwhLymh5GKbXVsdGlhZGRyc7hgAC02KG5vZGUtMDEuZG8tYW1zMy53YWt1djIucHJvZC5zdGF0dXNpbS5uZXQGdl8ALzYobm9kZS0wMS5kby1hbXMzLndha3V2Mi5wcm9kLnN0YXR1c2ltLm5ldAYfQN4DiXNlY3AyNTZrMaEDbl1X_zJIw3EAJGtmHMVn4Z2xhpSoUaP5ElsHKCv7hlWDdGNwgnZfg3VkcIIjKIV3YWt1Mg8
The application was previously running without bootstrapping nodes, but now it panics due to an unknown protocol string 'sni'. I wonder if the protocol 'sni' should be added for the rust binding or go waku.
The following is relevant logs from our application that led up to the panic
Thank you in advance 🙏