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

Prefer tokio runtime everywhere #4449

Open
Tracked by #3515
thomaseizinger opened this issue Sep 5, 2023 · 3 comments
Open
Tracked by #3515

Prefer tokio runtime everywhere #4449

thomaseizinger opened this issue Sep 5, 2023 · 3 comments

Comments

@thomaseizinger
Copy link
Contributor

Description

Historically, examples and tests in rust-libp2p have used a mix of the async-std and tokio runtime. These days, both runtimes are equally well supported by the library but the examples and tests are still mixed. For now, we want to keep supporting async-std but all examples and tests should use the tokio runtime.

Motivation

The tokio runtime is much more well established and better maintained. Users should be able to use other runtimes or bring their own.

Current Implementation

Both runtimes are being mixed.

mergify bot pushed a commit that referenced this issue Sep 23, 2023
mergify bot pushed a commit that referenced this issue Oct 1, 2023
Changed the `autonat` example to use `tokio` instead of `async-std` as runtime.

Related: #4449.

Pull-Request: #4574.
mergify bot pushed a commit that referenced this issue Oct 3, 2023
mergify bot pushed a commit that referenced this issue Oct 4, 2023
mergify bot pushed a commit that referenced this issue Oct 5, 2023
mergify bot pushed a commit that referenced this issue Feb 29, 2024
guillaumemichel pushed a commit that referenced this issue Mar 28, 2024
@P1R
Copy link
Contributor

P1R commented Aug 9, 2024

I want to work on this issue since it will help me to understand more the project, and test my nodes environment.
So far I identified the missing files and examples to be able to solve this issue.

Refactor Examples

  • relay-server
  • distributed-key-value-store
  • identify
  • rendezvous

Tests

test are located in the tests directory of each item

  • transports/quic(smoke.rs and stream_compliance.rs)
  • protocols/dcutr(lib.rs)
  • protocols/ping(ping.rs)
  • protocols/gossipsub(smoke.rs)
  • protocols/autonat(test_client.rs, test_server.rs)
  • protocols/mdns(use-async-std.rs)
  • protocols/identify(smoke.rs)
  • protocols/relay(lib.rs)
  • protocols/kad(client_mode.rs)
  • protocols/request-response(peer_address.rs, ping.rs, error_reporting.rs)
  • swarm(connection_close.rs, listen.rs)
  • core(transport_upgrade.rs)
  • muxers/yamux(compliance.rs)
  • muxers/mplex(compliance.rs)

Tutorials New Issue

Update issue #5559
examples/ping already has the tokio implementation, but the Tutorial has the async-std so I am not sure if this can be added or as a separate issue?

  • src/tutorials/ping.rs)

@jxs
Copy link
Member

jxs commented Aug 10, 2024

thanks @P1R!

mergify bot added a commit that referenced this issue Aug 30, 2024
## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->
Following on issue #4449 
refactor: remove unnecesary dependencies rendezvous example (async-std)
## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->
in the rendezvous example there where unnecessary dependencies in the
Cargo.toml

## Change checklist

* Removed unnecessary dependencies on examples/rendezvous/Cargo.toml

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] 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

Co-authored-by: David E. Perez Negron R. <david@nethunters.xyz>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
mergify bot pushed a commit that referenced this issue Sep 3, 2024
#5579)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->
Following on issue #4449 
refactor: use tokio instead of async-std in the identify example and
remove unnecesary dependencies

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

* Removed unnecessary dependencies on examples/identify/Cargo.toml

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] 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

---------

Co-authored-by: David E. Perez Negron R. <david@nethunters.xyz>
Co-authored-by: Darius Clark <dariusc93@users.noreply.github.com>
TimTinkers pushed a commit to unattended-backpack/rust-libp2p that referenced this issue Sep 14, 2024
Solves issue libp2p#5554 also referenced first in libp2p#4449

Pull-Request: libp2p#5559.
TimTinkers pushed a commit to unattended-backpack/rust-libp2p that referenced this issue Sep 14, 2024
## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->
Following on issue libp2p#4449 
refactor: remove unnecesary dependencies rendezvous example (async-std)
## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->
in the rendezvous example there where unnecessary dependencies in the
Cargo.toml

## Change checklist

* Removed unnecessary dependencies on examples/rendezvous/Cargo.toml

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] 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

Co-authored-by: David E. Perez Negron R. <david@nethunters.xyz>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
TimTinkers pushed a commit to unattended-backpack/rust-libp2p that referenced this issue Sep 14, 2024
libp2p#5579)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->
Following on issue libp2p#4449 
refactor: use tokio instead of async-std in the identify example and
remove unnecesary dependencies

## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->

## Change checklist

* Removed unnecessary dependencies on examples/identify/Cargo.toml

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] 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

---------

Co-authored-by: David E. Perez Negron R. <david@nethunters.xyz>
Co-authored-by: Darius Clark <dariusc93@users.noreply.github.com>
mergify bot pushed a commit that referenced this issue Oct 4, 2024
…5600)

## Description

<!--
Please write a summary of your changes and why you made them.
This section will appear as the commit message after merging.
Please craft it accordingly.
For a quick primer on good commit messages, check out this blog post:
https://cbea.ms/git-commit/

Please include any relevant issues in here, for example:

Related https://github.com/libp2p/rust-libp2p/issues/ABCD.
Fixes https://github.com/libp2p/rust-libp2p/issues/XYZ.
-->
Following on issue #4449 
refactor: use tokio instead of async-std in the relay-servert example
and remove unnecessary dependencies
## Notes & open questions

<!--
Any notes, remarks or open questions you have to make about the PR which
don't need to go into the final commit message.
-->
Fails on testing with the [whole punch
tutorial](https://docs.rs/libp2p/0.54.1/libp2p/tutorials/hole_punching/index.html)
possibly because of my networking topology. connection established event
registered.

I will publish the logs and testing information as a comment 

## Change checklist
* Removed unnecessary dependencies on examples/relay-server/Cargo.toml
* Updated tokio version  to "1.37.0"
<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [ ] 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

---------

Co-authored-by: David E. Perez Negron R. <david@nethunters.xyz>
Co-authored-by: Guillaume Michel <guillaumemichel@users.noreply.github.com>
Co-authored-by: João Oliveira <hello@jxs.pt>
mergify bot pushed a commit that referenced this issue Oct 29, 2024
## Description

ref #4449 

Refactored distributed-key-value-store example to use `tokio` instead of
`async-std`

## Change checklist

<!-- Please add a Changelog entry in the appropriate crates and bump the
crate versions if needed. See
<https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md#development-between-releases>-->

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates
mergify bot pushed a commit that referenced this issue Oct 30, 2024
## Description

ref #4449 

Refactored ping tests to use `tokio` instead of `async-std`.

## Change checklist

- [x] I have performed a self-review of my own code
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] A changelog entry has been made in the appropriate crates
mergify bot pushed a commit that referenced this issue Nov 18, 2024
## Description

ref #4449 

Refactored `autonat` tests to use `tokio` instead of `async-std`.
@jxs
Copy link
Member

jxs commented Nov 21, 2024

with rust-netlink/netlink-sys#24 (comment) breaking our CI I'd say we should accelerate and make deprecation of async-std official, wdyt @guillaumemichel @dariusc93 @elenaf9 @drHuangMHT

mergify bot pushed a commit that referenced this issue Nov 21, 2024
ref #4449

Refactored dcutr and gossipsub tests to use `tokio` instead of `async-std`.

Pull-Request: #5662.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants