From df3fef3fd911570cbb9a4485ba7c1e5949d5145c Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 19 Mar 2021 18:05:06 +0100 Subject: [PATCH] bump reed-solomon-novelpoly to v0.0.3 (#2650) --- polkadot/Cargo.lock | 36 ++++++++++++++++++++++++++++-- polkadot/erasure-coding/Cargo.toml | 2 +- polkadot/erasure-coding/src/lib.rs | 1 + 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index 99a7eb4498..7dfe23d9d7 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -772,6 +772,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chacha20" version = "0.4.3" @@ -6867,13 +6873,14 @@ dependencies = [ [[package]] name = "reed-solomon-novelpoly" -version = "0.0.1" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886177a67de8d452f8955a5a1c70f9064e644bcf1862e8bcc3a68064014369be" +checksum = "f11e01a8ef53ec033daf53a9385a1d0bb266155797919096e4134118f45efe82" dependencies = [ "derive_more", "fs-err", "itertools 0.10.0", + "static_init", "thiserror", ] @@ -9186,6 +9193,31 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "static_init" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11b73400442027c4adedda20a9f9b7945234a5bd8d5f7e86da22bd5d0622369c" +dependencies = [ + "cfg_aliases", + "libc", + "parking_lot 0.11.1", + "static_init_macro", +] + +[[package]] +name = "static_init_macro" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2261c91034a1edc3fc4d1b80e89d82714faede0515c14a75da10cb941546bbf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "statrs" version = "0.12.0" diff --git a/polkadot/erasure-coding/Cargo.toml b/polkadot/erasure-coding/Cargo.toml index 5fb462ca00..c1ea7f33fb 100644 --- a/polkadot/erasure-coding/Cargo.toml +++ b/polkadot/erasure-coding/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] primitives = { package = "polkadot-primitives", path = "../primitives" } -novelpoly = { package = "reed-solomon-novelpoly", version = "=0.0.1" } +novelpoly = { package = "reed-solomon-novelpoly", version = "=0.0.3" } parity-scale-codec = { version = "2.0.0", default-features = false, features = ["std", "derive"] } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/polkadot/erasure-coding/src/lib.rs b/polkadot/erasure-coding/src/lib.rs index dd1dd87cc0..314ec483e5 100644 --- a/polkadot/erasure-coding/src/lib.rs +++ b/polkadot/erasure-coding/src/lib.rs @@ -216,6 +216,7 @@ fn reconstruct<'a, I: 'a, T: Decode>(n_validators: usize, chunks: I) -> Result return Err(Error::TooManyValidators), novelpoly::Error::WantedShardCountTooLow(_) => return Err(Error::NotEnoughValidators), novelpoly::Error::PayloadSizeIsZero { .. } => return Err(Error::BadPayload), + novelpoly::Error::InconsistentShardLengths { .. } => return Err(Error::NonUniformChunks), _ => return Err(Error::UnknownReconstruction), } Ok(payload_bytes) => payload_bytes,