Skip to content

Commit

Permalink
chore(taiko-client): optimize logging (#18674)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoGhurt111 authored and mask-pp committed Jan 2, 2025
1 parent 5e98ef7 commit 29c4338
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/taiko-client/prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ func (s *SGXProofProducer) requestBatchProof(
}

if len(output.ErrorMessage) > 0 || len(output.Error) > 0 {
return nil, fmt.Errorf("failed to get batch proof, msg: %s", output.ErrorMessage)
return nil, fmt.Errorf("failed to get sgx batch proof, err: %s, msg: %s",
output.Error,
output.ErrorMessage,
)
}

if output.Data == nil {
Expand Down Expand Up @@ -452,7 +455,7 @@ func (s *SGXProofProducer) requestProof(
}

if len(output.ErrorMessage) > 0 || len(output.Error) > 0 {
return nil, fmt.Errorf("failed to get proof,err: %s, msg: %s", output.Error, output.ErrorMessage)
return nil, fmt.Errorf("failed to get sgx proof,err: %s, msg: %s", output.Error, output.ErrorMessage)
}

return &output, nil
Expand Down
12 changes: 10 additions & 2 deletions packages/taiko-client/prover/proof_producer/zkvm_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,11 @@ func (s *ZKvmProofProducer) requestProof(
}

if len(output.ErrorMessage) > 0 || len(output.Error) > 0 {
return nil, fmt.Errorf("failed to get proof,err: %s, msg: %s", output.Error, output.ErrorMessage)
return nil, fmt.Errorf("failed to get zk proof, err: %s, msg: %s, zkType: %s",
output.Error,
output.ErrorMessage,
s.ZKProofType,
)
}

return &output, nil
Expand Down Expand Up @@ -477,7 +481,11 @@ func (s *ZKvmProofProducer) requestBatchProof(
}

if len(output.ErrorMessage) > 0 || len(output.Error) > 0 {
return nil, fmt.Errorf("failed to get batch proof, msg: %s", output.ErrorMessage)
return nil, fmt.Errorf("failed to get zk batch proof, err: %s, msg: %s, zkType: %s",
output.Error,
output.ErrorMessage,
s.ZKProofType,
)
}
if output.Data == nil {
return nil, fmt.Errorf("unexpected structure error, response: %s", string(resBytes))
Expand Down

0 comments on commit 29c4338

Please sign in to comment.