From d65717bd6d0c172247c37dd23395c9fb13b2ba20 Mon Sep 17 00:00:00 2001 From: Leon Tan Date: Tue, 22 Oct 2024 18:03:06 +0200 Subject: [PATCH] fix(sdk): Asset evidence computation reproducibility fix (#3958) * Use different gzip backend * Reintroduce `zlib-ng` in build-dependencies --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- src/canisters/frontend/ic-asset/src/evidence/mod.rs | 3 ++- src/dfx-core/Cargo.toml | 2 +- src/dfx/Cargo.toml | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae2d90d494..0da609f011 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1008,9 +1008,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" dependencies = [ "cc", ] @@ -3928,9 +3928,9 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.15" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5" +checksum = "4436751a01da56f1277f323c80d584ffad94a3d14aecd959dd0dff75aa73a438" dependencies = [ "cmake", "libc", diff --git a/Cargo.toml b/Cargo.toml index 294413dedd..44f79885b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ clap = "4.5" clap_complete = "4.5" dialoguer = "0.11.0" directories-next = "2.0.0" -flate2 = { version = "1.0.11", default-features = false } +flate2 = { version = "1.0.11" } futures = "0.3.21" handlebars = "4.3.3" hex = "0.4.3" diff --git a/src/canisters/frontend/ic-asset/src/evidence/mod.rs b/src/canisters/frontend/ic-asset/src/evidence/mod.rs index 7d73dbbf1d..28ac3d8d34 100644 --- a/src/canisters/frontend/ic-asset/src/evidence/mod.rs +++ b/src/canisters/frontend/ic-asset/src/evidence/mod.rs @@ -17,7 +17,7 @@ use crate::error::HashContentError::EncodeContentFailed; use crate::sync::gather_asset_descriptors; use ic_utils::Canister; use sha2::{Digest, Sha256}; -use slog::{info, Logger}; +use slog::{info, trace, Logger}; use std::collections::{BTreeMap, HashMap}; use std::path::Path; @@ -68,6 +68,7 @@ pub async fn compute_evidence( .await .map_err(ComputeEvidenceError::AssembleCommitBatchArgumentFailed)?; operations.sort(); + trace!(logger, "{:#?}", operations); let mut sha = Sha256::new(); for op in operations { diff --git a/src/dfx-core/Cargo.toml b/src/dfx-core/Cargo.toml index 930f491c9e..5bbfec0a45 100644 --- a/src/dfx-core/Cargo.toml +++ b/src/dfx-core/Cargo.toml @@ -22,7 +22,7 @@ clap = { workspace = true, features = ["string"] } dialoguer = { workspace = true } directories-next.workspace = true dunce = "1.0" -flate2 = { workspace = true, default-features = false, features = ["zlib-ng"] } +flate2 = { workspace = true } handlebars.workspace = true hex = { workspace = true, features = ["serde"] } humantime-serde = "1.1.1" diff --git a/src/dfx/Cargo.toml b/src/dfx/Cargo.toml index c41f86f13b..3fd8b6aeb8 100644 --- a/src/dfx/Cargo.toml +++ b/src/dfx/Cargo.toml @@ -55,7 +55,7 @@ ctrlc = { version = "3.2.1", features = ["termination"] } dfx-core.workspace = true dialoguer = { workspace = true, features = ["fuzzy-select"] } directories-next.workspace = true -flate2 = { workspace = true, default-features = false, features = ["zlib-ng"] } +flate2 = { workspace = true } fn-error-context = "0.2.0" futures-util = "0.3.21" futures.workspace = true