-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add ClientOptions.cpuRateLimit #2151
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.
twiggy diff reportDifference in .wasm size before and after this pull request.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
// We add a small zero-cost shim to ensure at compile time that this is indeed the case. | ||
fn enforce_fused<T: futures::future::FusedFuture>(_: &T) {} | ||
enforce_fused(&this.prevent_poll_until); | ||
match Future::poll(this.prevent_poll_until.as_mut(), cx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpik: since we're interested in only one arm
match Future::poll(this.prevent_poll_until.as_mut(), cx) { | |
if let Poll::Pending = Future::poll(this.prevent_poll_until.as_mut(), cx) { |
Adding an option to limit the amount of CPU consumed by smoldot.
Warp syncing a long chain such as Kusama can use a lot of CPU for up to 10-15 seconds, and we'd rather not have a web page or the substrate-connect extension use up an entire CPU for this long, as it tends to cause systems to freeze.
After this change is merged and published, I'd cap the CPU to 50% in substrate-connect.