You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IntrinsicGas in core/state_transition.go calculates intrinsic gas for a given transaction. Cost calculation of data field take care of overflow while the calculation for Access List doesn't. (Please see code below)
In general, a transaction causing overflow at this point might be blocked by another check (e.g. TxPool slot limit). But evm transaction command which validates a transaction offline might return wrong result by this problem.
Ideally, IntrinsicGas should check overflow in calculation for AccessList cost like this:
ifaccessList!=nil {
numItems:=uint64(len(accessList))
if (math.MaxUint64-gas)/params.TxAccessListAddressGas<numItems {
return0, ErrGasUintOverflow
}
gas+=numItems*params.TxAccessListAddressGasnumStorageKeys:=uint64(accessList.StorageKeys())
if (math.MaxUint64-gas)/params.TxAccessListStorageKeyGas<numStorageKeys {
return0, ErrGasUintOverflow
}
gas+=numStorageKeys*params.TxAccessListStorageKeyGas
}
The text was updated successfully, but these errors were encountered:
Geth version:
1.14.13-unstable
Commit hash :
master
branch (08e6bdb550712503873fb2a138b30132cc36c481
)IntrinsicGas
incore/state_transition.go
calculates intrinsic gas for a given transaction. Cost calculation ofdata
field take care of overflow while the calculation for Access List doesn't. (Please see code below)go-ethereum/core/state_transition.go
Lines 104 to 115 in 08e6bdb
In general, a transaction causing overflow at this point might be blocked by another check (e.g. TxPool slot limit). But
evm transaction
command which validates a transaction offline might return wrong result by this problem.Ideally,
IntrinsicGas
should check overflow in calculation for AccessList cost like this:The text was updated successfully, but these errors were encountered: