From aa9b320168110e7839d77b740e9ac71314b80f96 Mon Sep 17 00:00:00 2001 From: Mengran Lan Date: Mon, 29 Jul 2024 15:42:00 +0800 Subject: [PATCH] fix(coordinator): recover prover_task when the related object is verified. --- common/types/db.go | 8 ++++++++ coordinator/internal/logic/submitproof/proof_receiver.go | 2 ++ 2 files changed, 10 insertions(+) diff --git a/common/types/db.go b/common/types/db.go index 359ed1c180..8ff1067fb0 100644 --- a/common/types/db.go +++ b/common/types/db.go @@ -109,6 +109,10 @@ const ( ProverTaskFailureTypeVerifiedFailed // ProverTaskFailureTypeServerError collect occur error ProverTaskFailureTypeServerError + // ProverTaskFailureTypeObjectAlreadyVerified object(batch/chunk) already verified, may exists in test env when ENABLE_TEST_ENV_BYPASS_FEATURES is true + ProverTaskFailureTypeObjectAlreadyVerified + // ProverTaskFailureTypeReassignedByAdmin reassigned by admin + ProverTaskFailureTypeReassignedByAdmin ) func (r ProverTaskFailureType) String() string { @@ -123,6 +127,10 @@ func (r ProverTaskFailureType) String() string { return "prover task failure verified failed" case ProverTaskFailureTypeServerError: return "prover task failure server exception" + case ProverTaskFailureTypeObjectAlreadyVerified: + return "prover task failure object already verified" + case ProverTaskFailureTypeReassignedByAdmin: + return "prover task failure reassigned by admin" default: return fmt.Sprintf("illegal prover task failure type (%d)", int32(r)) } diff --git a/coordinator/internal/logic/submitproof/proof_receiver.go b/coordinator/internal/logic/submitproof/proof_receiver.go index dc21ff582b..7944a466ab 100644 --- a/coordinator/internal/logic/submitproof/proof_receiver.go +++ b/coordinator/internal/logic/submitproof/proof_receiver.go @@ -284,6 +284,8 @@ func (m *ProofReceiverLogic) validator(ctx context.Context, proverTask *orm.Prov // if the batch/chunk have proved and verifier success, need skip this submit proof if m.checkIsTaskSuccess(ctx, proofMsg.ID, proofMsg.Type) { + m.proofRecover(ctx, proverTask, types.ProverTaskFailureTypeObjectAlreadyVerified, proofMsg) + m.validateFailureProverTaskHaveVerifier.Inc() log.Info("the prove task have proved and verifier success, skip this submit proof", "hash", proofMsg.ID, "taskType", proverTask.TaskType, "proverName", proverTask.ProverName, "proverPublicKey", pk, "forkName", forkName)