mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
Merge pull request #791 from maticnetwork/raneet10/pos-1345
internal/ethapi: set rpc gas cap as default gas limit when creating access list
This commit is contained in:
commit
b0ff49d373
1 changed files with 6 additions and 12 deletions
|
|
@ -1524,9 +1524,12 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
|
||||||
if db == nil || err != nil {
|
if db == nil || err != nil {
|
||||||
return nil, 0, nil, err
|
return nil, 0, nil, err
|
||||||
}
|
}
|
||||||
// If the gas amount is not set, extract this as it will depend on access
|
|
||||||
// lists and we'll need to reestimate every time
|
// If the gas amount is not set, default to RPC gas cap.
|
||||||
nogas := args.Gas == nil
|
if args.Gas == nil {
|
||||||
|
tmp := hexutil.Uint64(b.RPCGasCap())
|
||||||
|
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
|
||||||
if err := args.setDefaults(ctx, b); err != nil {
|
if err := args.setDefaults(ctx, b); err != nil {
|
||||||
|
|
@ -1552,15 +1555,6 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH
|
||||||
accessList := prevTracer.AccessList()
|
accessList := prevTracer.AccessList()
|
||||||
log.Trace("Creating access list", "input", accessList)
|
log.Trace("Creating access list", "input", accessList)
|
||||||
|
|
||||||
// If no gas amount was specified, each unique access list needs it's own
|
|
||||||
// gas calculation. This is quite expensive, but we need to be accurate
|
|
||||||
// and it's convered by the sender only anyway.
|
|
||||||
if nogas {
|
|
||||||
args.Gas = nil
|
|
||||||
if err := args.setDefaults(ctx, b); err != nil {
|
|
||||||
return nil, 0, nil, err // shouldn't happen, just in case
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Copy the original db so we don't modify it
|
// Copy the original db so we don't modify it
|
||||||
statedb := db.Copy()
|
statedb := db.Copy()
|
||||||
// Set the accesslist to the last al
|
// Set the accesslist to the last al
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue