evm2wasm
evm2wasm copied to clipboard
call_OOG_additionalGasCosts1 test failing
I spent quite some time on this the past couple of days, along with @jwasinger @hugo-dc @cdetrio @jakelang. The expected behavior of this test (https://github.com/ethereum/tests/blob/develop/src/GeneralStateTestsFiller/stCallCodes/call_OOG_additionalGasCosts1Filler.json#L47) changed with EIP158, from:
"network" : ["Frontier","Homestead", "EIP150"],
"result" : {
"1000000000000000000000000000000000000001" : {
"shouldnotexist" : "1"
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "30000"
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "999999999999970000"
}
}
to
"indexes" : { "data" : -1, "gas" : -1, "value" : -1 },
"network" : [">=EIP158"],
"result" : {
"1000000000000000000000000000000000000001" : {
"shouldnotexist" : "1"
},
"2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
"balance" : "21727"
},
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "999999999999978273"
}
For some reason Hera is still exhibiting the old, pre-158 behavior and its results match. We thought Hera was already updated for EIP-158. Hera is running out of gas on this line (https://github.com/ewasm/hera/blob/501406933c64cd8ffe3c5bd2560b84b677d1228b/src/eei.cpp#L732) when it tries to charge the 25,000 extra gas for a tx to a nonexistent account.
My Hera trace of the error: https://gist.github.com/lrettig/88008d82e6d78eff1e2bf0d437f5870d
Hugo's cpp-ethereum reference trace: https://gist.github.com/hugo-dc/a079761e20d1bdb6f29224be1a6a30cb. Note that ethereumjs trace matches cpp-ethereum's.