Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions src/Gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2259,18 +2259,22 @@ fs::path Gpu::saveProof(const Args& args, ProofSet& proofSet) {
bool problem_proof = false;
for ( ; ; ) {
for (int retry = 0; retry == 0 || (retry == 1 && !problem_proof); ++retry) {
auto [proof, hashes] = proofSet.computeProof(this);
fs::path const tmpFile = proof.file(args.proofToVerifyDir);
proof.save(tmpFile);

fs::path proofFile = proof.file(args.proofResultDir);

bool const ok = Proof::load(tmpFile).verify(this, hashes);
log("Proof '%s' verification %s\n", tmpFile.string().c_str(), ok ? "OK" : "FAILED");
if (ok) {
fancyRename(tmpFile, proofFile);
log("Proof '%s' generated\n", proofFile.string().c_str());
return proofFile;
try {
auto [proof, hashes] = proofSet.computeProof(this);
fs::path const tmpFile = proof.file(args.proofToVerifyDir);
proof.save(tmpFile);

fs::path proofFile = proof.file(args.proofResultDir);

bool const ok = Proof::load(tmpFile).verify(this, hashes);
log("Proof '%s' verification %s\n", tmpFile.string().c_str(), ok ? "OK" : "FAILED");
if (ok) {
fancyRename(tmpFile, proofFile);
log("Proof '%s' generated\n", proofFile.string().c_str());
return proofFile;
}
} catch (const CRCError&) {
break;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We exit to the outer for ( ; ; ) loop so that proofSet.reducePower() runs right away. Retrying via the inner loop is hopeless because this kind of error can't be caused by random GPU memory corruption like a verification error might be.

}
}
problem_proof = true;
Expand Down
Loading