From 198b35252c76e3c157a18146e6885e2795e9d5a8 Mon Sep 17 00:00:00 2001 From: Matthew Romage <33700623+ma33r@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:36:48 -0400 Subject: [PATCH 1/2] Add Mantle NonceTooLow Error (#14859) * handle mantle "nonce too low" error * add changeset --- .changeset/pretty-worms-smell.md | 5 +++++ core/chains/evm/client/errors.go | 1 + core/chains/evm/client/errors_test.go | 2 ++ 3 files changed, 8 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..b8f99fd2e9 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -44,6 +44,8 @@ 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"}, + {"[Request ID: 2e952947-ffad-408b-aed9-35f3ed152001] Nonce too low. Provided nonce: 15, current nonce: 15", true, "hedera"}, + {"failed to forward tx to sequencer, please try again. Error message: 'nonce too low'", true, "Mantle"}, } for _, test := range tests { From d5f59902afabaabe546a1cf2ef11612d5f3d1b5d Mon Sep 17 00:00:00 2001 From: Matt Yang Date: Mon, 21 Oct 2024 14:58:03 -0400 Subject: [PATCH 2/2] remove hederal error test --- core/chains/evm/client/errors_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/core/chains/evm/client/errors_test.go b/core/chains/evm/client/errors_test.go index b8f99fd2e9..8b9f67ebe5 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -44,7 +44,6 @@ 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"}, - {"[Request ID: 2e952947-ffad-408b-aed9-35f3ed152001] Nonce too low. Provided nonce: 15, current nonce: 15", true, "hedera"}, {"failed to forward tx to sequencer, please try again. Error message: 'nonce too low'", true, "Mantle"}, }