Handle additional error case in retrying provider (#2330)

### Description

Adds a fix for this error message I noticed in the logs:
```
(code: 3, message: execution reverted: INSUFFICIENT_BALANCE, ...)
```

### Drive-by changes

None

### Related issues


### Backward compatibility

_Are these changes backward compatible?_

Yes

_Are there any infrastructure implications, e.g. changes that would
prohibit deploying older commits using this infra tooling?_

None


### Testing

_What kind of testing have these changes undergone?_

None
pull/2343/head
Mattie Conover 2 years ago committed by GitHub
parent a85b88fe9e
commit c661f7dccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      rust/chains/hyperlane-ethereum/src/rpc_clients/mod.rs

@ -58,7 +58,7 @@ fn categorize_client_response<R>(
} }
} }
Err(JsonRpcError(e)) => { Err(JsonRpcError(e)) => {
let msg = e.message.to_ascii_lowercase(); let msg = e.message.to_ascii_lowercase().replace('_', " ");
if e.code == 429 if e.code == 429
|| msg.contains("429") || msg.contains("429")
|| msg.contains("rate limit") || msg.contains("rate limit")
@ -79,7 +79,7 @@ fn categorize_client_response<R>(
|| (METHODS_TO_NOT_RETRY_ON_UNDERPRICED.contains(&method) || (METHODS_TO_NOT_RETRY_ON_UNDERPRICED.contains(&method)
&& msg.contains("underpriced")) && msg.contains("underpriced"))
|| (METHODS_TO_NOT_RETRY_ON_INSUFFICIENT_FUNDS.contains(&method) || (METHODS_TO_NOT_RETRY_ON_INSUFFICIENT_FUNDS.contains(&method)
&& msg.contains("insufficient funds")) && (msg.contains("insufficient funds") || msg.contains("insufficient balance")))
{ {
// We don't want to retry errors that are probably not going to work if we keep // We don't want to retry errors that are probably not going to work if we keep
// retrying them or that indicate an error in higher-order logic and not // retrying them or that indicate an error in higher-order logic and not

Loading…
Cancel
Save