From acb9170796c4c256c044683f71e4c62431d30a49 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Thu, 21 Oct 2021 17:44:27 +0800 Subject: [PATCH] Fix WASM Execution (#879) * Try Fix Pangoro Service * Bump Dependencies and Downgrade `parity-wasm` * Use `nightly-2021-04-22` Toolchain --- .github/workflows/ci.yml | 12 ++++++------ Cargo.lock | 30 ++++++++++++++--------------- node/service/src/service/pangoro.rs | 7 +++---- rust-toolchain.toml | 2 +- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a978c56e1..b72b26e2a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,10 @@ jobs: with: repository: l2ust/subalfred ref: main - - name: Install Rust nightly-2021-09-01 toolchain + - name: Install Rust nightly-2021-04-22 toolchain uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2021-09-01 + toolchain: nightly-2021-04-22 default: true - name: Build uses: actions-rs/cargo@v1 @@ -43,10 +43,10 @@ jobs: steps: - name: Fetch latest code uses: actions/checkout@v2 - - name: Install Rust nightly-2021-09-01 toolchain + - name: Install Rust nightly-2021-04-22 toolchain uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2021-09-01 + toolchain: nightly-2021-04-22 target: wasm32-unknown-unknown default: true - name: Run checker @@ -61,10 +61,10 @@ jobs: steps: - name: Fetch latest code uses: actions/checkout@v2 - - name: Install Rust nightly-2021-09-01 toolchain + - name: Install Rust nightly-2021-04-22 toolchain uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2021-09-01 + toolchain: nightly-2021-04-22 target: wasm32-unknown-unknown default: true - name: Build diff --git a/Cargo.lock b/Cargo.lock index ad9f7c471e..7a34378f09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -386,16 +386,16 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.61" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7a905d892734eea339e896738c14b9afce22b5318f64b951e70bf3844419b01" +checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152" dependencies = [ "addr2line 0.16.0", "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.26.2", + "object 0.27.0", "rustc-demangle", ] @@ -759,9 +759,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byte-slice-cast" @@ -5519,9 +5519,9 @@ dependencies = [ [[package]] name = "object" -version = "0.26.2" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f37e50073ccad23b6d09bcb5b263f4e76d3bb6038e4a3c08e52162ffa8abc2" +checksum = "c821014c18301591b89b843809ef953af9e3df0496c232d5c0611b0a52aac363" dependencies = [ "memchr", ] @@ -6889,9 +6889,9 @@ dependencies = [ [[package]] name = "pwasm-utils" -version = "0.18.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "880b3384fb00b8f6ecccd5d358b93bd2201900ae3daad213791d1864f6441f5c" +checksum = "a0e517f47d9964362883182404b68d0b6949382c0baa40aa5ffca94f5f1e3481" dependencies = [ "byteorder", "log", @@ -8796,9 +8796,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" [[package]] name = "simba" @@ -9171,8 +9171,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e80275f23b4e7ba8f54dec5f90f016530e7307d2ee9445f617ab986cbe97f31e" +source = "git+https://github.com/darwinia-network/substrate?tag=darwinia-v0.11.5#9c572625f6557dfdb19f47474369a0327d51dfbc" dependencies = [ "proc-macro2", "quote", @@ -9182,7 +9181,8 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/darwinia-network/substrate?tag=darwinia-v0.11.5#9c572625f6557dfdb19f47474369a0327d51dfbc" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e80275f23b4e7ba8f54dec5f90f016530e7307d2ee9445f617ab986cbe97f31e" dependencies = [ "proc-macro2", "quote", @@ -10595,7 +10595,7 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "rand 0.8.4", "static_assertions", ] diff --git a/node/service/src/service/pangoro.rs b/node/service/src/service/pangoro.rs index 59dc875dd4..c6055e9ad2 100644 --- a/node/service/src/service/pangoro.rs +++ b/node/service/src/service/pangoro.rs @@ -170,14 +170,15 @@ where select_chain.clone(), move |_, ()| async move { let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_duration( *timestamp, slot_duration, ); + let uncles = + sp_authorship::InherentDataProvider::<::Header>::check_inherents(); - Ok((timestamp, slot)) + Ok((timestamp, slot, uncles)) }, &task_manager.spawn_essential_handle(), config.prometheus_registry(), @@ -369,9 +370,7 @@ where &*client_clone, parent, )?; - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_duration( *timestamp, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9e780025ea..3d1fed582e 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2021-09-01" +channel = "nightly-2021-04-22" components = ["cargo", "clippy", "rustc", "rustfmt", "rust-src"] profile = "minimal" targets = ["wasm32-unknown-unknown"]