From a7c2c082f94a37072c4e38877abf045d69dfbd8a Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Thu, 8 Oct 2026 16:33:09 +0000 Subject: [PATCH] class-v6: drop the second copy of DatasetSource's leaves methods the master merge brought in (master's copy lacked the geom field) Co-Authored-By: Claude Fable 5.1 --- igneum-pow/src/verify.rs | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/igneum-pow/src/verify.rs b/igneum-pow/src/verify.rs index 36a804e33..75ea927b1 100644 --- a/igneum-pow/src/verify.rs +++ b/igneum-pow/src/verify.rs @@ -416,42 +416,6 @@ impl DatasetSource { self.memhard().and_then(|m| m.leaves.as_ref()) } - /// This source with the window's state leaves (class v5, `docs/design/class-v5-stored-state.md`): memory-hard mode - /// under a shape with `state` only. - pub fn with_leaves(mut self, leaves: std::sync::Arc) -> Self { - match &mut self.dataset { - Dataset::MemoryHard(m) => { - assert!(m.params.shape.state, "state leaves on a dataset whose shape has no state"); - m.leaves = Some(leaves); - } - Dataset::ClosedForm { .. } => panic!("state leaves on a closed-form dataset"), - } - self - } - - /// A source of the same day with other leaves, the 256 MiB cache shared (the class v5 window refresh). - pub fn refreshed(&self, leaves: std::sync::Arc) -> Self { - let dataset = match &self.dataset { - Dataset::MemoryHard(m) => Dataset::MemoryHard(m.refreshed(leaves)), - Dataset::ClosedForm { .. } => panic!("state leaves on a closed-form dataset"), - }; - Self { log2_words: self.log2_words, mask: self.mask, key: self.key, key_bytes: self.key_bytes.clone(), dataset, hot: None } - } - - /// A copy of this source sharing its cache (and leaves), for a caller that needs an owned source from a shared one. - pub fn refreshed_or_clone(&self) -> Self { - let dataset = match &self.dataset { - Dataset::MemoryHard(m) => Dataset::MemoryHard(crate::memhard::MemhardCpu { params: m.params.clone(), cache: m.cache.clone(), leaves: m.leaves.clone() }), - Dataset::ClosedForm { d0, d1 } => Dataset::ClosedForm { d0: *d0, d1: *d1 }, - }; - Self { log2_words: self.log2_words, mask: self.mask, key: self.key, key_bytes: self.key_bytes.clone(), dataset, hot: None } - } - - /// The window's state leaves, when the source carries them. - pub fn leaves(&self) -> Option<&std::sync::Arc> { - self.memhard().and_then(|m| m.leaves.as_ref()) - } - /// This source with the hot table of the epoch whose program seed bytes are `seed_bytes` (`mb` MiB). pub fn with_hot(mut self, seed_bytes: &[u8], mb: u32) -> Self { self.hot = Some(HotTable::for_seed_bytes(seed_bytes, mb));