411 Commits

Author SHA1 Message Date
dependabot[bot]
4ddaa550c7
deps: bump webpki-roots from 0.23.1 to 0.24.0
Pull-Request: #4177.
2023-07-11 11:11:24 +00:00
dependabot[bot]
a92a801cce
deps: bump smallvec from 1.10.0 to 1.11.0
Pull-Request: #4171.
2023-07-11 08:58:09 +00:00
dependabot[bot]
185cb4a2e3
deps: bump tokio from 1.28.2 to 1.29.1
Pull-Request: #4148.
2023-07-10 09:31:15 +00:00
dependabot[bot]
ed4b4644d1
deps: bump pin-project from 1.1.0 to 1.1.2
Pull-Request: #4146.
2023-07-03 15:34:26 +00:00
Max Inden
e32775d6fb
chore(webrtc): prepare v0.6.0-alpha
Pull-Request: #4123.


  
Co-Authored-By: Max Inden <mail@max-inden.de>
2023-06-26 23:58:49 +00:00
dependabot[bot]
8b91c89775
deps: bump libc from 0.2.146 to 0.2.147
Pull-Request: #4113.
2023-06-26 11:29:05 +00:00
Max Inden
c1551d71b6
chore: prepare libp2p v0.52.1
Pull-Request: #4106.


  
Co-Authored-By: Max Inden <mail@max-inden.de>
2023-06-26 00:33:59 +00:00
Yiannis Marangos
85a846a7dd
feat(webtransport): add WebTransport for WASM environments
This PR implements `Transport` for WebTransport for browsers by using web-sys.

Related: #3846.
Resolves: #3825.

Pull-Request: #4015.


  
Co-Authored-By: Yiannis Marangos <yiannis@eiger.co>
  

  
Co-Authored-By: Maciej Zwoliński <mac.zwolinski@gmail.com>
  

  
Co-Authored-By: Yiannis Marangos <psyberbits@gmail.com>
2023-06-23 05:50:49 +00:00
dependabot[bot]
59d17c206d
deps: bump wasm-bindgen-futures from 0.4.36 to 0.4.37
Pull-Request: #4082.
2023-06-21 13:12:22 +00:00
Anton
f8b3998661
deps(webrtc): update webrtc to 0.8.0
Pull-Request: #4099.


  
Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
2023-06-21 09:11:32 +00:00
dependabot[bot]
8f9827043c
deps: bump js-sys from 0.3.63 to 0.3.64
Pull-Request: #4083.
2023-06-20 15:00:00 +00:00
dependabot[bot]
be54727326
deps: bump rustls from 0.21.1 to 0.21.2
Pull-Request: #4084.
2023-06-20 14:38:22 +00:00
dependabot[bot]
84ccf26695
deps: bump wasm-bindgen from 0.2.86 to 0.2.87
Pull-Request: #4086.
2023-06-20 13:54:05 +00:00
dependabot[bot]
04b7668c55
deps: bump sha2 from 0.10.6 to 0.10.7
Pull-Request: #4088.
2023-06-20 13:10:43 +00:00
Thomas Eizinger
78c150d0df
chore: don't use workspace inheritance for dev-dependencies
Using workspace inheritance breaks `cargo release` because it cannot resolve that the dev-dependencies should only use a `path` and not a version.

Pull-Request: #4097.


  
Co-Authored-By: Thomas Eizinger <thomas@eizinger.io>
2023-06-20 12:24:28 +00:00
Max Inden
fd803e2697
chore(quic,webrtc): prepare v0.8.0-alpha & v0.5.0-alpha
Pull-Request: #4089.


  
Co-Authored-By: Max Inden <mail@max-inden.de>
2023-06-20 07:27:10 +00:00
Max Inden
8776fa8766
chore: prepare libp2p v0.52.0 release
Pull-Request: #4053.


  
Co-Authored-By: Max Inden <mail@max-inden.de>
  

  
Co-Authored-By: Thomas Eizinger <thomas@eizinger.io>
2023-06-19 11:49:39 +00:00
Yiannis M
755e3417f7
feat(noise): add WebTransport certhashes extension
The extension for WebTransport certhashes was added and can be configured via `Config::with_webtransport_certhashes`.

In case of initiator, these certhashes will be used to validate the ones reported by responder. In case of responder, these certhashes will be reported to initiator.

Resolves #3988.

