Skip to content

Commit

Permalink
fix(taiko-client): prints logs when using privateTxMgr (#17980)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoGhurt111 committed Aug 27, 2024
1 parent 8819e3a commit a0c3388
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions packages/taiko-client/prover/proof_submitter/transaction/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,33 +78,38 @@ func (s *Sender) Send(
}

// Send the transaction.
var (
next = true
receipt *types.Receipt
)
if s.privateTxmgr != nil {
receipt, err := s.privateTxmgr.Send(ctx, *txCandidate)
receipt, err = s.privateTxmgr.Send(ctx, *txCandidate)
if err != nil || receipt.Status != types.ReceiptStatusSuccessful {
log.Warn("Failed to send transaction by private tx manager in sender",
"error", encoding.TryParsingCustomError(err),
)
} else {
return nil
next = false
}
}
receipt, err := s.txmgr.Send(ctx, *txCandidate)
if err != nil {
return encoding.TryParsingCustomError(err)
}
if next {
receipt, err = s.txmgr.Send(ctx, *txCandidate)
if err != nil {
return encoding.TryParsingCustomError(err)
}

if receipt.Status != types.ReceiptStatusSuccessful {
log.Error(
"Failed to submit proof",
"blockID", proofWithHeader.BlockID,
"tier", proofWithHeader.Tier,
"txHash", receipt.TxHash,
"error", encoding.TryParsingCustomErrorFromReceipt(ctx, s.rpc.L1, s.txmgr.From(), receipt),
)
metrics.ProverSubmissionRevertedCounter.Add(1)
return ErrUnretryableSubmission
if receipt.Status != types.ReceiptStatusSuccessful {
log.Error(
"Failed to submit proof",
"blockID", proofWithHeader.BlockID,
"tier", proofWithHeader.Tier,
"txHash", receipt.TxHash,
"error", encoding.TryParsingCustomErrorFromReceipt(ctx, s.rpc.L1, s.txmgr.From(), receipt),
)
metrics.ProverSubmissionRevertedCounter.Add(1)
return ErrUnretryableSubmission
}
}

log.Info(
"💰 Your block proof was accepted",
"blockID", proofWithHeader.BlockID,
Expand Down

0 comments on commit a0c3388

Please sign in to comment.