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

Connectedness events are not submitted by mocknet #2267

Closed
Wondertan opened this issue May 4, 2023 · 4 comments · Fixed by #2287
Closed

Connectedness events are not submitted by mocknet #2267

Wondertan opened this issue May 4, 2023 · 4 comments · Fixed by #2287

Comments

@Wondertan
Copy link
Contributor

After #1574, the Network is now responsible for emitting such events. However, only Swarm was updated to emit them, and the only second implementation, mocknet was not. There are projects in the ecosystem that uses mockent and for whom updating to v0.27 will break tests because of this.

Additionally, the tests that depend on swarm/testing will break as well due to the reason @vyzo mentioned in here. The user now has two instantiate the EventBus themselves and pass two both the host constructor and the GenSwarm, but if I understand correctly this is part of a larger issue #1993.

@marten-seemann
Copy link
Contributor

mocknet is unmaintained and only kept for backwards compatiblity. If you want to submit a fix though, I'd be happy to review.

@Wondertan
Copy link
Contributor Author

I am sure Lotus depends on it, and they will likely want to update to v0.27.

I can submit a patch but in weeks from now.

@Wondertan
Copy link
Contributor Author

Wondertan commented May 4, 2023

Why is it unmaintained?
Should we deprecate it and remove it in a few releases if it is unmaintained? Similar issues will likely happen in the future where mocknet is forgotten to be updated in a breaking way.

@MarcoPolo
Copy link
Collaborator

Thanks for the PR, I'll review :)

What do you think about a in-memory transport? It would let us run all the same code as normal, but use Go channels/runtime to do the actual network part of it. It'll probably behave more realistically and use less code than mocknet.

For prior art, rust-libp2p has an in-memory transport.

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 a pull request may close this issue.

3 participants