From 004bd4e79a783a32f5238a80ea8d490275596180 Mon Sep 17 00:00:00 2001 From: Anthony Laibe <491074+alaibe@users.noreply.github.com> Date: Tue, 5 Mar 2024 10:33:12 +0100 Subject: [PATCH] fix: gas estimation error cause network error --- VERSION | 2 +- rpc/chain/client.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 8d0867026..25b4c6c14 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.176.2 +0.176.3 diff --git a/rpc/chain/client.go b/rpc/chain/client.go index 4b73010c9..abb3e7653 100644 --- a/rpc/chain/client.go +++ b/rpc/chain/client.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/ethclient" @@ -85,6 +86,8 @@ var propagateErrors = []error{ vm.ErrInvalidCode, vm.ErrNonceUintOverflow, + core.ErrInsufficientFunds, + // Used by balance history to check state ethereum.NotFound, bind.ErrNoCode, @@ -154,7 +157,7 @@ func isVMError(err error) bool { return true } for _, vmError := range propagateErrors { - if err == vmError { + if err == vmError || strings.Contains(err.Error(), vmError.Error()) { return true } }