Add save/resume of scan progress (finish interrupted range on restart) - #2
Open
timon174174174174-source wants to merge 1 commit into
Open
Conversation
Periodically persist a crash-safe checkpoint (range identity + per-thread
scan offset + found proof keys) while scanning a pool range. On startup,
before requesting a new range, finish the interrupted range from the saved
offset and submit its proof keys, then continue.
The pool hands out a new range on restart and the same range cannot be
re-requested, so the client completes the interrupted range (exact resume
when the GPU thread count matches the checkpoint, full re-scan otherwise)
and submits it.
- Pool/Checkpoint.{h,cpp}: atomic checkpoint serialization (+ unit tests)
- RangeMath.{h,cpp}: GPU partition arithmetic in sync with
getGPUStartingKeysMT (+ unit tests)
- VanitySearch: per-thread resume offset; periodic progress callback (single-GPU)
- PoolClient: mutex around foundKeys; getFoundProofPairs accessor
- main: resume branch + checkpoint write/clear lifecycle
- save_progress flag (pool.conf / -saveprogress / SAVE_PROGRESS), default on
- never persists the target private key (only proof keys)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
timon174174174174-source
force-pushed
the
pr/save-resume-progress
branch
from
June 8, 2026 12:14
88815d5 to
25d8702
Compare
tianaid404-byte
approved these changes
Jun 19, 2026
|
Ok |
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.
Summary
Adds opt-in save/resume of GPU scan progress so an interrupted range isn't lost on restart.
While scanning a pool range, the client periodically writes a crash-safe checkpoint (range identity + per-thread scan offset + found proof keys) to
progress/checkpoint_gpu<idx>.txt. On startup, before requesting a new range, it finishes the interrupted range from the saved offset, submits its proof keys, then continues normally.Why finish-and-submit: the pool assigns a new range on restart and the same range can't be re-requested, so resuming the exact pool range isn't possible. Instead the client completes the interrupted range — exact resume when the GPU thread count matches the checkpoint, full re-scan otherwise — and submits it.
Changes
Pool/Checkpoint.{h,cpp}— atomic checkpoint (temp + rename) serializationRangeMath.{h,cpp}— GPU partition arithmetic, kept in sync withgetGPUStartingKeysMTVanitySearch— resume offset applied per GPU thread; periodic progress callback (single-GPU)PoolClient—std::mutexaroundfoundKeys(now read concurrently by the monitor thread) +getFoundProofPairsmain.cpp— resume branch + checkpoint write/clear lifecyclesave_progressflag —pool.conf/-saveprogress/ DockerSAVE_PROGRESS(default on)Makefile, VS project,.gitignore(/progress),README,Dockerfile,btcpuzzle.shPrivacy: the checkpoint never stores the target private key (only proof keys, which already go to the pool), so untrusted-computer mode's guarantee is preserved.
Testing
Checkpoint(round-trip, atomicity, corrupted file) andRangeMath(partition tiling, floor offset) undertests/— each builds & runs with a singleg++command (in-file).[RESUME] resumed from per-thread offset 0x...and finishes the range.Notes
save_progressdefaults totrue; setsave_progress=falseto disable.saveProgress()stub that was never wired up.🤖 Generated with Claude Code