Pull-Request: #3991.
2023-06-13 12:03:35 +00:00
Arpan Kapoor
cf3e4c6860
feat(quic): implement hole punching
Implement `Transport::dial_as_listener` for QUIC as specified by the [DCUtR spec](https://github.com/libp2p/specs/blob/master/relay/DCUtR.md).

To facilitate hole punching in QUIC, one side needs to send random UDP packets to establish a mapping in the routing table of the NAT device. If successful, our listener will emit a new inbound connection. This connection needs to then be sent to the dialing task. We achieve this by storing a `HashMap` of hole punch attempts indexed by the remote's `SocketAddr`. A matching incoming connection is then sent via a oneshot channel to the dialing task which continues with upgrading the connection.

Related #2883.

Pull-Request: #3964.
2023-06-13 11:42:18 +00:00
dependabot[bot]
d263ee67a9
deps: bump log from 0.4.18 to 0.4.19
Pull-Request: #4058.
2023-06-13 10:29:36 +00:00
Thomas Eizinger
f93719cfd3
refactor(wasm-ext): replace parity-send-wrapper with send-wrapper
Co-authored-by: Yiannis Marangos <yiannis@eiger.co>

Related: #4065.

Pull-Request: #4066.
2023-06-12 16:14:42 +00:00
Thomas Eizinger
ed14630672
feat: leverage type-safe /p2p in multiaddr
This updates `multiaddr` to version `0.19`.

Depends-On: #3656.
Depends-On: https://github.com/multiformats/rust-multiaddr/pull/83.
Resolves: #4039.

Pull-Request: #4037.
2023-06-08 01:38:18 +00:00
Thomas Eizinger
61128713eb
feat(core): remove deprecated identity module
Related: #3647.

Pull-Request: #4040.
2023-06-06 19:22:50 +00:00
dependabot[bot]
f2253abdd3
deps: bump libc from 0.2.144 to 0.2.145
Pull-Request: #4028.
2023-06-05 21:03:08 +00:00
dependabot[bot]
49eed8c4fd
deps: bump once_cell from 1.17.1 to 1.18.0
Pull-Request: #4026.
2023-06-05 10:41:11 +00:00
dependabot[bot]
1dbdb6a008
deps: bump futures_ringbuf from 0.3.1 to 0.4.0
Pull-Request: #4023.
2023-06-05 09:53:02 +00:00
Thomas Eizinger
ddc2b879e2
fix: apply suggestions from 1.71 clippy beta
Pull-Request: #4009.
2023-05-30 13:30:04 +00:00
dependabot[bot]
34d87a8208
deps: bump log from 0.4.17 to 0.4.18
Pull-Request: #4000.
2023-05-29 10:17:23 +00:00
dependabot[bot]
95eca886f2
deps: bump tokio from 1.28.1 to 1.28.2
Pull-Request: #4001.
2023-05-29 09:59:17 +00:00
Max Inden
fc386a51a7
fix: remove obsolete event_process = false
The `libp2p-swarm-derive` `event_process` option was removed in https://github.com/libp2p/rust-libp2p/pull/2840.

Pull-Request: #3984.
2023-05-25 05:44:54 +00:00
Thomas Coratger
ccb6e9586d
feat(transports): remove deprecated items in tcp
Related: https://github.com/libp2p/rust-libp2p/issues/3647.

Pull-Request: #3978.
2023-05-23 16:50:24 +00:00
dependabot[bot]
61725ca772
deps: bump wasm-bindgen-futures from 0.4.35 to 0.4.36
Pull-Request: #3968.
2023-05-22 19:28:36 +00:00
dependabot[bot]
ba5ca84292
deps: bump js-sys from 0.3.62 to 0.3.63
Pull-Request: #3969.
2023-05-22 19:08:57 +00:00
dependabot[bot]
9867fcebb6
deps: bump quinn-proto from 0.9.3 to 0.10.1
Pull-Request: #3938.
2023-05-22 08:47:51 +00:00
dependabot[bot]
a2ad916bc4
deps: bump wasm-bindgen from 0.2.85 to 0.2.86
Pull-Request: #3961.
2023-05-18 16:05:23 +00:00
dependabot[bot]
74fa48b43f
deps: bump tokio from 1.28.0 to 1.28.1
Pull-Request: #3931.
2023-05-18 15:47:10 +00:00
dependabot[bot]
b3fa954d4b
deps: bump libc from 0.2.143 to 0.2.144
Pull-Request: #3932.
2023-05-18 15:08:56 +00:00
Thomas Eizinger
fbd471cd79
feat(websocket): remove deflate compression option
This option is the only reason we pull in a dependency on the shared `zlib` library. Unfortunately, we cannot use a pure Rust backend here because that one does not support configuring the window bits of the deflate algorithm which is used in the deflate websocket extension.

Using websockets in libp2p is already crazy inefficient because you end up with double encryption when using `/wss` (which is enforced by browsers if your website is served via https). A good encryption algorithm like noise or TLS produces an output that looks completely random. Any attempt in compressing this is pretty much wasted CPU power.

Thus, I think removing this configuration option does not really hurt and allows us to remove the dependency on the `zlib` shared library.

Pull-Request: #3949.
2023-05-16 09:40:00 +00:00
dependabot[bot]
3f88fb6059
deps: bump js-sys from 0.3.61 to 0.3.62
Pull-Request: #3930.
2023-05-15 21:00:03 +00:00
dependabot[bot]
2512b6cd18
deps: bump pin-project from 1.0.12 to 1.1.0
Pull-Request: #3937.
2023-05-15 17:49:21 +00:00
dependabot[bot]
3021814e6b
deps: bump socket2 from 0.5.2 to 0.5.3
Pull-Request: #3934.
2023-05-15 17:30:19 +00:00
dependabot[bot]
86ea8fe4aa
deps: bump wasm-bindgen-futures from 0.4.34 to 0.4.35
Pull-Request: #3935.
2023-05-15 17:08:16 +00:00
Thomas Eizinger
5c785b92e7
feat(plaintext): remove Plaintext1Config
`Plaintext2Config` works with the upgrade infrastructure and is thus preferable.

Related: #3915.

Pull-Request: #3940.
2023-05-15 12:38:44 +00:00
Thomas Coratger
6e36e8aa35
feat(swarm): rename associated types for message passing
Previously, the associated types on `NetworkBehaviour` and `ConnectionHandler` carried generic names like `InEvent` and `OutEvent`. These names are _correct_ in that `OutEvent`s are passed out and `InEvent`s are passed in but they don't help users understand how these types are used.

In theory, a `ConnectionHandler` could be used separately from `NetworkBehaviour`s but that is highly unlikely. Thus, we rename these associated types to indicate, where the message is going to be sent to:

- `NetworkBehaviour::OutEvent` is renamed to `ToSwarm`: It describes the message(s) a `NetworkBehaviour` can emit to the `Swarm`. The user is going to receive those in `SwarmEvent::Behaviour`.
- `ConnectionHandler::InEvent` is renamed to `FromBehaviour`: It describes the message(s) a `ConnectionHandler` can receive from its behaviour via `ConnectionHandler::on_swarm_event`. The `NetworkBehaviour` can send it via the `ToSwarm::NotifyHandler` command.
- `ConnectionHandler::OutEvent` is renamed to `ToBehaviour`: It describes the message(s) a `ConnectionHandler` can send back to the behaviour via the now also renamed `ConnectionHandlerEvent::NotifyBehaviour` (previously `ConnectionHandlerEvent::Custom`)

Resolves: #2854.

Pull-Request: #3848.
2023-05-14 10:58:08 +00:00
Darius Clark
5b32c8a0d2
feat(transport): allow ListenerId to be user-controlled
`Transport::listen_on` is an asynchronous operation. It returns immediately but the actual process of establishing a listening socket happens as part of `Transport::poll` which will return one or more `TransportEvent`s related to a particular `listen_on` call.

Currently, `listen_on` returns a `ListenerId` which allows the user of the `Transport` interface to correlate the events with a particular `listen_on` call. This "user" is the `Swarm` runtime. Currently, a user of libp2p establishes a new listening socket by talking to the `Swarm::listen_on` interface and it is not possible to do the same thing via the `NetworkBehaviour` trait.

Within the `NetworkBehaviour` trait, we emit _commands_ to the `Swarm` like `ToSwarm::Dial`. These commands don't have a "return value" like a synchronous function does and thus, if we were to add a `ToSwarm::ListenOn` command, it could not receive the `ListenerId` from the `Transport`.

To fix this and to be consistent with our [coding guidelines](https://github.com/libp2p/rust-libp2p/blob/master/docs/coding-guidelines.md#allow-correlating-asynchronous-responses-to-their-requests) we change the interface of `Transport::listen_on` to require the user to pass in a `ListenerId`. This will allow us to construct a command in a `NetworkBehaviour` that remembers this ID which enables precise tracking of which events containing a `ListenerId` correlate which a particular `listen_on` command.

This is especially important in the context of listening on wildcard addresses like `0.0.0.0` because we end up binding to multiple network interfaces and thus emit multiple events for a single `listen_on` call.

Pull-Request: #3567.
2023-05-14 09:42:51 +00:00
Thomas Eizinger
1bf6264cbe
feat: properly encapsulate quick_protobuf::Error
I noticed that we also still leak that dependency in several crates by providing a `From` impl so I've removed that one as well.

Resolves #3534.

Pull-Request: #3894.
2023-05-12 02:26:01 +00:00
dependabot[bot]
b3caae5a88
deps: bump libc from 0.2.142 to 0.2.143
Pull-Request: #3892.
2023-05-08 10:22:04 +00:00
Thomas Eizinger
b507fe298f
feat(noise): remove deprecated legacy handshakes
This patch removes all deprecated legacy code from `libp2p-noise` and attempts to collapse all the abstraction layers into something a lot simpler.

Pull-Request: #3511.
2023-05-08 05:30:15 +00:00
Thomas Eizinger
2130923aa5
ci: remove protoc installation
With all crates have received a release since https://github.com/libp2p/rust-libp2p/issues/3024, building the baseline rustdoc no longer required `protoc` and we can thus remove it from our CI entirely.

Resolves #3539.

Pull-Request: #3858.
2023-05-08 04:08:44 +00:00
Thomas Coratger
14938043cf
feat(identity): make Keypair and Publickey opaque
`Keypair` and `Publickey` are rendered opaque:
- `Keypair` is replaced by a private `KeyPairInner` enum that is encapsulated inside the `Keypair` `pub struct`
- `Publickey` is replaced by a private `PublickeyInner` enum that is encapsulated inside the `Publickey` `pub struct`

Resolves #3860.

Pull-Request: #3866.
2023-05-05 20:17:47 +00:00