Optimize gas by default in eth_createAccessList (#8337)

Enable gas optimizations of PRs #3453 & #8261 unless the `optimizeGas`
argument is explicitly set to `false`.
This commit is contained in:
Andrew Ashikhmin 2023-10-01 14:22:18 +02:00 committed by GitHub
parent 3775f4a5d4
commit 0427b162c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -558,7 +558,7 @@ func (api *APIImpl) CreateAccessList(ctx context.Context, args ethapi2.CallArgs,
errString = res.Err.Error() errString = res.Err.Error()
} }
accessList := &accessListResult{Accesslist: &accessList, Error: errString, GasUsed: hexutil.Uint64(res.UsedGas)} accessList := &accessListResult{Accesslist: &accessList, Error: errString, GasUsed: hexutil.Uint64(res.UsedGas)}
if optimizeGas != nil && *optimizeGas { if optimizeGas == nil || *optimizeGas { // optimize gas unless explicitly told not to
optimizeWarmAddrInAccessList(accessList, *args.From) optimizeWarmAddrInAccessList(accessList, *args.From)
optimizeWarmAddrInAccessList(accessList, to) optimizeWarmAddrInAccessList(accessList, to)
optimizeWarmAddrInAccessList(accessList, header.Coinbase) optimizeWarmAddrInAccessList(accessList, header.Coinbase)