mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
Fix timer panics in the wasm light client (#4561)
* Make WASM browser thing compile * Fix * updated exit-future (github repo) * Switch to broadcast crate * Migrate client/cli * Switch exit-future to modernize branch * Small changes * Switch to cargo version and fix fg tests * fix basic-authorship * Fix crash on grafana macro * Fix grafana macro * Switch node python version * Disable record_metrics_slice in grafana macro on wasm * Update client/grafana-data-source/src/lib.rs * Revert "Update client/grafana-data-source/src/lib.rs" This reverts commit 888009a8e0b7051bd4bfbbfdb0448bcf2e2aae93. * Add wasm support for state machine * Switch to my own libp2p version * Revert "Switch to my own libp2p version" This reverts commit ce613871b59264b3165b45c37943e6560240daa7. * Revert "Add wasm support for state machine" This reverts commit de7eaa0694d9534fc3b164621737968e9a6a7c5f. * Add sc-browser * Squash * remove sc-browser * Fix keystore on wasm * stubs for removed functions to make env compatible with old runtimes * Add test (that doesn't work) * Fix build scripts * Revert basic-authorship due to no panics * Revert cli/informant * Revert consensus * revert offchain * Update utils/browser/Cargo.toml Co-Authored-By: Benjamin Kampmann <ben@gnunicorn.org> * export console functions * Add new chainspec * Fix ws in chain spec * revert chainspec * Fix chainspec * Use an Option<PathBuf> in keystore instead of cfg flags * Remove crud * Only use wasm-timer for instant and systemtime * Remove telemetry changes * Assuming this is ok * Add a KeystoreConfig * Add stubs back in * Update libp2p * Revert "Add stubs back in" This reverts commit 4690cf1882aa0f99f7f00a58c4080c8aa9b77c36. * Remove commented js again * Bump kvdb-web version * Fix cli * Switch branch on futures-timer * Fix tests * Remove sc-client test build in check-web-wasm because there isn't a good way to build futures-timer with wasm-bindgen support in the build * Remove more things ^^ * Switch branch on futures-timer back * Put DB io stats behind a cfg flag * Fix things * Don't timeout transports on wasm * Update branch of futures-timer and fix bad merge * Spawn informant * Fix network test * Fix delay resets * Changes * Fix tests * use wasm_timer for transaction pool * Fixes * Switch futures-timer to crates * Only diagnose futures on native * Fix sc-network-test tests * Select log level in js * Fix syncing ;^) * Allow disabling colours in the informant * Use OutputFormat enum for informant * MallocSizeOf impl on transaction pool broke stuff because wasm_timer::Instant doesnt impl it so just revert the transaction pool to master * Update futures-diagnose * Revert "MallocSizeOf impl on transaction pool broke stuff because wasm_timer::Instant doesnt impl it so just revert the transaction pool to master" This reverts commit baa4ffc94fd968b6660a2c17ba8113e06af15548. * Pass whole chain spec in start_client * Get Instant::now to work in transaction pool again * Informant dep reordering Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com> Co-authored-by: Demi Obenour <48690212+DemiMarie-parity@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
use futures01::sync::mpsc as mpsc01;
|
||||
use log::{debug, info};
|
||||
use std::sync::Arc;
|
||||
use service::{
|
||||
use sc_service::{
|
||||
AbstractService, RpcSession, Roles, Configuration, config::{DatabaseConfig, KeystoreConfig},
|
||||
ChainSpec, RuntimeGenesis
|
||||
};
|
||||
@@ -25,7 +25,7 @@ use wasm_bindgen::prelude::*;
|
||||
use futures::{prelude::*, channel::{oneshot, mpsc}, future::{poll_fn, ok}, compat::*};
|
||||
use std::task::Poll;
|
||||
use std::pin::Pin;
|
||||
use chain_spec::Extension;
|
||||
use sc_chain_spec::Extension;
|
||||
|
||||
pub use libp2p::wasm_ext::{ExtTransport, ffi::Transport};
|
||||
pub use console_error_panic_hook::set_once as set_console_error_panic_hook;
|
||||
@@ -46,7 +46,10 @@ where
|
||||
|
||||
let transport = ExtTransport::new(transport);
|
||||
let mut config = Configuration::default();
|
||||
config.network.transport = network::config::TransportConfig::Normal {
|
||||
config.network.boot_nodes = chain_spec.boot_nodes().to_vec();
|
||||
config.telemetry_endpoints = chain_spec.telemetry_endpoints().clone();
|
||||
config.chain_spec = Some(chain_spec);
|
||||
config.network.transport = sc_network::config::TransportConfig::Normal {
|
||||
wasm_external_transport: Some(transport.clone()),
|
||||
allow_private_ipv4: true,
|
||||
enable_mdns: false,
|
||||
@@ -82,6 +85,11 @@ struct RpcMessage {
|
||||
|
||||
/// Create a Client object that connects to a service.
|
||||
pub fn start_client(mut service: impl AbstractService) -> Client {
|
||||
// Spawn informant
|
||||
wasm_bindgen_futures::spawn_local(
|
||||
sc_informant::build(&service, sc_informant::OutputFormat::Plain).map(drop)
|
||||
);
|
||||
|
||||
// We dispatch a background task responsible for processing the service.
|
||||
//
|
||||
// The main action performed by the code below consists in polling the service with
|
||||
|
||||
Reference in New Issue
Block a user