From 087e5f4cf9964f3b1b7d42c3b01054fa3350921f Mon Sep 17 00:00:00 2001 From: mauricefisher64 <92736594+mauricefisher64@users.noreply.github.com> Date: Mon, 6 Oct 2025 14:25:53 -0400 Subject: [PATCH] Add support for new data hash exclusions when update manifests are present. --- sdk/src/claim.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sdk/src/claim.rs b/sdk/src/claim.rs index 0c02ae113..5dd1a710d 100644 --- a/sdk/src/claim.rs +++ b/sdk/src/claim.rs @@ -2581,16 +2581,31 @@ impl Claim { // update with any needed update hash adjustments if svi.update_manifest_label.is_some() { + let mut start_adjust = 0; + let mut start_offset = 0; if let Some(exclusions) = &mut dh.exclusions { if let Some(range) = &svi.manifest_store_range { // find the range that starts at the same position as the manifest store range if let Some(pos) = exclusions.iter().position(|r| r.start() == range.start()) { + // find the adjustment length + start_offset = range.start(); + start_adjust = + range.length().saturating_sub(exclusions[pos].length()); + // replace range using the size that covers entire manifest (including update manifests) exclusions[pos] = range.clone(); } } + // fix up offsets affected by update manifest + if start_offset > 0 { + for exclusion in exclusions { + if exclusion.start() > start_offset { + exclusion.set_start(exclusion.start() + start_adjust); + } + } + } } }