Skip to content

feat(swarm): introduce ConnectionId::new_unchecked constructor#3652

Merged
mergify[bot] merged 7 commits into
masterfrom
tmp-connection-id-ctor
Mar 21, 2023
Merged

feat(swarm): introduce ConnectionId::new_unchecked constructor#3652
mergify[bot] merged 7 commits into
masterfrom
tmp-connection-id-ctor

Conversation

@thomaseizinger

Copy link
Copy Markdown
Contributor

Description

In earlier iterations of the design for generic connection management, we removed the ConnectionId::new constructor because it would have allowed users to create ConnectionIds that are already taken, thus breaking invariants that NetworkBehaviours rely on. Later, we incorporated the creation of ConnectionId in DialOpts which mitigates this risk altogether.

Thus, it is reasonably safe to introduce a public, non-deprecated constructor for ConnectionId that can be used for tests.

Related #3327 (comment).

Notes & open questions

cc @melekes

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

@melekes melekes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread swarm/CHANGELOG.md Outdated
@thomaseizinger

Copy link
Copy Markdown
Contributor Author

I am going to directly release this after it merges to unblock @melekes. This is trivial in my eyes, hence I am merging this right away.

@mergify

mergify Bot commented Mar 21, 2023

Copy link
Copy Markdown
Contributor

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

@mergify
mergify Bot merged commit 3fa10be into master Mar 21, 2023
@mergify
mergify Bot deleted the tmp-connection-id-ctor branch March 21, 2023 19:28
Comment thread swarm/src/connection.rs
@melekes

melekes commented Mar 27, 2023

Copy link
Copy Markdown
Contributor

@thomaseizinger @mxinden what is the timeline for the next patch release (0.51.2)? we're (Parity) interested in this change specifically. I can create a PR if necessary.

@mxinden

mxinden commented Mar 28, 2023

Copy link
Copy Markdown
Member

I will try tomorrow. No promises @melekes.

@mxinden mxinden mentioned this pull request Mar 29, 2023
4 tasks
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.

3 participants