eosiosg / eos-challenge-contract

ISC License
3 stars 0 forks source link

VMtest gas fee mismatch #36

Closed Frank-AFN closed 4 years ago

Frank-AFN commented 4 years ago

可能原因

  1. evmc_revision 版本原因导致执行的gas fee和expect gas fee对应不上.
  2. vm test中post storage是否有写入导致. reference: https://github.com/ethereum/wiki/wiki/Design-Rationale#gas-and-fees

The cost of the SSTORE opcode, which sets values in account storage, is either: (i) 20000 gas when changing a zero value to a nonzero value, (ii) 5000 gas when changing a zero value to a zero value or a nonzero value to a nonzero value, or (iii) 5000 gas when changing a nonzero value to a zero value, plus a 15000 gas refund to be given at the end of successful transaction execution (ie. NOT an execution leading to an out-of-gas exception)

Frank-AFN commented 4 years ago

sstore_load_0

sstore_load_0 /Users/vince/CLionProjects/aleth/test/tools/jsontests/vm.cpp:437: error: in "VMTests/vmIOandFlowOperations": check toU256(testInput.at("gas")) == fev.gas has failed [39932 != 39182]

Frontier to Istanbul gas from 50 to 800 https://eips.ethereum.org/EIPS/eip-2200

Frank-AFN commented 4 years ago

expXY_success 需要进一步查看

expXY_success /Users/vince/CLionProjects/aleth/test/tools/jsontests/vm.cpp:437: error: in "VMTests/vmArithmeticTest": check toU256(testInput.at("gas")) == fev.gas has failed [39853 != 38353]

Frank-AFN commented 4 years ago

TestNameRegistrator /Users/vince/CLionProjects/aleth/test/tools/jsontests/vm.cpp:437: error: in "VMTests/vmSystemOperations": check toU256(testInput.at("gas")) == fev.gas has failed [79915 != 79165]

Frank-AFN commented 4 years ago

Fix in commit: https://github.com/eosiosg/eos-challenge/commit/6a4a2015d453e6e983c177e6185836dc75f9c78a