Skip to content

Commit

Permalink
Merge branch 'main' into fix_driver_p2p_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp authored May 20, 2024
2 parents f4327fd + fea1cbe commit 237495d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/taiko-client/prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ type RISC0RequestProofBodyParam struct {

// RaikoRequestProofBodyResponse represents the JSON body of the response of the proof requests.
type RaikoRequestProofBodyResponse struct {
Proof string `json:"proof"` //nolint:revive,stylecheck
ErrorMessage string `json:"message"`
Data *RaikoProofData `json:"data"`
ErrorMessage string `json:"message"`
}

type RaikoProofData struct {
Proof string `json:"proof"` //nolint:revive,stylecheck
}

// RequestProof implements the ProofProducer interface.
Expand Down Expand Up @@ -135,7 +139,14 @@ func (s *SGXProofProducer) callProverDaemon(ctx context.Context, opts *ProofRequ

log.Debug("Proof generation output", "output", output)

proof = common.Hex2Bytes(output.Proof[2:])
// Raiko returns "" as proof when proof type is native,
// so we just convert "" to bytes
if s.ProofType == ProofTypeCPU {
proof = common.Hex2Bytes(output.Data.Proof)
} else {
proof = common.Hex2Bytes(output.Data.Proof[2:])
}

log.Info(
"Proof generated",
"height", opts.BlockID,
Expand Down

0 comments on commit 237495d

Please sign in to comment.