Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: Fix clippy errors from upgrade to Rust 1.57 #2365

Merged
merged 5 commits into from
Dec 6, 2021

Conversation

thomaseizinger
Copy link
Contributor

The newly released version of clippy is flagging several things.

This PR is an attempt to tackle these quickly to unblock CI for other PRs.

We need to keep this marker type to ensure that the type continues
to be required to be pinned.
`false` is the default for `bool`, we can derive this.
These are already included the `RequestResponseMessage::Request`
variant.
Tackling these suggestions would require performance measurement
which we don't want to do at this stage.
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thomaseizinger!

@mxinden mxinden merged commit 2d61fe2 into master Dec 6, 2021
canewsin added a commit to decentnetwork/rust-libp2p that referenced this pull request Dec 7, 2021
* protocols/relay: Implement circuit relay v2 protocol

This commit adds an implementation for the circuit relay v2 protocol to
be used as a relay server, i.e. it supports incoming HOP requests and
outgoing STOP requests. Future commits will add support for clients,
i.e. outgoing HOP requests and incoming STOP requests.

The existing circuit relay v1 protocol implementation is moved to
protocols/relay/src/v1.

* misc/multistream-select: Ignore simultaneous open 'iamclient'

* protocols/relay: Ensure connections of HOP connect are kept alive

* protocols/relay: Improve documentation

* protocols/relay: Implement v2 client logic

* protocols/relay: Handle dial failure

* protocols/relay: Reuse connection

* protocols/relay: Rename Connection to RelayedConnection

* protocols/relay: Update transport doc examples

* protocols/relay: Pass relay addr to transport

* protocols/relay: Implement inbound stop denial

* protocols/relay: Renew reservations

* protocols/relay: Handle invalid expiration in the past

* protocols/relay: Handle in and outbound failure

* protocols/relay: Implement client handler keep alive

* protocols/relay: Handle handler listener closed channel

* protocols/relay: Handle handler to listener failure

* protocols/relay: Return all new listener addresses

* protocols/relay/v2: Update to latest protobuf definition

* Revert "misc/multistream-select: Ignore simultaneous open 'iamclient'"

This reverts commit 125e3c3.

* protocols/relay/v2: Report back to transport

* protocols/relay/v2: Disconnect when stop protocol not supported

* protocols/relay/v2: Document max_duration not exceed u32::MAX

* protocols/relay/v2: Don't append p2p-circuit as relay

* protocols/relay/v2: Implement rate limiter

* protocols/relay/v2: Document caveats on rate limiter with high volume

* protocols/relay: Prevent possible false positive in quickcheck

* protocols/relay: Reword Prost error message

* protocols/relay: Allow users to specify generic rate limiters

* protocols/relay: Move rate limiting logic into module

* protocols/relay: Prevent reservation and connection over relayed conn

* protocols/relay: Add circuit src rate limiting

* protocols/relay/v2: Simplify example

* protocols/relay: Add myself to authors

* protocols/relay: Use thiserror

* protocols/relay/v2: Set rate limits

* protocols/relay: Use wasm_timer::Instant

* protocols/relay/v2: Apply clippy suggestions

* protocols/relay: Fix intra doc link

* protocols/relay: Fix clippy warnings

* misc/metrics: Add basic instrumentation for libp2p-relay

* protocols/relay: Return NetworkBehaviourAction::NotifyHandler right away

* protocols/relay: Run rust fmt

* protocols/relay/src/v2/relay: Accept mutable config

* protocols/relay/examples: Structure command line args

- Allow deterministic peer identity.
- Choose between ipv6 and ipv4.

* .github/workflow: Use ubuntu-18.04 fixing missing protoc binary  (libp2p#2368)

`prost-build` is failing due to a missing `protoc` binary. Neither the OS
supplies one, nor can the bundled binaries be used. This commit downgrades the
OS used. The older OS is compatible with the bundled `protoc` binaries.

* *: Fix clippy errors from upgrade to Rust 1.57 (libp2p#2365)

* core: Mark "unused" field with "_"

We need to keep this marker type to ensure that the type continues
to be required to be pinned.

* tranports/noise: Derive `Default` for `Config`

`false` is the default for `bool`, we can derive this.

* protocols/request-response: Remove unused fields

These are already included the `RequestResponseMessage::Request`
variant.

* *: Allow clippy's large-enum-variant lint

Tackling these suggestions would require performance measurement
which we don't want to do at this stage.

Co-authored-by: Max Inden <mail@max-inden.de>

* protocols/mdns/: Generate peer expiry and fix IPv6 support (libp2p#2359)

Co-authored-by: Victor Ermolaev <victorermolaev@gmail.com>
Co-authored-by: Max Inden <mail@max-inden.de>

* protocols/floodsub: Propagate messages only to target peers (libp2p#2360)

Propagate messages only to the target peers and not all connected peers.

Co-authored-by: Victor Ermolaev <victorermolaev@gmail.com>
Co-authored-by: Max Inden <mail@max-inden.de>

* examples/*: Migrate to async await (libp2p#2356)

* Adapt examples to async style loop
* Adapt async style loop for chat.rs
* Adapt async style loop for distributed-key-value-store.rs
* Adapt async style loop for gossibsub-chat.rs
* Adapt async style loop for ipfs-private.rs
* Adapt ping to use async
* Update tutorial crate to reflect new changes

Co-authored-by: Max Inden <mail@max-inden.de>

* protocols/relay/src/v2/client: Return NetworkBehaviourAction on ListenReq

* Refactor suggestion

* protocols/relay/src/v2/client/handler: Check status of lend out substreams

* protocols/relay/src/v2/client: Use void::Void for drop_notifer

* protocols/relay/src/v2/client/handler: Log dropped oneshot Sender to transport

* protocols/relay/src/v2/client/handler: Await send call to transport listener

* protocols/relay/src/v2/client/handler: Remove unnecessary boxing

Co-authored-by: Max Inden <mail@max-inden.de>
Co-authored-by: ronzigelman <ronzigelman@gmail.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Victor Ermolaev <16148931+vnermolaev@users.noreply.github.com>
Co-authored-by: Victor Ermolaev <victorermolaev@gmail.com>
Co-authored-by: Gerardo Enrique Arriaga Rendon <53304516+JerryHue@users.noreply.github.com>
Co-authored-by: Marco Munizaga <git@marcopolo.io>
@thomaseizinger thomaseizinger deleted the fix-latest-clippy-error branch May 16, 2022 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants