diff --git a/.github/workflows/taiko-client--hive_test.yml b/.github/workflows/taiko-client--hive_test.yml index 6bd33e86201..79ccbca37b3 100644 --- a/.github/workflows/taiko-client--hive_test.yml +++ b/.github/workflows/taiko-client--hive_test.yml @@ -2,10 +2,11 @@ name: "Taiko Client Hive Tests" on: push: - branches: [main] + branches: [feature/introduce-zk2] paths: - "packages/taiko-client/**" pull_request: + branches: [ feature/introduce-zk2 ] paths: - "packages/taiko-client/**" - "go.mod" diff --git a/packages/taiko-client/prover/proof_producer/sgx_producer.go b/packages/taiko-client/prover/proof_producer/sgx_producer.go index b7ce2c0a0f8..dacf2b8ea62 100644 --- a/packages/taiko-client/prover/proof_producer/sgx_producer.go +++ b/packages/taiko-client/prover/proof_producer/sgx_producer.go @@ -142,8 +142,6 @@ func (s *SGXProofProducer) callProverDaemon(ctx context.Context, opts *ProofRequ return nil, errProofGenerating } - log.Debug("Proof generation output", "output", output) - // Raiko returns "" as proof when proof type is native, // so we just convert "" to bytes if s.ProofType == ProofTypeCPU { @@ -210,6 +208,8 @@ func (s *SGXProofProducer) requestProof( return nil, err } + log.Debug("Proof generation output", "output", string(resBytes)) + var output RaikoRequestProofBodyResponse if err := json.Unmarshal(resBytes, &output); err != nil { return nil, err diff --git a/packages/taiko-client/prover/proof_producer/zkvm_producer.go b/packages/taiko-client/prover/proof_producer/zkvm_producer.go index 3d76cb8e969..238976ab3d7 100644 --- a/packages/taiko-client/prover/proof_producer/zkvm_producer.go +++ b/packages/taiko-client/prover/proof_producer/zkvm_producer.go @@ -27,7 +27,11 @@ const ( ZKProofTypeSP1 = "sp1" ) -var ErrProofInProgress = errors.New("work_in_progress") +var ( + ErrProofInProgress = errors.New("work_in_progress") + ErrRetry = errors.New("retry") + StatusRegistered = "registered" +) // RaikoRequestProofBodyResponseV2 represents the JSON body of the response of the proof requests. type RaikoRequestProofBodyResponseV2 struct { @@ -120,8 +124,9 @@ func (s *ZKvmProofProducer) callProverDaemon(ctx context.Context, opts *ProofReq if output.Data.Status == ErrProofInProgress.Error() { return nil, ErrProofInProgress } - - log.Debug("Proof generation output", "output", output) + if output.Data.Status == StatusRegistered { + return nil, ErrRetry + } proof = common.Hex2Bytes(output.Data.Proof.Proof[2:]) log.Info( @@ -183,6 +188,7 @@ func (s *ZKvmProofProducer) requestProof( return nil, err } + log.Debug("Proof generation output", "output", string(resBytes)) var output RaikoRequestProofBodyResponseV2 if err := json.Unmarshal(resBytes, &output); err != nil { return nil, err