mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
fix: avoid capping warnings for gas set by internal system transactions
This commit is contained in:
parent
693d8aebcd
commit
3cb949f674
1 changed files with 12 additions and 1 deletions
|
|
@ -398,7 +398,18 @@ func (args *TransactionArgs) CallDefaults(globalGasCap uint64, baseFee *big.Int,
|
||||||
}
|
}
|
||||||
args.Gas = (*hexutil.Uint64)(&gas)
|
args.Gas = (*hexutil.Uint64)(&gas)
|
||||||
} else {
|
} else {
|
||||||
if globalGasCap > 0 && globalGasCap < uint64(*args.Gas) {
|
// Gas set for system calls
|
||||||
|
systemCallGas := (hexutil.Uint64)(uint64(math.MaxUint64 / 2))
|
||||||
|
|
||||||
|
gas := globalGasCap
|
||||||
|
if gas == 0 {
|
||||||
|
gas = uint64(math.MaxUint64 / 2)
|
||||||
|
}
|
||||||
|
if args.Gas != nil && *args.Gas != systemCallGas {
|
||||||
|
gas = uint64(*args.Gas)
|
||||||
|
}
|
||||||
|
|
||||||
|
if globalGasCap > 0 && globalGasCap < gas {
|
||||||
log.Warn("Caller gas above allowance, capping", "requested", args.Gas, "cap", globalGasCap)
|
log.Warn("Caller gas above allowance, capping", "requested", args.Gas, "cap", globalGasCap)
|
||||||
args.Gas = (*hexutil.Uint64)(&globalGasCap)
|
args.Gas = (*hexutil.Uint64)(&globalGasCap)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue