Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(taiko-client): prints logs when using privateTxMgr #17980

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading