From 2f3834b06e16d210ab836f36b47fbcfb8fac5fea Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Wed, 20 May 2026 12:47:01 -0400 Subject: [PATCH] add regex for cronos errs --- pkg/client/errors.go | 8 +++++++- pkg/client/errors_test.go | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/client/errors.go b/pkg/client/errors.go index afe29b03a7..789a226939 100644 --- a/pkg/client/errors.go +++ b/pkg/client/errors.go @@ -312,6 +312,12 @@ var jovay = ClientErrors{ NonceTooLow: regexp.MustCompile(`TX_REPLAY_ATTACK`), // Jovay returns for nonce-too-low (already-confirmed nonce) } +var cronos = ClientErrors{ + NonceTooLow: regexp.MustCompile(`invalid nonce; got \d+, expected \d+`), + TransactionAlreadyInMempool: regexp.MustCompile(`tx already in mempool`), + ServiceUnavailable: regexp.MustCompile(`eth_sendRawTransaction does not exist/is not available`), +} + const TerminallyStuckMsg = "transaction terminally stuck" // Tx.Error messages that are set internally so they are not chain or client specific @@ -319,7 +325,7 @@ var internal = ClientErrors{ TerminallyStuck: regexp.MustCompile(TerminallyStuckMsg), } -var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, optimism, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, treasure, mantle, aStar, hedera, gnosis, sei, monad, jovay, internal} +var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, optimism, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, treasure, mantle, aStar, hedera, gnosis, sei, monad, jovay, cronos, internal} // ClientErrorRegexes returns a map of compiled regexes for each error type func ClientErrorRegexes(errsRegex config.ClientErrors) *ClientErrors { diff --git a/pkg/client/errors_test.go b/pkg/client/errors_test.go index 94114b63b0..ecde2b9465 100644 --- a/pkg/client/errors_test.go +++ b/pkg/client/errors_test.go @@ -52,6 +52,7 @@ func Test_Eth_Errors(t *testing.T) { {"[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"}, {"RPC call failed: TX_REPLAY_ATTACK", true, "Jovay"}, + {"invalid nonce; got 3135, expected 3136: invalid sequence: invalid sequence", true, "Cronos"}, } for _, test := range tests { @@ -150,6 +151,7 @@ func Test_Eth_Errors(t *testing.T) { {"tx already exists in cache", true, "Sei"}, {"failed to forward tx to sequencer, please try again. Error message: 'already known'", true, "Mantle"}, {"tx already exists in cache", true, "Sei"}, + {"tx already in mempool", true, "Cronos"}, } for _, test := range tests { err = evmclient.NewSendErrorS(test.message) @@ -254,6 +256,7 @@ func Test_Eth_Errors(t *testing.T) { {"client error service unavailable", true, "tomlConfig"}, {"[Request ID: 825608a8-fd8a-4b5b-aea7-92999509306d] Error invoking RPC: [Request ID: 825608a8-fd8a-4b5b-aea7-92999509306d] Transaction execution returns a null value for transaction", true, "hedera"}, {"call failed: 503 Service Temporarily Unavailable: \r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n", true, "Arbitrum"}, + {"RPC call failed: The method eth_sendRawTransaction does not exist/is not available", true, "Cronos"}, } for _, test := range tests { err = evmclient.NewSendErrorS(test.message)