Skip to content

curiopdp: stop the per-proof cache churn - #48

Open
frrist wants to merge 1 commit into
mainfrom
pr1-proof-cache
Open

curiopdp: stop the per-proof cache churn#48
frrist wants to merge 1 commit into
mainfrom
pr1-proof-cache

Conversation

@frrist

@frrist frrist commented Jul 31, 2026

Copy link
Copy Markdown
Member

Stack 1/5 β€” base of the piece-size series. main ← #48 ← #49 ← #51 ← #52 ← #53

What this does

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 reads 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. One DB write and a monotonically climbing failure counter, per large piece, per proving period, forever.

Returning a nil ProofCacheStore skips the branch entirely.

Not in scope

The real Postgres-backed proof cache. This only stops the bleeding; implementing the cache (and registering pdpv0's SaveCache task) is separate work. Until then every proof builds a full memtree, which is why the piece-size default in #49 stays at 256 MiB.

@frrist
frrist requested a review from alanshaw as a code owner July 31, 2026 00:10
@frrist frrist changed the title curiopdp: disable the cached-proof path until a real cache exists curiopdp: stop the per-proof cache churn Jul 31, 2026
@frrist frrist self-assigned this Jul 31, 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants