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

Use wasm-builder from git #3354

Merged
merged 4 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bridges/bin/millau/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" ,
sp-version = { git = "https://github.com/paritytech/substrate", branch = "master" , default-features = false }

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/rialto/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", branch = "master
libsecp256k1 = { version = "0.3.4", features = ["hmac"] }

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = ["std"]
Expand Down
1 change: 1 addition & 0 deletions node/core/pvf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-wasm-interface = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-maybe-compressed-blob = { git = "https://github.com/paritytech/substrate", branch = "master" }

[dev-dependencies]
adder = { package = "test-parachain-adder", path = "../../../parachain/test-parachains/adder" }
Expand Down
4 changes: 3 additions & 1 deletion node/core/pvf/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ pub fn validate_candidate(
) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
use crate::executor_intf::{prevalidate, prepare, execute, TaskExecutor};

let blob = prevalidate(code)?;
let code = sp_maybe_compressed_blob::decompress(code, 10 * 1024 * 1024).expect("Decompressing code failed");

let blob = prevalidate(&*code)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this explicit deref ?

let artifact = prepare(blob)?;
let executor = TaskExecutor::new()?;
let result = unsafe {
Expand Down
9 changes: 5 additions & 4 deletions node/core/pvf/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

use polkadot_node_core_pvf::{Pvf, ValidationHost, start, Config, InvalidCandidate, ValidationError};
use polkadot_parachain::{
primitives::{BlockData, ValidationParams, ValidationResult},
};
use polkadot_parachain::primitives::{BlockData, ValidationParams, ValidationResult};
use parity_scale_codec::Encode as _;
use async_std::sync::Mutex;

Expand Down Expand Up @@ -58,11 +56,14 @@ impl TestHost {
params: ValidationParams,
) -> Result<ValidationResult, ValidationError> {
let (result_tx, result_rx) = futures::channel::oneshot::channel();

let code = sp_maybe_compressed_blob::decompress(code, 16 * 1024 * 1024).expect("Compression works");

self.host
.lock()
.await
.execute_pvf(
Pvf::from_code(code.to_vec()),
Pvf::from_code(code.into()),
params.encode(),
polkadot_node_core_pvf::Priority::Normal,
result_tx,
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/adder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dlmalloc = { version = "0.2.1", features = [ "global" ] }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = [ "disable_allocator" ] }

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = [ "std" ]
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/halt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build = "build.rs"
[dependencies]

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = [ "std" ]
Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ separator = "0.4.1"
serde_json = "1.0.61"

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ serde_json = "1.0.61"
separator = "0.4.1"

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pallet-bridge-grandpa = { path = "../../bridges/modules/grandpa", default-featur
max-encoded-len = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
serde_json = "1.0.61"

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
serde_json = "1.0.61"

[build-dependencies]
substrate-wasm-builder = "3.0.0"
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = ["std"]
Expand Down