From b020fdc71fc71ce316776bc4c62366391cf35775 Mon Sep 17 00:00:00 2001 From: Sergio Demian Lerner Date: Tue, 24 Nov 2026 11:28:12 +0000 Subject: [PATCH] Say whether the segment seed survived, instead of that nothing can promise On start, when the segment set ends below the executed head, segbuild warned that the seed state "is the one part nothing can promise -- it was written below the watermark and was not pinned while the node ran". It said that unconditionally, including when the store's own records settle the question. They usually do. A sweep preserves everything reachable from the root it collected against, so a state at or after that root's height is complete by construction: each of its nodes was either reachable then, and preserved, or written since, into an epoch the sweep never touched. The sweep log records exactly that height. So the message now reads the log and distinguishes three cases: no sweep has ever completed, so nothing was collected and the seed is intact; the newest sweep collected at or below the set's end, so the seed is that state carried forward and is intact; or the newest sweep was above it, which is the only case that cannot be shown safe and is the only one that now warns. On this node the first two apply -- the one sweep on record collected against #9,417,643 while the set ends at #9,429,888 -- so an operator sees an info line saying the seed is intact rather than a warning sending them to look for damage that is not there. Worth being precise about why that matters: the old wording cost an investigation. It reads as a report of a near miss, and prompts a search for collected nodes, when the collector had in fact preserved the exact state the build needs. A message that says "unknowable" where the answer is recorded is worse than no message. Co-Authored-By: Claude Opus 5 --- crates/cli/src/main.rs | 64 ++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 15 deletions(-) diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 8d4e66b..89ead5f 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -3150,21 +3150,55 @@ async fn run(local_offset: Option) -> Result<()> { set_end + 1 ); } - warn!( - "segbuild: the set ends at #{set_end} and this node has executed to \ - #{exec_head}, a gap of {gap} blocks. The collector has not been \ - beneath it ({}), so it is still buildable, and all but the last {} \ - blocks of it are cut as a range of their own now. Its seed state at \ - #{set_end} is the one \ - part nothing can promise -- it was written below the watermark and \ - was not pinned while the node ran -- so the build may fail on a \ - missing node, loudly, leaving no segment.", - match watermark { - Some(w) => format!("watermark #{w}"), - None => "no sweep has completed".into(), - }, - args.segbuild_lag - ); + // Whether the seed survived is checkable, not unknowable, and + // saying "nothing can promise" when the record settles it sends + // an operator looking for damage that is not there. + // + // A sweep preserves everything reachable from the root it + // collected against. So a state at or after that root's height + // is complete by construction: each of its nodes was either + // reachable then -- and preserved -- or written since, in an + // epoch the sweep never touched. + let last_sweep = epoch_store + .as_ref() + .and_then(|es| es.sweep_log().last().cloned()); + let seed_verdict = match (&last_sweep, watermark) { + (None, None) => Some( + "no sweep has ever completed, so nothing has been collected and the \ + seed state is intact" + .to_string(), + ), + (Some(r), _) if r.swept_at <= set_end => Some(format!( + "the most recent sweep collected against #{} and preserved everything \ + reachable from it, so the seed at #{set_end} -- which is that state \ + carried forward -- is intact", + r.swept_at + )), + _ => None, + }; + match seed_verdict { + Some(why) => info!( + "segbuild: the set ends at #{set_end} and this node has executed to \ + #{exec_head}, a gap of {gap} blocks. All but the last {} blocks of \ + it are cut as a range of their own now, and {why}.", + args.segbuild_lag + ), + None => warn!( + "segbuild: the set ends at #{set_end} and this node has executed to \ + #{exec_head}, a gap of {gap} blocks. The collector has not been \ + beneath it ({}), so it is still buildable, and all but the last {} \ + blocks of it are cut as a range of their own now. But the most \ + recent sweep collected against #{}, which is ABOVE #{set_end}, so \ + the seed state there cannot be shown intact -- the build may fail \ + on a missing node, loudly, leaving no segment.", + match watermark { + Some(w) => format!("watermark #{w}"), + None => "no sweep has completed".into(), + }, + args.segbuild_lag, + last_sweep.as_ref().map(|r| r.swept_at).unwrap_or(0) + ), + } } if exec_head < set_end { info!(