From dee09c782c17de1e37e3a1cf625d430330532c6d 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 ff4bd15a7b..c3a2b068d3 100644 --- a/core/chains/evm/client/errors.go +++ b/core/chains/evm/client/errors.go @@ -263,6 +263,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 49543b16e9..8b9f67ebe5 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 {