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

swarm/src/behaviour: Remove Send bound from NetworkBehaviour #2535

Merged
merged 6 commits into from
Feb 28, 2022

Conversation

dignifiedquire
Copy link
Member

@dignifiedquire dignifiedquire commented Feb 24, 2022

Needs confirmation this is okay design wise, but asfaict this is not actuallly required for the core of libp2p to work.

cc @mxinden

@mxinden
Copy link
Member

mxinden commented Feb 25, 2022

I am considering this a non-breaking change, thus the patch version bump only. Please comment in case you think otherwise.

@thomaseizinger
Copy link
Contributor

Technically it is breaking.

People could rely on the implicit Send bound if they write code that it is abstract over NetworkBehaviour and sent across thread boundaries.

I think that can fairly easily happen if someone builds a generic piece of code for spawning a Swarm into a task pool as we can see from the tests.

I think publishing it as breaking change would be better. I don't know if any library code exists that does depend on this but if it does, having things break in a dependency is a pretty shitty experience.

@dignifiedquire
Copy link
Member Author

agree with @thomaseizinger , it will likely require some folks to change their trait bounds if they are generic over it.

CHANGELOG.md Outdated Show resolved Hide resolved
@mxinden mxinden changed the title feat: remove Send bound from NetworkBehaviour swarm/src/behaviour: Remove Send bound from NetworkBehaviour Feb 28, 2022
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 @dignifiedquire for the find.

@mxinden mxinden merged commit e2fcc47 into libp2p:master Feb 28, 2022
umgefahren pushed a commit to umgefahren/rust-libp2p that referenced this pull request Mar 8, 2024
…2535)

The bound is no longer needed across the libp2p-XXX crates.

Co-authored-by: Max Inden <mail@max-inden.de>
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.

3 participants