Skip to content

Commit

Permalink
fix(taiko-client): fix process in handling empty proof (#18128)
Browse files Browse the repository at this point in the history
Co-authored-by: David <david@taiko.xyz>
  • Loading branch information
YoGhurt111 and davidtaikocha authored Sep 18, 2024
1 parent 9476859 commit d6d90d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

var (
errProofGenerating = errors.New("proof is generating")
errEmptyProof = errors.New("proof is empty")
)

// ProofRequestBody represents a request body to generate a proof.
Expand Down
3 changes: 3 additions & 0 deletions packages/taiko-client/prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ func (s *SGXProofProducer) callProverDaemon(
if s.ProofType == ProofTypeCPU {
proof = common.Hex2Bytes(output.Data.Proof)
} else {
if len(output.Data.Proof) == 0 {
return nil, errEmptyProof
}
proof = common.Hex2Bytes(output.Data.Proof[2:])
}

Expand Down
3 changes: 3 additions & 0 deletions packages/taiko-client/prover/proof_producer/zkvm_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ func (s *ZKvmProofProducer) callProverDaemon(
return nil, ErrRetry
}

if len(output.Data.Proof.Proof) == 0 {
return nil, errEmptyProof
}
proof = common.Hex2Bytes(output.Data.Proof.Proof[2:])
log.Info(
"Proof generated",
Expand Down

0 comments on commit d6d90d8

Please sign in to comment.