diff --git a/GeneralStateTests.md b/GeneralStateTests.md index caa48fcf1..257c79a7a 100644 --- a/GeneralStateTests.md +++ b/GeneralStateTests.md @@ -405,7 +405,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3 + create2collisionSelfdestructedOOG.json OK + create2collisionSelfdestructedRevert.json OK + create2collisionStorage.json OK - create2noCash.json Skip ++ create2noCash.json OK + returndatacopy_0_0_following_successful_create.json OK + returndatacopy_afterFailing_create.json OK + returndatacopy_following_create.json OK @@ -413,7 +413,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3 + returndatacopy_following_successful_create.json OK + returndatasize_following_successful_create.json OK ``` -OK: 42/44 Fail: 0/44 Skip: 2/44 +OK: 43/44 Fail: 0/44 Skip: 1/44 ## stCreateTest ```diff + CREATE_AcreateB_BSuicide_BStore.json OK @@ -2645,4 +2645,4 @@ OK: 133/133 Fail: 0/133 Skip: 0/133 OK: 130/130 Fail: 0/130 Skip: 0/130 ---TOTAL--- -OK: 2343/2447 Fail: 0/2447 Skip: 104/2447 +OK: 2344/2447 Fail: 0/2447 Skip: 103/2447 diff --git a/newBlockchainTests.md b/newBlockchainTests.md index dc3af8763..f184acd68 100644 --- a/newBlockchainTests.md +++ b/newBlockchainTests.md @@ -814,7 +814,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3 + create2collisionSelfdestructedOOG.json OK + create2collisionSelfdestructedRevert.json OK + create2collisionStorage.json OK - create2noCash.json Skip ++ create2noCash.json OK + returndatacopy_0_0_following_successful_create.json OK + returndatacopy_afterFailing_create.json OK + returndatacopy_following_create.json OK @@ -822,7 +822,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3 + returndatacopy_following_successful_create.json OK + returndatasize_following_successful_create.json OK ``` -OK: 41/44 Fail: 0/44 Skip: 3/44 +OK: 42/44 Fail: 0/44 Skip: 2/44 ## stCreateTest ```diff + CREATE_AcreateB_BSuicide_BStore.json OK @@ -3028,4 +3028,4 @@ OK: 133/133 Fail: 0/133 Skip: 0/133 OK: 130/130 Fail: 0/130 Skip: 0/130 ---TOTAL--- -OK: 2620/2730 Fail: 0/2730 Skip: 110/2730 +OK: 2621/2730 Fail: 0/2730 Skip: 109/2730 diff --git a/newGeneralStateTests.md b/newGeneralStateTests.md index 3d88f56f9..8e0af5528 100644 --- a/newGeneralStateTests.md +++ b/newGeneralStateTests.md @@ -411,7 +411,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3 + create2collisionSelfdestructedOOG.json OK + create2collisionSelfdestructedRevert.json OK + create2collisionStorage.json OK - create2noCash.json Skip ++ create2noCash.json OK + returndatacopy_0_0_following_successful_create.json OK + returndatacopy_afterFailing_create.json OK + returndatacopy_following_create.json OK @@ -419,7 +419,7 @@ OK: 3/3 Fail: 0/3 Skip: 0/3 + returndatacopy_following_successful_create.json OK + returndatasize_following_successful_create.json OK ``` -OK: 41/44 Fail: 0/44 Skip: 3/44 +OK: 42/44 Fail: 0/44 Skip: 2/44 ## stCreateTest ```diff + CREATE_AcreateB_BSuicide_BStore.json OK @@ -2625,4 +2625,4 @@ OK: 133/133 Fail: 0/133 Skip: 0/133 OK: 130/130 Fail: 0/130 Skip: 0/130 ---TOTAL--- -OK: 2303/2411 Fail: 0/2411 Skip: 108/2411 +OK: 2304/2411 Fail: 0/2411 Skip: 107/2411 diff --git a/nimbus/vm/interpreter/opcodes_impl.nim b/nimbus/vm/interpreter/opcodes_impl.nim index 10b27f93c..250871696 100644 --- a/nimbus/vm/interpreter/opcodes_impl.nim +++ b/nimbus/vm/interpreter/opcodes_impl.nim @@ -597,6 +597,8 @@ proc setupCreate(c: Computation, memPos, len: int, value: Uint256, opCode: stati template genCreate(callName: untyped, opCode: Op): untyped = op callName, inline = false, val, startPosition, size: ## 0xf0, Create a new account with associated code. + checkInStaticContext(c) + let (memPos, len) = (startPosition.safeInt, size.safeInt) if not c.canTransfer(memPos, len, val, opCode): push: 0 @@ -612,8 +614,7 @@ template genCreate(callName: untyped, opCode: Op): untyped = push: 0 else: push: child.msg.contractAddress - - checkInStaticContext(c) + child.applyMessage(Create) genCreate(create, Create) diff --git a/tests/test_allowed_to_fail.nim b/tests/test_allowed_to_fail.nim index 655c8cd31..98f0eddfb 100644 --- a/tests/test_allowed_to_fail.nim +++ b/tests/test_allowed_to_fail.nim @@ -94,11 +94,7 @@ func allowedFailingGeneralStateTest(folder, name: string): bool = # conflicts between native int and big int. # gasFee calculation in modexp precompiled # contracts - "modexp.json", - # perhaps a design flaw with create/create2 opcode. - # a conflict between balance checker and - # static call context checker - "create2noCash.json", + "modexp.json" ] result = name in allowedFailingGeneralStateTests @@ -152,7 +148,6 @@ func skipNewBCTests*(folder: string, name: string): bool = # see allowedFailingGeneralStateTest "modexp.json", - "create2noCash.json", # BC huge memory consumption "randomStatetest94.json",