The current implementation in Kademlia relies on an external address to determine if it should be in client or server mode. However there are instances where a node, which may know an external address, wishes to remain in client mode and switch to server mode at a later point.
This PR introduces `Kademlia::set_mode`, which accepts an `Option<Mode>` that would allow one to set `Mode::Client` for client mode, `Mode::Server` for server mode, or `None` to determine if we should operate as a client or server based on our external addresses.
Resolves#4074.
Pull-Request: #4132.
Unfortunately, the automated contribution message does not work properly. To evaluate this correctly, we need to first filter out all merge commits. To do this, we need to check the length of the `parents` property. I did not find a way to do this with jinja2 filters. Which would allow us to do something like `rejectattr`.
In the code snippet removed in this PR, I attempted to create a property to filter the merge commits on. This also doesn't work because the underlying object exposed by mergify is not a dictionary but a class and thus does not have the `update` function.
Mergify is shipping an additional property next month: https://github.com/Mergifyio/mergify/discussions/4636#discussioncomment-6295474. Thus, I am replacing this automated mechanism with a manual section that we can add to the PR until mergify ships the additional property that we can utilize to implement this in a clean way.
Related: #4130.
Related: #4104.
Pull-Request: #4131.
Fix the `Co-authored-by` inclusion in commit messages so that co-authorship is properly expressed. Additionally, filter merge commits before unique authors. Previously, we would not attribute an author if their first commit in a PR was a merge commit. Finally, we remove superfluous newlines between the `Co-authored-by` lines.
Pull-Request: #4104.
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Adds back in Distance as a public type. Follows `KBucketKey` naming for clarity.
Resolves#4108.
Pull-Request: #4109.
Co-Authored-By: Josh Wilson <joshuef@gmail.com>
Co-Authored-By: Max Inden <mail@max-inden.de>
This resolves an issue where our tests were depending on the number of network interfaces available on the local machine.
Related #4110.
Pull-Request: #4122.
Co-Authored-By: Thomas Eizinger <thomas@eizinger.io>
Instead of exposing the time to establish a connection, the time to upload the bytes and the time to download the bytes, expose a single time including all three.
The rational here is, that differentiation of the three is flawed. E.g. when does one stop the upload timer and start the download timer? When the last byte is sent? When the last byte is flushed? When the first byte is received?
See https://github.com/libp2p/test-plans/pull/184#pullrequestreview-1482600521 for past discussion.
Pull-Request: #4105.
Co-Authored-By: Max Inden <mail@max-inden.de>
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>
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>
`libp2p-muxer-harness` is never published to crates.io. Specifying it with a version makes `cargo release` check crates.io for the the non-existing crate.
Pull-Request: #4093.
Co-Authored-By: Max Inden <mail@max-inden.de>