From a3a4b26fea8eade4878b40309e04e0d3d9a1c8cb Mon Sep 17 00:00:00 2001 From: Ivan Wang Date: Tue, 19 Mar 2024 11:00:28 +0800 Subject: [PATCH 1/2] [R4R]-fix: ivan/fix/eth_estimateGas:gas required exceeds allowance (0) --- internal/ethapi/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index f1ae3e8735..a1b7be2976 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -80,6 +80,7 @@ func (s *EthereumAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) { // MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions. func (s *EthereumAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error) { + fmt.Println("EthereumAPI.MaxPriorityFeePerGas") tipcap, err := s.b.SuggestGasTipCap(ctx) if err != nil { return nil, err @@ -1286,7 +1287,8 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr allowance := new(big.Int).Div(available, feeCap) // If the allowance is larger than maximum uint64, skip checking - if allowance.IsUint64() && hi > allowance.Uint64() { + // If the runMode is core.GasEstimationWithSkipCheckBalanceMode, skip checking + if runMode != core.GasEstimationWithSkipCheckBalanceMode && allowance.IsUint64() && hi > allowance.Uint64() { transfer := args.Value if transfer == nil { transfer = new(hexutil.Big) From 46ea386a20cce290adf1bc17e96ae6a63d4aec8d Mon Sep 17 00:00:00 2001 From: Ivan Wang Date: Tue, 19 Mar 2024 11:34:16 +0800 Subject: [PATCH 2/2] remove fmt.Println --- internal/ethapi/api.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index a1b7be2976..833cb7e818 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -80,7 +80,6 @@ func (s *EthereumAPI) GasPrice(ctx context.Context) (*hexutil.Big, error) { // MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions. func (s *EthereumAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error) { - fmt.Println("EthereumAPI.MaxPriorityFeePerGas") tipcap, err := s.b.SuggestGasTipCap(ctx) if err != nil { return nil, err