Skip to content

Abundance-backed proof of space (CPU) - #3878

Closed
vedhavyas wants to merge 5 commits into
mainfrom
feat/wgpu-plotter
Closed

Abundance-backed proof of space (CPU)#3878
vedhavyas wants to merge 5 commits into
mainfrom
feat/wgpu-plotter

Conversation

@vedhavyas

@vedhavyas vedhavyas commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This pulls abundance's proof-of-space into the farmer and makes it the default for anything newly plotted. It's just the CPU side of the wgpu plotter work - the GPU backend is on its own branch and I'll land the two together, so this one's a draft and shouldn't merge alone. Splitting it out lets the CPU part get reviewed separately.

The wrapper uses the seed and looks proofs up the way we already do (our s-bucket convention), so they verify under the existing ChiaTable verifier with a test to verify the same.

Old and new plots live side by side using a cutover point I store in the plot metadata header: anything at or below it still reads and proves with the old proof-of-space, anything newer uses the new one. New plotting waits until history moves past the cutover so no sector straddles it. A fresh farm has no cutover, so it's all new from the start.

Probably easiest to review commit by commit:

  • add abundance-backed proof of space - the git dep, the chia_v2 wrapper, and the Cargo wiring.
  • add farm cutover point with in-place v0 upgrade - the header version enum, the cutover field, the version-aware decode and in-place upgrade, and the plotting pause.
  • dispatch proof-of-space per sector by history size - the PosTable dispatch enum wired into read/prove/audit.
  • add tests and benches for the abundance proof of space - cross-verify, a plot/read round-trip, the dispatch-selection tests, and the benches pointed at the new table. Kept last so you can skip it on a first pass.

Code contributor checklist:

Latest nightly that still supports generic_const_exprs.
Pull abundance's ab-proof-of-space as a pinned, alloc/parallel-gated git
dependency, so the no_std runtime never links it. chia_v2::ChiaV2Table wraps its
chiapos Tables, looking proofs up under Subspace's s-bucket convention
(find_proof with challenge.to_le_bytes()) so they verify under the existing
ChiaTable verifier; verification delegates to ChiaTable.

Bumps chacha20 0.10.0 -> 0.10.1 (API-only) to satisfy abundance.
PlotMetadataHeader gains a cutover field (Option<HistorySize>) and a typed
PlotMetadataVersion (V0/V1); a version-aware Decode reads old V0 headers as
cutover = None and rejects unknown versions (the old-binary lockout). Opening a
V0 plot records the cutover as the highest history size among existing sectors
and rewrites the header as V1.

New-sector plotting then waits until history advances past the cutover, so no
sector is stamped at history_size <= cutover and later misread with the old
proof-of-space. Sectors at or below the cutover use the old proof-of-space,
newer ones the new; nothing dispatches on it yet.
@vedhavyas

Copy link
Copy Markdown
Contributor Author

@BugBot run

Comment thread crates/subspace-farmer/src/single_disk_farm.rs Outdated
@vedhavyas

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 15d87a9. Configure here.

vedhavyas added 2 commits July 2, 2026 14:17
PosTable (subspace-proof-of-space, alloc-gated) dispatches between the old
ChiaTable and the new ChiaV2Table; both proofs verify under ChiaTable, so the
choice is a farmer-side read/prove concern. The Table trait gains
generator_for(is_post_cutover) and SolutionCandidates a history_size() accessor;
the farmer picks per sector by comparing history_size against the farm's cutover
at reading, proving, and auditing. New sectors always use the new implementation.
Cross-verify abundance-backed proofs against the existing ChiaTable verifier, a
plot->read round-trip, and the per-sector V1/V2 dispatch selection. Point the
benches at the new table.
@vedhavyas

Copy link
Copy Markdown
Contributor Author

Closing in favor of #3883, which takes the wgpu GPU approach instead of the CPU-only path here.

@vedhavyas vedhavyas closed this Jul 7, 2026
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.

1 participant