From 322da7242b1e565e625eb1fb67284646388b2735 Mon Sep 17 00:00:00 2001 From: Arthur Carcano Date: Tue, 28 Apr 2026 17:56:03 +0200 Subject: [PATCH] Post review fixes --- Cargo.lock | 2 +- Cargo.toml | 3 ++- fuzz/Cargo.toml | 4 ++-- fuzz/fuzz_targets/mpu_crdt.rs | 5 +---- src/model/s3/version_table.rs | 1 - src/util/crdt/lww.rs | 5 ----- 6 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e5d4211..0294a62c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1133,7 +1133,7 @@ checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.114", + "syn 2.0.117", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d6876b15..3ff6d5a0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ k2v-client = { version = "0.0.4", path = "src/k2v-client" } # External crates from crates.io arc-swap = "1.8" -arbitrary = { version = "1.4.2", features = ["derive"] } +arbitrary = { version = "1.4.2"} argon2 = "0.5" async-trait = "0.1" backtrace = "0.3" @@ -61,6 +61,7 @@ hmac = "0.12" itertools = "0.14" ipnet = "2.11" lazy_static = "1.5" +libfuzzer-sys = "0.4" md-5 = "0.10" mktemp = "0.5" nix = { version = "0.31", default-features = false, features = ["fs"] } diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 899416e5..92c81409 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -8,8 +8,8 @@ edition = "2018" cargo-fuzz = true [dependencies] -arbitrary = { version = "1.4.2", features = ["derive"] } -libfuzzer-sys = "0.4" +arbitrary = { workspace = true, features = ["derive"]} +libfuzzer-sys = { workspace = true } [dependencies.garage_table] path = "../src/table" diff --git a/fuzz/fuzz_targets/mpu_crdt.rs b/fuzz/fuzz_targets/mpu_crdt.rs index b3e5130e..82d6b613 100644 --- a/fuzz/fuzz_targets/mpu_crdt.rs +++ b/fuzz/fuzz_targets/mpu_crdt.rs @@ -6,13 +6,10 @@ use libfuzzer_sys::fuzz_target; /// Build a MultipartUpload from an arbitrary deleted flag and parts list, using a fixed /// upload_id/bucket_id/key so that CRDT state can be compared across merge results. -/// Duplicate part keys are dropped before construction. /// `MpuPart.version` is fixed to a constant since it is identity data, not CRDT state: /// two replicas of the same part (same MpuPartKey) always share the same version UUID. /// If deleted, parts are cleared to ensure a valid initial CRDT state. -fn make_mpu(deleted: bool, mut parts: Vec<(MpuPartKey, MpuPart)>) -> MultipartUpload { - parts.sort_by_key(|(k, _)| *k); - parts.dedup_by_key(|(k, _)| *k); +fn make_mpu(deleted: bool, parts: Vec<(MpuPartKey, MpuPart)>) -> MultipartUpload { let mut mpu = MultipartUpload::new( [0u8; 32].into(), 0, diff --git a/src/model/s3/version_table.rs b/src/model/s3/version_table.rs index 13a37166..5124f556 100644 --- a/src/model/s3/version_table.rs +++ b/src/model/s3/version_table.rs @@ -93,7 +93,6 @@ pub(crate) mod v09 { } #[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)] - #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub enum VersionBacklink { Object { /// Bucket in which the related object is stored diff --git a/src/util/crdt/lww.rs b/src/util/crdt/lww.rs index e18ab5f3..f8b03b85 100644 --- a/src/util/crdt/lww.rs +++ b/src/util/crdt/lww.rs @@ -84,11 +84,6 @@ where self.v = new_value; } - pub fn update2(&mut self, f: impl FnOnce(&mut T), time: u64) { - self.ts = std::cmp::max(self.ts + 1, time); - f(&mut self.v) - } - /// Get the timestamp currently associated with the value pub fn timestamp(&self) -> u64 { self.ts