From 53f787293602e2a74713a66a08425ba2a97a85f3 Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Sun, 21 Jan 2024 05:40:29 +0800 Subject: [PATCH] internal/ethapi: set block gas limit as msg gas limit when rpc gas cap is set 0 (infinite) --- internal/ethapi/api.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index ee479d7139..80e32880c5 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1513,8 +1513,13 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH } // If the gas amount is not set, default to RPC gas cap. if args.Gas == nil { - tmp := hexutil.Uint64(b.RPCGasCap()) - args.Gas = &tmp + if b.RPCGasCap() != 0 { + tmp := hexutil.Uint64(b.RPCGasCap()) + args.Gas = &tmp + } else { + tmp := hexutil.Uint64(b.CurrentBlock().GasLimit) + args.Gas = &tmp + } } // Ensure any missing fields are filled, extract the recipient and input data