internal/ethapi: set block gas limit as msg gas limit when rpc gas cap is set 0 (infinite)

This commit is contained in:
colinlyguo 2024-01-21 05:40:29 +08:00
parent f55a10b64d
commit 53f7872936
No known key found for this signature in database
GPG key ID: 82E123BE1B68288B

View file

@ -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 the gas amount is not set, default to RPC gas cap.
if args.Gas == nil { if args.Gas == nil {
tmp := hexutil.Uint64(b.RPCGasCap()) if b.RPCGasCap() != 0 {
args.Gas = &tmp 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 // Ensure any missing fields are filled, extract the recipient and input data