-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow setting custom protocol in mplex #2332
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you include a changelog entry and bump the version?
https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md
muxers/mplex/src/config.rs
Outdated
/// Gets protocol | ||
pub fn protocol(&self) -> &[u8] { | ||
self.protocol | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the other fields have a getter method. Why is this one needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's useful for debugging/logging purposes to be able to retrieve the protocol name when it can be customized
Co-authored-by: Max Inden <[email protected]>
@mxinden Thanks for your review, I've updated the PR, please take another look. |
muxers/mplex/src/config.rs
Outdated
/// Gets the protocol anme | ||
pub fn protocol_name(&self) -> &[u8] { | ||
self.protocol_name | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the bringing this up once more, still, for the sake of consistency, I don't think we should introduce a getter for a single field only.
In case you would like to introduce getters for all fields, I think that should be a separate pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as suggested.
Although I don't really agree with the point of maintaining consistency. I think it makes sense to have immutable getters only for a subset of the fields, sharing the same rationale behind having different access modifiers for different fields in many languages including rust, but I do agree this might belong to a separate PR.
Hope this addresses ur concern in this PR, thx!
muxers/mplex/Cargo.toml
Outdated
@@ -2,7 +2,7 @@ | |||
name = "libp2p-mplex" | |||
edition = "2018" | |||
description = "Mplex multiplexing protocol for libp2p" | |||
version = "0.30.0" | |||
version = "0.31.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.31.0" | |
version = "0.30.1" |
Is this a breaking change? If not, why not release it as a patch release?
muxers/mplex/CHANGELOG.md
Outdated
@@ -1,3 +1,8 @@ | |||
# unreleased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# unreleased | |
# 0.30.1 [unreleased] |
@mxinden Comments resolved, plz take another look thx! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hanabi1224.
Thanks! |
* muxers/mplex: Allow setting custom protocol name (libp2p#2332) Co-authored-by: Max Inden <[email protected]> * build(deps): Update open-metrics-client requirement from 0.12.0 to 0.13.0 (libp2p#2355) * build(deps): Update open-metrics-client requirement Updates the requirements on [open-metrics-client](https://github.com/mxinden/rust-open-metrics-client) to permit the latest version. - [Release notes](https://github.com/mxinden/rust-open-metrics-client/releases) - [Changelog](https://github.com/mxinden/rust-open-metrics-client/blob/master/CHANGELOG.md) - [Commits](prometheus/client_rust@v0.12.0...v0.13.0) --- updated-dependencies: - dependency-name: open-metrics-client dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Inden <[email protected]> Co-authored-by: hanabi1224 <[email protected]> Co-authored-by: Max Inden <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Inden <[email protected]>
in go-libp2p-muxer, it allows using custom protocol name. Adding a similar
pub fn set_protocol
toMplexConfig
to connect to go nodes with custom protocolCloses #2344