Commit Graph

2601 Commits

Author SHA1 Message Date
df19abbbf2 deps: bump serde from 1.0.159 to 1.0.160
Pull-Request: #3796.
2023-04-24 18:41:38 +00:00
2065348867 deps: bump libc from 0.2.141 to 0.2.142
Pull-Request: #3815.
2023-04-24 18:09:41 +00:00
b4bfaacd05 deps: bump regex from 1.7.3 to 1.8.1
Pull-Request: #3816.
2023-04-24 17:23:39 +00:00
1f508095dc fix(kad): preserve deadline in keep alive logic
Previous to this change if the ConnectionHandler::poll for kad was called more frequently than the connection idle timeout the timeout would continually be pushed further into the future. After this change kad now will preserve the existing idle deadline.

Pull-Request: #3801.
2023-04-24 08:55:46 +00:00
270d204db2 feat(gossipsub): make gossipsub modules private
Resolves #3494.

Pull-Request: #3777.
2023-04-23 21:00:23 +00:00
e6f9d49109 fix(identity): add From & Into for public keys
This patch removes the `version 0.2.0` for deprecations as libp2p-identity is only at `0.1.1` and this can be confusing to the reader.

It also adds `impl From<ed25519::PublicKey> for PublicKey` (et al.) so that `PublicKey::from(ed25519::PublicKey)` works.

Fixes https://github.com/libp2p/rust-libp2p/issues/3802.

Pull-Request: #3805.
2023-04-22 10:16:58 +00:00
28da3d4180 fix(ci): ensure all examples compile with the specified feature-set
Due to cargo's feature unification, a full build of our workspace doesn't actually check whether the examples compile as standalone projects.

We add a new CI check that iterates through all crates in the `examples/` directory and runs a plain `cargo check` on them. Any failure is bubbled up via `set -e`, thus failing CI in case one of the `cargo check` commands fails.

To fix the current failures, we construct a simple TCP transport everywhere where we were previously using `development_transport`. That is because `development_transport` requires `mplex` which is now deprecated.

Related #3657.
Related #3809.

Pull-Request: #3811.
2023-04-21 09:58:08 +00:00
0fe9791829 feat(core): deprecate upgrade::from_fn
This functionality isn't needed anywhere in `rust-libp2p` so we can deprecate and later remove it and thus reduce our API surface. Users relying on this function can vendor it.

Pull-Request: #3747.
2023-04-19 22:07:42 +00:00
5df321d8b9 fix(allowblocklist): correctly remove Peer from sets
Previously, we reinserted the `Peer` in the "undo" function which is obviously wrong. This patch fixes the behaviour to be correct and adds two regression tests.

Pull-Request: #3789.
2023-04-19 15:51:20 +00:00
96288b8984 fix(gossipsub): gracefully disable handler on stream errors
Previously, we closed the entire connection upon receiving too many upgrade errors. This is unnecessarily aggressive. For example, an upgrade error may be caused by the remote dropping a stream during the initial handshake which is completely isolated from other protocols running on the same connection.

Instead of closing the connection, set `KeepAlive::No`.

Related: #3591.
Resolves: #3690.

Pull-Request: #3625.
2023-04-14 15:19:47 +00:00
058c2d85ec refactor(identity): follow naming conventions for conversion methods
This PR renames some method names that don't follow Rust naming conventions or behave differently from what the name suggests:
- Enforce "try" prefix on all methods that return `Result`.
- Enforce "encode" method name for methods that return encoded bytes.
- Enforce "to_bytes" method name for methods that return raw bytes.
- Enforce "decode" method name for methods that convert encoded key.
- Enforce "from_bytes" method name for methods that convert raw bytes.

Pull-Request: #3775.
2023-04-14 08:55:13 +00:00
8ffcff9624 deps: bump h2 from 0.3.15 to 0.3.17
Pull-Request: #3788.
2023-04-13 21:57:28 +00:00
9e09c60301 refactor(ci): simplify jq command for gather_workspace_crates
With best regards from ChatGPT.

Pull-Request: #3783.
2023-04-12 18:54:51 +00:00
aef481a420 deps: bump tj-actions/glob from 16 to 17
Pull-Request: #3778.
2023-04-12 14:48:02 +00:00
0d5cac0cb5 fix(interop): use webrtc-direct as browser-to-server identifier
See https://github.com/multiformats/multiaddr/pull/150#issuecomment-1468791586 for context on the rename.

Pull-Request: #3781.
2023-04-12 13:57:19 +00:00
9eb3030b1f fix(relay): ensure stable connect test
With the changes from #3767, we made the `connect` test flaky because the `Swarm` was fully passed to the future and thus dropped as soon as the connection was established. We pass a mutable reference instead which keeps the `Swarm` alive.

Pull-Request: #3780.
2023-04-12 12:04:01 +00:00
3c5940aead chore: prepare v0.51.3
Pull-Request: #3779.
2023-04-12 10:28:30 +00:00
af63130a41 fix(relay): send correct PeerId to client in outbound STOP message
Previously, the relay server would erroneously send its own `PeerId` in the STOP message to the client upon an incoming relay connection. This is obviously wrong and results in failed connection upgrades in other implementations.

Pull-Request: #3767.
2023-04-11 22:11:51 +00:00
436459b018 chore(README): update maintainer list
Pull-Request: #3744.
2023-04-11 21:16:54 +00:00
f7c3db9d6b chore(metrics): move example to examples/
Related: #3111.

Pull-Request: #3661.
2023-04-11 20:47:43 +00:00
7261856e7a deps: bump redis from 0.22.3 to 0.23.0
Pull-Request: #3755.
2023-04-11 19:58:16 +00:00
3e6d5862a2 deps: bump hyper from 0.14.24 to 0.14.25
Pull-Request: #3598.
2023-04-11 18:33:53 +00:00
849554abb0 deps: bump lru from 0.9.0 to 0.10.0
Pull-Request: #3558.
2023-04-11 17:54:56 +00:00
eeddf2791b fix(relay): flush relayed connection once idle
As a relay, when forwarding data between relay-connection-source and -destination and vice versa, flush write side when read currently has no more data available.

Pull-Request: #3765.
2023-04-11 16:13:23 +00:00
4cac590765 feat(kad): make implementation modules private
Similar to #3494, make implementation modules private for Kademlia (`kad`).

Resolves #3608.

Pull-Request: #3738.
2023-04-11 14:44:46 +00:00
8f8c86d347 fix(autonat): prohibit potentially large memory consumption
Autonat uses `Vec` for the servers field to hold a list of `PeerId` when calling `Behaviour::add_server`, but there is no check to prevent duplicated entries of the `PeerId`, which would cause unnecessary allocation overtime with repeated calls to the function.

Resolves #3733.

Pull-Request: #3736.
2023-04-11 11:40:35 +00:00
06ea8cef7e deps: bump asn1_der from 0.7.5 to 0.7.6
Pull-Request: #3752.
2023-04-10 15:40:51 +00:00
7144734ba6 deps: bump libc from 0.2.140 to 0.2.141
Pull-Request: #3757.
2023-04-10 14:48:34 +00:00
235043c013 deps: bump yasna from 0.5.1 to 0.5.2
Pull-Request: #3756.
2023-04-10 13:58:49 +00:00
7fe2f1cd6d deps: bump getrandom from 0.2.8 to 0.2.9
Pull-Request: #3751.
2023-04-10 12:54:34 +00:00
ecb55bbd86 deps: bump hex-literal from 0.4.0 to 0.4.1
Pull-Request: #3750.
2023-04-10 11:24:08 +00:00
1b2de2df3f fix(kad): export RoutingUpdate
The `RoutingUpdate` type that `add_address` returns was not made available publicly. This type is added in this PR by `pub use`.

Resolves #3737.

