-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix timer panics in the wasm light client #4561
Conversation
… ashley-polkadot-wasm
On ice as we're waiting for libp2p/rust-libp2p#1414. |
Why not merge this? It's basically ready. |
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.
I tried the wasm node and it works well.
…:Instant doesnt impl it so just revert the transaction pool to master
@tomaka it say that you've still got requested changes apparently. |
client/informant/Cargo.toml
Outdated
@@ -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"] } |
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.
Nit: could you order alphabetically?
…m_timer::Instant doesnt impl it so just revert the transaction pool to master" This reverts commit baa4ffc.
@@ -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"))] |
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.
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?
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.
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
.
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.
x
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.
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.
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
andstd::time::SystemTime
.Waiting on async-rs/futures-timer#51.