VM gas cost:
+ fixed the memory usage, not to be charged by one more general step
This commit is contained in:
parent
a47ecf6f90
commit
115d416e78
|
@ -81,12 +81,6 @@ public class VM {
|
||||||
case CALL:
|
case CALL:
|
||||||
program.spendGas(GasCost.CALL);
|
program.spendGas(GasCost.CALL);
|
||||||
break;
|
break;
|
||||||
case MSTORE8:
|
|
||||||
case MSTORE:
|
|
||||||
// TODO: [cpp impl] do this when [go impl] spend just the usage size
|
|
||||||
// TODO: https://github.com/ethereum/cpp-ethereum/blob/develop/libevm/VM.h#L183
|
|
||||||
program.spendGas(GasCost.STEP);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
program.spendGas(GasCost.STEP);
|
program.spendGas(GasCost.STEP);
|
||||||
break;
|
break;
|
||||||
|
@ -572,6 +566,9 @@ public class VM {
|
||||||
this.step(program);
|
this.step(program);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
program.setRuntimeFailure(e);
|
program.setRuntimeFailure(e);
|
||||||
|
} finally{
|
||||||
|
|
||||||
|
// todo: Here wrap the storage into result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue