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

feat(noise): deprecate non-compliant implementation #3227

Merged
merged 8 commits into from
Dec 19, 2022

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Dec 12, 2022

Description

For the last two years, we have been carrying around a non-compliant implementation of the noise protocol for libp2p. It is time to follow through on the announcement in that changelog entry and deprecate it. Users should use the spec compliant implementation instead.

  1. This will reduce the maintenance effort of our codebase.
  2. We will improve compile-times because we no longer need to depend on libsodium to test cryptography that is only part of the non-compliant implementation.
  3. It will simplify usage of rust-libp2p because users cannot accidentally choose the wrong implementation.

Notes

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@mergify
Copy link
Contributor

mergify bot commented Dec 12, 2022

This pull request has merge conflicts. Could you please resolve them @thomaseizinger? 🙏

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. Good idea.

What do you think of deprecating LegacyConfig as well?

/// Legacy configuration options.
#[derive(Clone, Copy, Default)]
pub struct LegacyConfig {
/// Whether to continue sending legacy handshake payloads,
/// i.e. length-prefixed protobuf payloads inside a length-prefixed
/// noise frame. These payloads are not interoperable with other
/// libp2p implementations.
pub send_legacy_handshake: bool,
/// Whether to support receiving legacy handshake payloads,
/// i.e. length-prefixed protobuf payloads inside a length-prefixed
/// noise frame. These payloads are not interoperable with other
/// libp2p implementations.
pub recv_legacy_handshake: bool,
}

transports/noise/CHANGELOG.md Outdated Show resolved Hide resolved
@mxinden
Copy link
Member

mxinden commented Dec 19, 2022

@mergify mergify bot merged commit 5458446 into master Dec 19, 2022
@thomaseizinger
Copy link
Contributor Author

Thanks @thomaseizinger. Good idea.

What do you think of deprecating LegacyConfig as well?

/// Legacy configuration options.
#[derive(Clone, Copy, Default)]
pub struct LegacyConfig {
/// Whether to continue sending legacy handshake payloads,
/// i.e. length-prefixed protobuf payloads inside a length-prefixed
/// noise frame. These payloads are not interoperable with other
/// libp2p implementations.
pub send_legacy_handshake: bool,
/// Whether to support receiving legacy handshake payloads,
/// i.e. length-prefixed protobuf payloads inside a length-prefixed
/// noise frame. These payloads are not interoperable with other
/// libp2p implementations.
pub recv_legacy_handshake: bool,
}

Yep, that is a good one to remove too! I'll send a PR.

@thomaseizinger thomaseizinger deleted the deprecate-non-compliant-noise branch February 24, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants