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

Smoldot freezes browser UI on sync finish #2786

Closed
tuul-wq opened this issue Sep 27, 2022 · 3 comments · Fixed by #2803
Closed

Smoldot freezes browser UI on sync finish #2786

tuul-wq opened this issue Sep 27, 2022 · 3 comments · Fixed by #2803

Comments

@tuul-wq
Copy link

tuul-wq commented Sep 27, 2022

In our SPA we use @polkadot/rpc-provider^9.4.2 to connect 3 ScProviders
During the connection UI works fine, but just before sync finished message in console we face a 1.2 second freeze.
This happens every time when sync finished for 3 chains that we connect with ScProvider - Polkadot, Kusama, Westend.
We're not sending any requests to ScProvider, it just works by itself.
I recorded performance check in Chrome and saw a long wasm function execution

(func $func5418 (param $var0 i32) (param $var1 i32)
    (local $var2 i32) (local $var3 i32) (local $var4 i32) (local $var5 i64)

image

Log message example: [sync-service-polkadot] GrandPa warp sync finished to #12229848 (0xea75…6e7b)
smoldot version 0.6.34

@tomaka
Copy link
Contributor

tomaka commented Sep 28, 2022

This is most likely the time it takes to verify the finality proofs.

While there's a "CPU limiter" in place, I suspect that it doesn't work because the inner FuturesUnordered immediately re-polls futures that are woken up during their execution.

@tomaka
Copy link
Contributor

tomaka commented Sep 29, 2022

cc rust-lang/futures-rs#2053

@tuul-wq
Copy link
Author

tuul-wq commented Oct 3, 2022

@tomaka thanks for the fix, can't wait to see it merged and released ☺️

@mergify mergify bot closed this as completed in #2803 Oct 4, 2022
mergify bot added a commit that referenced this issue Oct 4, 2022
Fix #2786

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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.

2 participants