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
{{ message }}
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
for example:
program.getGas()=100
gasCost=40
callGasWord comes from stack, it is 100 when call is contract call, and 0 when call is transfer. transfer is OK, but for contract call callGasWord is 100, gasLeft is 60, blockchainConfig.getCallGas will throw the exception.
The text was updated successfully, but these errors were encountered:
gasLeft = 100; // gas left for the rest of the program execution
callGas = 100; // amount of gas that underlying call should be supplied with
The steps are
gasLeft = 100 - 40; // gasLeft is reduced by 40gas, the CALL price
if (callGas > gasLeft) throw; // program throws, cause there is not enough gas to supply underlying call
gasLeft = 100; // gas left for the rest of the program execution
callGas = 100; // amount of gas that underlying call should be supplied with
The steps are
gasLeft = 100 - 40; // gasLeft is reduced by 40gas, the CALL price
if (callGas > gasLeft) throw; // program throws, cause there is not enough gas to supply underlying call
Isn't it a correct behavior?
It's a correct behavior, but not a correct logic.
Comment on BlockchainConfig.getCallGas() says:
Calculates available gas to be passed for callee Since EIP150
But i'm afraid it's not implemented in AbstractConfig.getCallGas(), try this:
When I executed ethereumj with a solidity program, I found that the requred gas is greater than left gas, throwing an exception.
org.ethereum.vm.VM#step
for example:
program.getGas()=100
gasCost=40
callGasWord comes from stack, it is 100 when call is contract call, and 0 when call is transfer. transfer is OK, but for contract call callGasWord is 100, gasLeft is 60, blockchainConfig.getCallGas will throw the exception.
The text was updated successfully, but these errors were encountered: