Commit 647ab174 authored by Cecile Tonglet's avatar Cecile Tonglet
Browse files

Merge commit 5bc94715 (no conflict)

parents 48983e74 5bc94715
This diff is collapsed.
......@@ -13,7 +13,7 @@ readme = "README.md"
[dependencies]
cli = { package = "polkadot-cli", path = "cli" }
color-eyre = "0.5.8"
color-eyre = "0.5.10"
thiserror = "1.0.22"
futures = "0.3.8"
service = { package = "polkadot-service", path = "node/service" }
......@@ -21,7 +21,7 @@ parity-util-mem = { version = "*", default-features = false, features = ["jemall
[dev-dependencies]
assert_cmd = "1.0.2"
nix = "0.19.0"
nix = "0.19.1"
tempfile = "3.1.0"
[workspace]
......
......@@ -16,9 +16,9 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
log = "0.4.11"
thiserror = "1.0.22"
structopt = { version = "0.3.20", optional = true }
wasm-bindgen = { version = "0.2.68", optional = true }
wasm-bindgen-futures = { version = "0.4.18", optional = true }
structopt = { version = "0.3.21", optional = true }
wasm-bindgen = { version = "0.2.69", optional = true }
wasm-bindgen-futures = { version = "0.4.19", optional = true }
service = { package = "polkadot-service", path = "../node/service", default-features = false, optional = true }
polkadot-parachain = { path = "../parachain", optional = true }
......
This diff is collapsed.
[package]
name = "erasure_coding_fuzzer"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
polkadot-erasure-coding = { path = ".." }
honggfuzz = "0.5"
primitives = { package = "polkadot-primitives", path = "../../primitives/" }
[[bin]]
name = "reconstruct_fuzzer"
path = "src/reconstruct.rs"
[[bin]]
name = "round_trip"
path = "src/round_trip.rs"
[workspace]
use polkadot_erasure_coding::*;
use primitives::v1::AvailableData;
use honggfuzz::fuzz;
fn main() {
loop {
fuzz!(|data: (usize, Vec<(Vec<u8>, usize)>)| {
let (num_validators, chunk_input) = data;
let reconstructed: Result<AvailableData, _> = reconstruct_v1(
num_validators,
chunk_input.iter().map(|t| (&*t.0, t.1)).collect::<Vec<(&[u8], usize)>>()
);
println!("reconstructed {:?}", reconstructed);
});
}
}
use polkadot_erasure_coding::*;
use primitives::v1::{AvailableData, BlockData, PoV};
use std::sync::Arc;
use honggfuzz::fuzz;
fn main() {
loop {
fuzz!(|data: &[u8]| {
let pov_block = PoV {
block_data: BlockData(data.iter().cloned().collect()),
};
let available_data = AvailableData {
pov: Arc::new(pov_block),
validation_data: Default::default(),
};
let chunks = obtain_chunks_v1(
10,
&available_data,
).unwrap();
assert_eq!(chunks.len(), 10);
// any 4 chunks should work.
let reconstructed: AvailableData = reconstruct_v1(
10,
[
(&*chunks[1], 1),
(&*chunks[4], 4),
(&*chunks[6], 6),
(&*chunks[9], 9),
].iter().cloned(),
).unwrap();
assert_eq!(reconstructed, available_data);
println!("{:?}", reconstructed);
});
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -14,4 +14,3 @@ polkadot-node-subsystem-util = { path = "../../subsystem-util" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
wasm-timer = "0.2.5"
thiserror = "1.0.22"
derive_more = "0.99.11"
This diff is collapsed.
......@@ -9,6 +9,9 @@ futures = "0.3.8"
tracing = "0.1.22"
tracing-futures = "0.2.4"
thiserror = "1.0.22"
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
polkadot-primitives = { path = "../../../primitives" }
polkadot-node-subsystem = { path = "../../subsystem" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
......
This diff is collapsed.
......@@ -36,7 +36,7 @@ use polkadot_subsystem::errors::RuntimeApiError;
use polkadot_node_primitives::{ValidationResult, InvalidCandidate};
use polkadot_primitives::v1::{
ValidationCode, PoV, CandidateDescriptor, PersistedValidationData,
OccupiedCoreAssumption, Hash, ValidationOutputs,
OccupiedCoreAssumption, Hash, CandidateCommitments,
};
use polkadot_parachain::wasm_executor::{
self, IsolationStrategy, ValidationError, InvalidCandidate as WasmInvalidCandidate
......@@ -458,7 +458,7 @@ fn validate_candidate_exhaustive<B: ValidationBackend, S: SpawnNamed + 'static>(
Ok(ValidationResult::Invalid(InvalidCandidate::ExecutionError(e.to_string()))),
Err(ValidationError::Internal(e)) => Err(ValidationFailed(e.to_string())),
Ok(res) => {
let outputs = ValidationOutputs {
let outputs = CandidateCommitments {
head_data: res.head_data,
upward_messages: res.upward_messages,
horizontal_messages: res.horizontal_messages,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment