Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Fix timer panics in the wasm light client #4561

Merged
merged 144 commits into from
Feb 10, 2020
Merged

Conversation

expenses
Copy link
Contributor

@expenses expenses commented Jan 7, 2020

Last change to get light clients to work 🎉! This PR relies on @tomaka 's wasm-timer crate, but only for replacements for std::time::Instant and std::time::SystemTime.

Waiting on async-rs/futures-timer#51.

tomaka and others added 30 commits November 20, 2019 16:47
@expenses
Copy link
Contributor Author

expenses commented Feb 6, 2020

On ice as we're waiting for libp2p/rust-libp2p#1414.

@expenses expenses removed the A3-in_progress Pull request is in progress. No review needed at this stage. label Feb 6, 2020
@tomaka
Copy link
Contributor

tomaka commented Feb 6, 2020

Why not merge this? It's basically ready.

Copy link

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried the wasm node and it works well.

@expenses expenses requested a review from tomaka February 7, 2020 00:38
@expenses
Copy link
Contributor Author

expenses commented Feb 7, 2020

@tomaka it say that you've still got requested changes apparently.

@@ -16,3 +16,4 @@ sc-network = { version = "0.8", path = "../network" }
sc-service = { version = "0.8", default-features = false, path = "../service" }
sp-blockchain = { version = "2.0.0", path = "../../primitives/blockchain" }
sp-runtime = { version = "2.0.0", path = "../../primitives/runtime" }
parity-util-mem = { version = "0.5.1", default-features = false, features = ["primitive-types"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could you order alphabetically?

@expenses expenses requested a review from tomaka February 7, 2020 21:12
@@ -982,6 +983,10 @@ ServiceBuilder<
"disk_read_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_read).unwrap_or(0),
"disk_write_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_written).unwrap_or(0),
);
#[cfg(not(target_os = "unknown"))]
Copy link
Contributor

@tomaka tomaka Feb 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that now needed?
Also, why not merge the PR when I approved it, instead of sneaking in more and more amendments that need a re-review?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because if I did that, it would have panicked when you started the light client. We now need to do it this way because you can't call parity_util_mem::malloc_size on wasm because wasm_timer::wasm::Instant doesn't impl MallocSizeOf.

Copy link
Contributor

@tomaka tomaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x

Copy link
Contributor

@tomaka tomaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must admit that I'm a bit tired of this PR and agree that we should just merge it.
The #[cfg] blocks reaaally should be removed sooner or later though.

@expenses expenses merged commit ae03ee9 into master Feb 10, 2020
@expenses expenses deleted the ashley-polkadot-wasm branch February 10, 2020 11:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants