fix RevertInCreateInInit problem

This commit is contained in:
andri lim 2019-05-02 12:59:10 +07:00 committed by zah
parent 86d5653a4c
commit fd8a649df3
3 changed files with 8 additions and 6 deletions

View File

@ -1686,7 +1686,7 @@ OK: 37/38 Fail: 0/38 Skip: 1/38
+ RevertDepthCreateAddressCollision.json OK
+ RevertDepthCreateOOG.json OK
+ RevertInCallCode.json OK
RevertInCreateInInit.json Skip
+ RevertInCreateInInit.json OK
+ RevertInDelegateCall.json OK
+ RevertInStaticCall.json OK
+ RevertOnEmptyStack.json OK
@ -1722,7 +1722,7 @@ OK: 37/38 Fail: 0/38 Skip: 1/38
+ TouchToEmptyAccountRevert2.json OK
+ TouchToEmptyAccountRevert3.json OK
```
OK: 40/46 Fail: 0/46 Skip: 6/46
OK: 41/46 Fail: 0/46 Skip: 5/46
## stSStoreTest
```diff
InitCollision.json Skip
@ -2645,4 +2645,4 @@ OK: 133/133 Fail: 0/133 Skip: 0/133
OK: 130/130 Fail: 0/130 Skip: 0/130
---TOTAL---
OK: 2254/2447 Fail: 0/2447 Skip: 193/2447
OK: 2255/2447 Fail: 0/2447 Skip: 192/2447

View File

@ -12,7 +12,7 @@ import
./interpreter/[opcode_values, gas_meter, gas_costs, vm_forks],
./code_stream, ./memory, ./message, ./stack, ../db/[state_db, db_chain],
../utils/header, byteutils, ranges, precompiles,
transaction_tracer
transaction_tracer, eth/trie/trie_defs
logScope:
topics = "vm computation"
@ -199,7 +199,10 @@ proc applyMessage*(computation: BaseComputation, opCode: static[Op]) =
when opCode == Create:
if computation.getFork >= FkSpurious:
computation.vmState.mutateStateDb:
db.incNonce(computation.msg.storageAddress)
db.incNonce(computation.msg.storageAddress)
if computation.getFork >= FkByzantium:
# RevertInCreateInInit.json
db.setStorageRoot(computation.msg.storageAddress, emptyRlpHash)
when opCode in {CallCode, Call, Create}:
computation.transferBalance(opCode)

View File

@ -14,7 +14,6 @@
func allowedFailingGeneralStateTest*(folder, name: string): bool =
let allowedFailingGeneralStateTests = @[
"CreateOOGafterInitCodeReturndataSize.json",
"RevertInCreateInInit.json",
"modexp.json",
# all these tests below actually pass