From f1b6c48987fa207f2097e75fbeeb5402b3f90b55 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 00:32:16 +0700 Subject: [PATCH] chore(deps): update rust crate multihash to 0.19.1 (#748) * chore(deps): update rust crate multihash to 0.19.1 * Coordinated update of `cid` and `multihash` crates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ivan Boldyrev --- Cargo.lock | 184 +++++++++++++++---- crates/air-lib/interpreter-cid/Cargo.toml | 8 +- crates/air-lib/interpreter-cid/src/lib.rs | 2 +- crates/air-lib/interpreter-cid/src/verify.rs | 11 +- 4 files changed, 166 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a04d3789..a52ff563 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,7 +99,8 @@ dependencies = [ "blake3", "cid", "digest 0.10.7", - "multihash 0.18.1", + "multihash 0.19.1", + "multihash-codetable", "serde", "serde_json", "sha2 0.10.7", @@ -1127,15 +1128,14 @@ dependencies = [ [[package]] name = "cid" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" +checksum = "472ac98592f38dfd48f188d5713a328422ed22fa39eb52b8bca495370134762a" dependencies = [ "core2", "multibase", - "multihash 0.18.1", - "serde", - "unsigned-varint", + "multihash 0.19.1", + "unsigned-varint 0.8.0", ] [[package]] @@ -1166,7 +1166,7 @@ checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "bitflags 1.3.2", "clap_lex 0.2.4", - "indexmap", + "indexmap 1.9.3", "textwrap 0.16.0", ] @@ -1937,6 +1937,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.2" @@ -2308,7 +2314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] @@ -2330,7 +2336,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -2361,6 +2367,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "heck" version = "0.3.3" @@ -2601,6 +2613,16 @@ dependencies = [ "serde", ] +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + [[package]] name = "instant" version = "0.1.12" @@ -2830,7 +2852,7 @@ dependencies = [ "ed25519-dalek", "libsecp256k1", "log", - "multihash 0.19.0", + "multihash 0.19.1", "quick-protobuf", "rand 0.8.5", "ring", @@ -3322,29 +3344,73 @@ dependencies = [ "blake3", "core2", "digest 0.10.7", - "multihash-derive", + "multihash-derive 0.8.0", "sha2 0.10.7", "sha3", - "unsigned-varint", + "unsigned-varint 0.7.1", ] [[package]] name = "multihash" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd59dcc2bbe70baabeac52cd22ae52c55eefe6c38ff11a9439f16a350a939f2" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" dependencies = [ "core2", - "unsigned-varint", + "unsigned-varint 0.7.1", +] + +[[package]] +name = "multihash-codetable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d815ecb3c8238d00647f8630ede7060a642c9f704761cd6082cb4028af6935" +dependencies = [ + "blake2b_simd 1.0.1", + "blake2s_simd", + "blake3", + "core2", + "digest 0.10.7", + "multihash-derive 0.9.0", + "ripemd", + "sha1", + "sha2 0.10.7", + "sha3", + "strobe-rs", ] [[package]] name = "multihash-derive" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "multihash-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "890e72cb7396cb99ed98c1246a97b243cc16394470d94e0bc8b0c2c11d84290e" +dependencies = [ + "core2", + "multihash 0.19.1", + "multihash-derive-impl", +] + +[[package]] +name = "multihash-derive-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38685e08adb338659871ecfc6ee47ba9b22dcc8abcf6975d379cc49145c3040" +dependencies = [ + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", @@ -3872,7 +3938,7 @@ checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "crc32fast", "hashbrown 0.12.3", - "indexmap", + "indexmap 1.9.3", "memchr", ] @@ -3991,7 +4057,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -4082,7 +4148,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -4255,12 +4321,12 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "thiserror", - "toml", + "once_cell", + "toml_edit", ] [[package]] @@ -4907,7 +4973,7 @@ dependencies = [ "base64 0.13.1", "chrono", "hex 0.4.3", - "indexmap", + "indexmap 1.9.3", "serde", "serde_json", "serde_with_macros", @@ -4926,6 +4992,17 @@ dependencies = [ "syn 2.0.29", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.9.9" @@ -5098,6 +5175,19 @@ dependencies = [ "precomputed-hash", ] +[[package]] +name = "strobe-rs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabb238a1cccccfa4c4fb703670c0d157e1256c1ba695abf1b93bd2bb14bab2d" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "keccak", + "subtle", + "zeroize", +] + [[package]] name = "strsim" version = "0.10.0" @@ -5430,6 +5520,23 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -5574,6 +5681,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +[[package]] +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" + [[package]] name = "untrusted" version = "0.7.1" @@ -5888,7 +6001,7 @@ version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" dependencies = [ - "indexmap", + "indexmap 1.9.3", "url", ] @@ -5898,7 +6011,7 @@ version = "0.101.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf2f22ef84ac5666544afa52f326f13e16f3d019d2e61e704fd8091c9358b130" dependencies = [ - "indexmap", + "indexmap 1.9.3", "url", ] @@ -5911,7 +6024,7 @@ dependencies = [ "anyhow", "bincode", "cfg-if 1.0.0", - "indexmap", + "indexmap 1.9.3", "libc", "log", "object 0.29.0", @@ -5990,7 +6103,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli 0.26.2", - "indexmap", + "indexmap 1.9.3", "log", "object 0.29.0", "serde", @@ -6056,7 +6169,7 @@ dependencies = [ "anyhow", "cc", "cfg-if 1.0.0", - "indexmap", + "indexmap 1.9.3", "libc", "log", "mach", @@ -6386,6 +6499,15 @@ version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" +[[package]] +name = "winnow" +version = "0.5.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e87b8dfbe3baffbe687eef2e164e32286eff31a5ee16463ce03d991643ec94" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" diff --git a/crates/air-lib/interpreter-cid/Cargo.toml b/crates/air-lib/interpreter-cid/Cargo.toml index 3f0ef2af..6daa2653 100644 --- a/crates/air-lib/interpreter-cid/Cargo.toml +++ b/crates/air-lib/interpreter-cid/Cargo.toml @@ -11,8 +11,8 @@ keywords = ["fluence", "air", "programming-language", "cid", "ipld"] categories = ["wasm"] [dependencies] -cid = { version = "0.10.1", default-features = false, features = ["std"] } -multihash = { version = "0.18.1", default-features = false, features = ["multihash-impl", "std", "sha2", "blake3"] } +cid = { version = "0.11.0", default-features = false, features = ["std"] } +multihash = { version = "0.19.1" } serde = { version = "1.0.190", features = ["derive", "rc"] } serde_json = "1.0.95" thiserror = "1.0.49" @@ -21,3 +21,7 @@ thiserror = "1.0.49" digest = "0.10.7" sha2 = "0.10.7" blake3 = { version = "1.5.0", features = ["traits-preview"] } +multihash-codetable = { version = "0.1.1", features = ["blake3", "sha2", "digest"] } + +[dev-dependencies] +multihash-codetable = { version = "0.1.1", features = ["ripemd"] } diff --git a/crates/air-lib/interpreter-cid/src/lib.rs b/crates/air-lib/interpreter-cid/src/lib.rs index 742752c8..e3a6d3ce 100644 --- a/crates/air-lib/interpreter-cid/src/lib.rs +++ b/crates/air-lib/interpreter-cid/src/lib.rs @@ -125,7 +125,7 @@ pub fn value_to_json_cid( value: &Val, ) -> Result, CidCalculationError> { use cid::Cid; - use multihash::{Code, MultihashDigest}; + use multihash_codetable::{Code, MultihashDigest}; let hash = value_json_hash::(value)?; diff --git a/crates/air-lib/interpreter-cid/src/verify.rs b/crates/air-lib/interpreter-cid/src/verify.rs index 434151c3..e54e9b19 100644 --- a/crates/air-lib/interpreter-cid/src/verify.rs +++ b/crates/air-lib/interpreter-cid/src/verify.rs @@ -55,11 +55,11 @@ pub fn verify_value( } fn verify_json_value( - mhash: &multihash::Multihash, + mhash: &multihash_codetable::Multihash, value: &Val, cid: &CID, ) -> Result<(), CidVerificationError> { - use multihash::Code; + use multihash_codetable::Code; let raw_code = mhash.code(); let code: Code = raw_code @@ -200,17 +200,18 @@ mod tests { #[test] fn test_verify_unsupported_hasher() { + use multihash_codetable::Code; use std::str::FromStr; // we have no plan to support it, but it may change, and the test should be corrected - let identity_code: u64 = multihash::Code::Identity.into(); + let ripemd160_code: u64 = Code::Ripemd160.into(); let cid_1 = cid::Cid::from_str("bagaaieranodle477gt6odhllqbhp6wr7k5d23jhkuixr2soadzjn3n4hlnfq") .unwrap(); let unknown_hasher_multihash = - Multihash::wrap(identity_code, cid_1.hash().digest()).unwrap(); + Multihash::wrap(ripemd160_code, cid_1.hash().digest()).unwrap(); let unknown_hasher_cid = cid::Cid::new(cid::Version::V1, JSON_CODEC, unknown_hasher_multihash).unwrap(); @@ -219,7 +220,7 @@ mod tests { let err = verify_value(&unknown_hasher_cid, &json!(1)); match err { Err(CidVerificationError::UnsupportedHashCode(code)) => { - assert_eq!(code, identity_code); + assert_eq!(code, ripemd160_code); } _ => panic!("wrong result: {:?}", err), }