libp2p / rust-libp2p

The Rust Implementation of the libp2p networking stack.
https://libp2p.io
MIT License
4.61k stars 959 forks source link

Unable to dial bootstrap nodes `InvalidKey` #2971

Closed dignifiedquire closed 1 year ago

dignifiedquire commented 2 years ago

Summary

I just upgraded my fork to the current master, but am now getting the following error when dialing the boostrap nodes

 2022-10-03T18:33:11.985412Z DEBUG iroh_bitswap: dial failure QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb: Transport([("/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb", Other(Custom { kind: Other, error: Other(A(B(Apply(InvalidKey)))) }))])
    at iroh-bitswap/src/lib.rs:313

  2022-10-03T18:33:12.132196Z DEBUG iroh_bitswap: dial failure QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa: Transport([("/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa", Other(Custom { kind: Other, error: Other(A(B(Apply(InvalidKey)))) }))])
    at iroh-bitswap/src/lib.rs:313

  2022-10-03T18:33:12.279092Z DEBUG iroh_bitswap: dial failure QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN: Transport([("/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN", Other(Custom { kind: Other, error: Other(A(B(Apply(InvalidKey)))) }))])
    at iroh-bitswap/src/lib.rs:313

  2022-10-03T18:33:12.284856Z DEBUG iroh_bitswap: dial failure QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt: Transport([("/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt", Other(Custom { kind: Other, error: Other(A(B(Apply(InvalidKey)))) }))])

My current noise setup looks like this:

let dh_keys = noise::Keypair::<noise::X25519Spec>::new()
            .into_authentic(keypair)
            .expect("Noise key generation failed");

        noise::NoiseConfig::xx(dh_keys).into_authenticated()
thomaseizinger commented 2 years ago

You are dialing RSA keys but probably have not enabled the rsa feature.

I gotten bitten by the same thing, the error message should really be better!

dignifiedquire commented 2 years ago

Uff, can confirm that is the issue, but this is a pretty big footgun

thomaseizinger commented 2 years ago

I am working on a patch to improve this situation :)