From 98fc8813dd7f46e86a15fc3e838bbb681f835d0b Mon Sep 17 00:00:00 2001 From: Jaden Foldesi Date: Thu, 8 Aug 2024 12:38:20 -0400 Subject: [PATCH] Add error mapping for Astar (#13990) * add error mapping * add changeset * add tag --------- Co-authored-by: Kodey Thomas --- .changeset/hip-crabs-agree.md | 5 +++++ core/chains/evm/client/errors.go | 6 +++++- core/chains/evm/client/errors_test.go | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changeset/hip-crabs-agree.md diff --git a/.changeset/hip-crabs-agree.md b/.changeset/hip-crabs-agree.md new file mode 100644 index 00000000000..5085899e3d3 --- /dev/null +++ b/.changeset/hip-crabs-agree.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#added Add Astar TerminallyUnderpriced error mapping diff --git a/core/chains/evm/client/errors.go b/core/chains/evm/client/errors.go index 5d684d1d17c..da122514743 100644 --- a/core/chains/evm/client/errors.go +++ b/core/chains/evm/client/errors.go @@ -250,6 +250,10 @@ var zkEvm = ClientErrors{ TerminallyStuck: regexp.MustCompile(`(?:: |^)not enough .* counters to continue the execution$`), } +var aStar = ClientErrors{ + TerminallyUnderpriced: regexp.MustCompile(`(?:: |^)(gas price less than block base fee)$`), +} + var mantle = ClientErrors{ InsufficientEth: regexp.MustCompile(`(: |^)'*insufficient funds for gas \* price \+ value`), Fatal: regexp.MustCompile(`(: |^)'*invalid sender`), @@ -262,7 +266,7 @@ var internal = ClientErrors{ TerminallyStuck: regexp.MustCompile(TerminallyStuckMsg), } -var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, mantle, internal} +var clients = []ClientErrors{parity, geth, arbitrum, metis, substrate, avalanche, nethermind, harmony, besu, erigon, klaytn, celo, zkSync, zkEvm, mantle, aStar, internal} // ClientErrorRegexes returns a map of compiled regexes for each error type func ClientErrorRegexes(errsRegex config.ClientErrors) *ClientErrors { diff --git a/core/chains/evm/client/errors_test.go b/core/chains/evm/client/errors_test.go index 0d8dddf2a0f..72fa1347ec0 100644 --- a/core/chains/evm/client/errors_test.go +++ b/core/chains/evm/client/errors_test.go @@ -166,6 +166,7 @@ func Test_Eth_Errors(t *testing.T) { {"max fee per gas less than block base fee", true, "zkSync"}, {"virtual machine entered unexpected state. please contact developers and provide transaction details that caused this error. Error description: The operator included transaction with an unacceptable gas price", true, "zkSync"}, {"client error terminally underpriced", true, "tomlConfig"}, + {"gas price less than block base fee", true, "aStar"}, } for _, test := range tests {