-
Notifications
You must be signed in to change notification settings - Fork 3
fix(mcms): improve error handling in confirmTransaction #594
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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) | ||||||
| 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) | ||||||
|
||||||
| 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) |
Uh oh!
There was an error while loading. Please reload this page.