From 909ecdfbc165ab17a32de2c106fb665429d43db0 Mon Sep 17 00:00:00 2001 From: Chunkai Yang Date: Mon, 21 Oct 2024 15:19:01 -0400 Subject: [PATCH] Add Mantle NonceTooLow Error (#14859) (#1505) https://github.com/smartcontractkit/chainlink/pull/14859/files#diff-e9a4f21557894a9a2c77ca090bea14ed69bdfea02500c0cfd04628a1941f6e6c * handle mantle "nonce too low" error * add changeset ## Motivation ## Solution Co-authored-by: Matthew Romage <33700623+ma33r@users.noreply.github.com> --- .changeset/pretty-worms-smell.md | 5 +++++ core/chains/evm/client/errors.go | 1 + core/chains/evm/client/errors_test.go | 1 + 3 files changed, 7 insertions(+) create mode 100644 .changeset/pretty-worms-smell.md diff --git a/.changeset/pretty-worms-smell.md b/.changeset/pretty-worms-smell.md new file mode 100644 index 0000000000..9633de0950 --- /dev/null +++ b/.changeset/pretty-worms-smell.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +Added a custom client error message for Mantle to capture NonceTooLow error. #added diff --git a/core/chains/evm/client/errors.go b/core/chains/evm/client/errors.go index 91b32e7642..812733b35f 100644 --- a/core/chains/evm/client/errors.go +++ b/core/chains/evm/client/errors.go @@ -257,6 +257,7 @@ var aStar = ClientErrors{ var mantle = ClientErrors{ InsufficientEth: regexp.MustCompile(`(: |^)'*insufficient funds for gas \* price \+ value`), Fatal: regexp.MustCompile(`(: |^)'*invalid sender`), + NonceTooLow: regexp.MustCompile(`(: |^)'*nonce too low`), } var gnosis = ClientErrors{ diff --git a/core/chains/evm/client/errors_test.go b/core/chains/evm/client/errors_test.go index f06cf8b135..e4a9900d4a 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -44,6 +44,7 @@ func Test_Eth_Errors(t *testing.T) { {"call failed: OldNonce, Current nonce: 22, nonce of rejected tx: 17", true, "Nethermind"}, {"nonce too low. allowed nonce range: 427 - 447, actual: 426", true, "zkSync"}, {"client error nonce too low", true, "tomlConfig"}, + {"failed to forward tx to sequencer, please try again. Error message: 'nonce too low'", true, "Mantle"}, } for _, test := range tests {