-
Notifications
You must be signed in to change notification settings - Fork 1.1k
WASM regression: Usage of std::time::Instant #2134
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
Comments
We will need an update of
EDIT: And here is the changes needed: tomaka/wasm-timer#17 |
Fixed by #2245. However, I am still worried about this import in Kadmelia in "master" (f701b24 at the time). rust-libp2p/protocols/kad/src/kbucket.rs Line 80 in f701b24
rust-libp2p/protocols/kad/src/kbucket.rs Line 721 in f701b24
I might be missing something, but it seems to me, that KAD should be WASM-compatible, and the other inner modules seems to use a correct instant::Intant import. May @wngr could enlighten this ? |
From what I see this is only used in a test, that's why I didn't change it. Should have changed the import scope, though. |
Oh you're right, I missed the |
While creating my custom node based on rust-libp2p, I rediscovered some uses of
std::time::Instant
in the Gossipsub and Kadmelia modules. As previously done by the PR #1071 (issue #900), the remainingstd::time::Instant
should again be replaced withwasm_timer::Instant
to allow Wasm compatibility.The spotted ones:
rust-libp2p/protocols/gossipsub/src/time_cache.rs
Line 29 in ee11922
rust-libp2p/protocols/gossipsub/src/peer_score.rs
Line 30 in ee11922
rust-libp2p/protocols/mdns/src/behaviour.rs
Line 45 in ee11922
rust-libp2p/protocols/kad/src/kbucket.rs
Line 80 in ee11922
The text was updated successfully, but these errors were encountered: