From 0b458a0ef32d18595e4297724ac162ef25139b7e Mon Sep 17 00:00:00 2001 From: gavin Date: Sun, 18 Aug 2024 14:12:06 +0800 Subject: [PATCH 1/3] fix(taiko-client): fix zk status recognition --- .../prover/proof_producer/sgx_producer.go | 4 ++-- .../prover/proof_producer/zkvm_producer.go | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) 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 From cc7f0d67185b52665595e0b50c5437754dfdf02d Mon Sep 17 00:00:00 2001 From: gavin Date: Sun, 18 Aug 2024 14:29:44 +0800 Subject: [PATCH 2/3] disable hive test temporarily --- .github/workflows/taiko-client--hive_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/taiko-client--hive_test.yml b/.github/workflows/taiko-client--hive_test.yml index 6bd33e86201..021e3982ee8 100644 --- a/.github/workflows/taiko-client--hive_test.yml +++ b/.github/workflows/taiko-client--hive_test.yml @@ -2,7 +2,7 @@ name: "Taiko Client Hive Tests" on: push: - branches: [main] + branches: [feature/introduce-zk2] paths: - "packages/taiko-client/**" pull_request: From 8e0499f7afdde1b11dde2e9f0424658537eb7898 Mon Sep 17 00:00:00 2001 From: gavin Date: Sun, 18 Aug 2024 14:31:38 +0800 Subject: [PATCH 3/3] disable hive test temporarily --- .github/workflows/taiko-client--hive_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/taiko-client--hive_test.yml b/.github/workflows/taiko-client--hive_test.yml index 021e3982ee8..79ccbca37b3 100644 --- a/.github/workflows/taiko-client--hive_test.yml +++ b/.github/workflows/taiko-client--hive_test.yml @@ -6,6 +6,7 @@ on: paths: - "packages/taiko-client/**" pull_request: + branches: [ feature/introduce-zk2 ] paths: - "packages/taiko-client/**" - "go.mod"