From adb1286e286a320611167e2d2bdb6ada8669f4df Mon Sep 17 00:00:00 2001 From: andri lim Date: Sat, 16 Mar 2019 12:13:57 +0700 Subject: [PATCH] fix create hash collision, GST +1 --- GeneralStateTests.md | 6 +++--- nimbus/vm/interpreter/opcodes_impl.nim | 4 +++- tests/test_generalstate_failing.nim | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/GeneralStateTests.md b/GeneralStateTests.md index 346c93af3..7c4a0f887 100644 --- a/GeneralStateTests.md +++ b/GeneralStateTests.md @@ -2044,7 +2044,7 @@ OK: 0/284 Fail: 0/284 Skip: 284/284 + CallToReturn1ForDynamicJump0.json OK + CallToReturn1ForDynamicJump1.json OK + CalltoReturn2.json OK - CreateHashCollision.json Skip ++ CreateHashCollision.json OK + PostToReturn1.json OK + TestNameRegistrator.json OK + balanceInputAddressTooBig.json OK @@ -2083,7 +2083,7 @@ OK: 0/284 Fail: 0/284 Skip: 284/284 + suicideSendEtherToMe.json OK + testRandomTest.json OK ``` -OK: 52/67 Fail: 0/67 Skip: 15/67 +OK: 53/67 Fail: 0/67 Skip: 14/67 ## stTransactionTest ```diff + ContractStoreClearsOOG.json OK @@ -2520,4 +2520,4 @@ OK: 0/133 Fail: 0/133 Skip: 133/133 OK: 0/130 Fail: 0/130 Skip: 130/130 ---TOTAL--- -OK: 1229/2334 Fail: 0/2334 Skip: 1105/2334 +OK: 1230/2334 Fail: 0/2334 Skip: 1104/2334 diff --git a/nimbus/vm/interpreter/opcodes_impl.nim b/nimbus/vm/interpreter/opcodes_impl.nim index 917279dfa..2caa3a436 100644 --- a/nimbus/vm/interpreter/opcodes_impl.nim +++ b/nimbus/vm/interpreter/opcodes_impl.nim @@ -560,7 +560,7 @@ proc setupCreate(computation: var BaseComputation, memPos, len: int, value: Uint if isCollision: debug "Address collision while creating contract", address = contractAddress.toHex push: 0 - raise newException(ValidationError, "Contract creation failed, address already in use") + return let childMsg = prepareChildMessage( computation, @@ -585,6 +585,8 @@ op create, inline = false, value, startPosition, size: return var childComp = setupCreate(computation, memPos, len, value) + if childComp.isNil: return + computation.applyChildComputation(childComp, Create) if childComp.isError: diff --git a/tests/test_generalstate_failing.nim b/tests/test_generalstate_failing.nim index f9e0efbf1..1964ff9ee 100644 --- a/tests/test_generalstate_failing.nim +++ b/tests/test_generalstate_failing.nim @@ -63,7 +63,6 @@ func allowedFailingGeneralStateTest*(folder, name: string): bool = "RevertOpcodeReturn.json", "RevertOpcodeWithBigOutputInInit.json", "tx_e1c174e2.json", - "CreateHashCollision.json", "suicideCoinbase.json", "Opcodes_TransactionInit.json", "SuicidesMixingCoinbase.json",