Pull-Request: #3739.
2023-04-09 16:35:05 +00:00
6b6187bd1c fix(identity): remove prost dependency
Pull-Request: #3713.
2023-04-09 15:48:43 +00:00
23c3d24610 deps: bump if-watch from 3.0.0 to 3.0.1
Pull-Request: #3730.
2023-04-09 14:27:58 +00:00
451c64a8b8 fix: specify correct libp2p-swarm dependency
With https://github.com/libp2p/rust-libp2p/pull/3658, these crates depend on the `0.42.1` release to access the new `ToSwarm` type. With the currently specified version, a user could theoretically run into a compile error if they pin `libp2p-swarm` to `0.42.0` in their lockfile but update to the latest patch release of one of these crates.

Pull-Request: #3711.
2023-04-05 19:44:32 +00:00
bdc618e9c7 deps: bump tempfile from 3.4.0 to 3.5.0
Pull-Request: #3720.
2023-04-05 15:35:00 +00:00
17dd72755d deps: bump tokio from 1.26.0 to 1.27.0
Pull-Request: #3729.
2023-04-05 14:37:42 +00:00
7c85f92e31 refactor(gossipsub): use pop instead of remove
Doesn't change any functionality but `pop` returns an `Option` whereas `remove` will panic on out-of-bounds. I am more comfortable with `pop` and a pattern match. Also, usage of `continue` allows us to not use an `else`.

Pull-Request: #3734.
2023-04-04 16:04:40 +00:00
95fa913923 deps: bump multiaddr from 0.17.0 to 0.17.1
Pull-Request: #3688.
2023-04-04 13:38:53 +00:00
5f2fff58c3 fix(.github): use run-interop-ping @master
We are currently using an old version of the ping interop tests. E.g. we are missing https://github.com/libp2p/test-plans/pull/148 which adds rust-libp2p v0.51.0.

Pull-Request: #3708.
2023-04-04 12:22:41 +00:00
f2a7457fde fix(gossipsub): prevent erroneously duplicate message IDs
Previously, we only mutably borrowed the `last_seq_no` in the current scope but did not modify the underlying number. This is because `u64` is copy and calling `wrapping_add` consumes `self` so the compiler just copied it. We introduce a new-type instead that is not `Copy`.

Additionally, `wrapping_add` and initializing with a random u64 might actually warp the number and thus not give us sequential numbers as intended in #3551. To solve this, we initialize with the current unix timestamp in nanoseconds. This allows a node to publish 1000000 messages a second and still not reuse sequence numbers even after a restart / re-initialization of the configuration. This is also what the go implementation does.

Resolves #3714.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>

Pull-Request: #3716.
2023-04-04 10:52:16 +00:00
e350630caf deps: bump webpki-roots from 0.22.6 to 0.23.0
Pull-Request: #3723.
2023-04-04 10:23:21 +00:00
44d4b1133d feat(libp2p): deprecate mplex
`mplex` module (no flow control and no streams limit) is deprecated to encourage `yamux` usage.

Resolves #3677.

Pull-Request: #3689.
2023-04-04 09:49:59 +00:00
4bbc108103 docs(libp2p): fix typo in changelog
There is no `0.52.2` version yet, only `0.51.2`.

Pull-Request: #3732.
2023-04-04 08:25:35 +00:00
389e519e7f deps: bump clap from 4.1.11 to 4.2.1
Pull-Request: #3731.
2023-04-03 19:02:18 +00:00
5604538357 deps: bump hex-literal from 0.3.4 to 0.4.0
Pull-Request: #3727.
2023-04-03 16:40:47 +00:00
6e93df79ae deps: bump quinn-proto from 0.9.2 to 0.9.3
Pull-Request: #3726.
2023-04-03 15:45:41 +00:00
0ff0ef7a35 deps: bump futures from 0.3.27 to 0.3.28
Pull-Request: #3725.
2023-04-03 14:43:42 +00:00
3a9debf508 deps: bump serde_json from 1.0.94 to 1.0.95
Pull-Request: #3722.
2023-04-03 14:07:13 +00:00
e5601dc998 deps: bump async-trait from 0.1.67 to 0.1.68
Pull-Request: #3721.
2023-04-03 13:32:07 +00:00