curiopdp: stop the per-proof cache churn - #48
Open
frrist wants to merge 1 commit into
Open
Conversation
alanshaw
approved these changes
Aug 3, 2026
NullProofCache was a non-nil interface value, and pdpv0's prove task gates
its cached-proof branch on `p.idx != nil` alone (tasks/pdpv0/task_prove.go:687).
A no-op store therefore read as "cache available": for every sub-piece above
MinSizeForCache (32 MiB padded) the task called GenerateCachedProof, got
(nil, nil) back, treated that as a cache failure, logged a warning, and ran
UPDATE pdp_piecerefs
SET needs_save_cache = TRUE, caching_task_started = NULL,
caching_task_completed = NULL, cached_proofgen_failure_count = $1
on *every* proof β with no SaveCache task registered to drain it. That is a
DB write and a monotonically climbing failure counter per piece per proving
period, forever.
Return a nil ProofCacheStore instead. The branch is skipped entirely and the
task goes straight to genSubPieceMemtree, which is what Piri actually proves
with today; the `subPieceProof == nil` fallback at task_prove.go:730 is
unconditional, so no proving path changes behavior.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 1/5 β base of the piece-size series.
mainβ #48 β #49 β #51 β #52 β #53What this does
NullProofCachewas a non-nil interface value, and pdpv0's prove task gates its cached-proof branch onp.idx != nilalone (tasks/pdpv0/task_prove.go:687). A no-op store therefore reads as "cache available": for every sub-piece aboveMinSizeForCache(32 MiB padded) the task calledGenerateCachedProof, got(nil, nil)back, treated that as a cache failure, logged a warning, and ranon every proof β with no SaveCache task registered to drain it. One DB write and a monotonically climbing failure counter, per large piece, per proving period, forever.
Returning a nil
ProofCacheStoreskips the branch entirely.Not in scope
The real Postgres-backed proof cache. This only stops the bleeding; implementing the cache (and registering pdpv0's
SaveCachetask) is separate work. Until then every proof builds a full memtree, which is why the piece-size default in #49 stays at 256 MiB.