Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/true-mammals-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink-deployments-framework": patch
---

fix(mcms): improve error handling in confirmTransaction
27 changes: 15 additions & 12 deletions engine/cld/legacy/cli/mcmsv2/mcms_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -1545,24 +1545,27 @@ func confirmTransaction(ctx context.Context, lggr logger.Logger, tx types.Transa
lggr.Infof("Transaction %s confirmed in block %d", tx.Hash, block)
return nil
}
rcpt, err := chain.Client.TransactionReceipt(ctx, common.HexToHash(tx.Hash))
if err != nil {
return fmt.Errorf("error getting transaction receipt for %s: %w", tx.Hash, err)
lggr.Errorf("failed to confirm transaction %s: %s", tx.Hash, err)
Comment thread
gustavogama-cll marked this conversation as resolved.
rcpt, rerr := chain.Client.TransactionReceipt(ctx, common.HexToHash(tx.Hash))
if rerr != nil {
return fmt.Errorf("failed to get transaction receipt for %s: %w", tx.Hash, rerr)
}
if rcpt == nil {
return fmt.Errorf("got nil receipt for %s", tx.Hash)
}
if rcpt.Status == gethtypes.ReceiptStatusSuccessful {
return nil
}
if rcpt != nil && rcpt.Status == 0 && cfg.proposalCtx != nil {
if cfg.proposalCtx != nil {
// Decode via simulation to recover revert bytes
if pretty, ok := tryDecodeTxRevertEVM(
ctx,
chain.Client,
tx.RawData.(*gethtypes.Transaction),
bindings.ManyChainMultiSigABI,
rcpt.BlockNumber,
cfg.proposalCtx); ok {
pretty, ok := tryDecodeTxRevertEVM(ctx, chain.Client, tx.RawData.(*gethtypes.Transaction),
bindings.ManyChainMultiSigABI, rcpt.BlockNumber, cfg.proposalCtx)
if ok {
return fmt.Errorf("tx %s reverted: %s", tx.Hash, pretty)
}
}

return err
return fmt.Errorf("transaction %s failed (block number %v): %w", tx.Hash, rcpt.BlockNumber, err)

Copilot AI Nov 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message says 'transaction %s failed' but this return statement is reached both when the receipt status indicates failure (status != 1) and when revert decoding is unavailable. Consider making the message more specific, such as 'transaction %s reverted in block %v' to clarify this is a revert scenario, not a general failure.

Suggested change
return fmt.Errorf("transaction %s failed (block number %v): %w", tx.Hash, rcpt.BlockNumber, err)
return fmt.Errorf("transaction %s reverted in block %v (revert decoding unavailable): %w", tx.Hash, rcpt.BlockNumber, err)

Copilot uses AI. Check for mistakes.
}

if family == chainsel.FamilyAptos {
Expand Down