diff options
10 files changed, 1009 insertions, 0 deletions
diff --git a/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount.json b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount.json new file mode 100644 index 000000000..4e9214e51 --- /dev/null +++ b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount.json @@ -0,0 +1,91 @@ +{ + "extCodeHashDeletedAccount" : { + "_info" : { + "comment" : "Get account A (aaaaaaaa00000000000000000000000000000000) code hash, code size, and code\nCalls Account A's code which causes self destruction of A\nGet account A codehash, code size and code\nIt is still getting the same values because selfdestruct is performed\nat the end of transaction during state finalization stage.\n", + "filledwith" : "testeth 1.5.0-alpha.6-49+commit.4897b8bb", + "lllcversion" : "Version: 0.5.0-develop.2018.11.8+commit.20481055.Linux.g++", + "source" : "src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccountFiller.yml", + "sourceHash" : "fa10ed88ae97006f6b03ca0b4ffc8ae5168d2004bfbbd9cb8221cc179b76e7f3" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Constantinople" : [ + { + "hash" : "0x8621bc3fcc688bc0507ac16cd2025292c360a3356e5bf779bf8dfccd32377bf6", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6020600060006000600073deadbeef00000000000000000000000000000000620249f0f1506020600060003e6000516000556020600060006000600073deadbeef00000000000000000000000000000001620249f0f1506020600060003e6000516001556020600060006000600073deadbeef00000000000000000000000000000002620249f0f1506020600060003e6000516002556020600060006000600073aaaaaaaa00000000000000000000000000000000620249f0f1506020600060006000600073deadbeef00000000000000000000000000000000620249f0f1506020600060003e6000516003556020600060006000600073deadbeef00000000000000000000000000000001620249f0f1506020600060003e6000516004556020600060006000600073deadbeef00000000000000000000000000000002620249f0f1506020600060003e600051600555", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x00", + "nonce" : "0x00", + "storage" : { + } + }, + "0xaaaaaaaa00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73deadbeef00000000000000000000000000000000ff", + "nonce" : "0x00", + "storage" : { + } + }, + "0xdeadbeef00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73aaaaaaaa000000000000000000000000000000003f60005260206000f3", + "nonce" : "0x00", + "storage" : { + } + }, + "0xdeadbeef00000000000000000000000000000001" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73aaaaaaaa000000000000000000000000000000003b60005260206000f3", + "nonce" : "0x00", + "storage" : { + } + }, + "0xdeadbeef00000000000000000000000000000002" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73aaaaaaaa000000000000000000000000000000003b6000600073aaaaaaaa000000000000000000000000000000003c60206000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x061a80" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0x01" + ] + } + } +}
\ No newline at end of file diff --git a/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount1.json b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount1.json new file mode 100644 index 000000000..76e41ffd8 --- /dev/null +++ b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount1.json @@ -0,0 +1,77 @@ +{ + "extCodeHashDeletedAccount1" : { + "_info" : { + "comment" : "1) Account A already exists in the state and contains code\nCall to Account B do the following:\n- stores Account A code hash to 1\n- stores Account A code size to 2\n- stores Account A code to 3\n- Run selfdestruct on A\n- stores Account A code hash to 4\n- stores Account A code size to 5\n- stores Account A code to 6\n", + "filledwith" : "testeth 1.5.0-alpha.6-49+commit.4897b8bb", + "lllcversion" : "Version: 0.5.0-develop.2018.11.8+commit.20481055.Linux.g++", + "source" : "src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount1Filler.yml", + "sourceHash" : "ce870dddcddc514d6bf9d0232cd1926e4ec1e875a330b80d8f7cc2aabbd6f0d0" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Constantinople" : [ + { + "hash" : "0xa3351a168ff2dcecf68704dcb541a7ee5597d205453834d265dfc7300e38e563", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6020600060006000600073bbbbbbbb0000000000000000000000000000000062027100f1", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x00", + "nonce" : "0x00", + "storage" : { + } + }, + "0xaaaaaaaa00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73deadbeef0000000000000000000000000000000031ff", + "nonce" : "0x00", + "storage" : { + } + }, + "0xbbbbbbbb00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73aaaaaaaa000000000000000000000000000000003f60015573aaaaaaaa000000000000000000000000000000003b6002556002546000600073aaaaaaaa000000000000000000000000000000003c6000516003556020600060006000600073aaaaaaaa00000000000000000000000000000000620249f0f15073aaaaaaaa000000000000000000000000000000003f60045573aaaaaaaa000000000000000000000000000000003b6005556005546000602073aaaaaaaa000000000000000000000000000000003c602051600655", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x061a80" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0x01" + ] + } + } +}
\ No newline at end of file diff --git a/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount2.json b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount2.json new file mode 100644 index 000000000..d1325c6ed --- /dev/null +++ b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount2.json @@ -0,0 +1,77 @@ +{ + "extCodeHashDeletedAccount2" : { + "_info" : { + "comment" : "2) Account A already exists in the state and contains code\nCall to Account B stores Account A code hash to 1, code size to 2, code to 3\nCall to Account C runs self destruct on A\nCall to Account B stores Account A code hash to 4, code size to 5, code to 6\n", + "filledwith" : "testeth 1.5.0-alpha.6-49+commit.4897b8bb", + "lllcversion" : "Version: 0.5.0-develop.2018.11.8+commit.20481055.Linux.g++", + "source" : "src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount2Filler.yml", + "sourceHash" : "c84ffe96f1f5d4cb8bedb7995fe16953f22f0836dd958a48fcdbe2c3e96e7540" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Constantinople" : [ + { + "hash" : "0x32a594bdf43e5c24677eaa10c569b9aebfb4f548c14363c8908171d0fe674c68", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60016000526020600060206000600073bbbbbbbb00000000000000000000000000000000620249f0f1506020600060006000600073aaaaaaaa00000000000000000000000000000000620249f0f15060046020526020600060206020600073bbbbbbbb00000000000000000000000000000000620249f0f1", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x00", + "nonce" : "0x00", + "storage" : { + } + }, + "0xaaaaaaaa00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73deadbeef0000000000000000000000000000000031ff", + "nonce" : "0x00", + "storage" : { + } + }, + "0xbbbbbbbb00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6020600060003773aaaaaaaa000000000000000000000000000000003f6000515573aaaaaaaa000000000000000000000000000000003b602052600160005101600052602051600051556001600051016000526020516000604073aaaaaaaa000000000000000000000000000000003c60405160005155", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x061a80" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0x01" + ] + } + } +}
\ No newline at end of file diff --git a/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount3.json b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount3.json new file mode 100644 index 000000000..adf83a7ab --- /dev/null +++ b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount3.json @@ -0,0 +1,77 @@ +{ + "extCodeHashDeletedAccount3" : { + "_info" : { + "comment" : "3) Call creates Account A (0x95ab1c33798981918da6d27056f70376674878d2)\nCall to Account B do the following:\n- stores Account A code hash to 1\n- stores Account A code size to 2\n- stores Account A code to 3\n- Run selfdestruct on A\n- stores Account A code hash to 4\n- stores Account A code size to 5\n- stores Account A code to 6\n", + "filledwith" : "testeth 1.5.0-alpha.6-49+commit.4897b8bb", + "lllcversion" : "Version: 0.5.0-develop.2018.11.8+commit.20481055.Linux.g++", + "source" : "src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount3Filler.yml", + "sourceHash" : "60606f099bc3a37294c492f227e7899637f922f04763dbfabdbeb216ba9d8857" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Constantinople" : [ + { + "hash" : "0xf5fbc7006e2fcda26c72bbf7379a2a503719d062a1793813497aba13c7c40fdc", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6000603c80603f60003960006000f56000526000516000556020600060006000600073bbbbbbbb00000000000000000000000000000000620249f0f15000fe73cccccccc000000000000000000000000000000003b6000526000516000602073cccccccc000000000000000000000000000000003c6000516020f3", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x00", + "nonce" : "0x00", + "storage" : { + } + }, + "0xbbbbbbbb00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x7395ab1c33798981918da6d27056f70376674878d23f6001557395ab1c33798981918da6d27056f70376674878d23b600255600254600060007395ab1c33798981918da6d27056f70376674878d23c600051600355602060006000600060007395ab1c33798981918da6d27056f70376674878d2620249f0f1507395ab1c33798981918da6d27056f70376674878d23f6004557395ab1c33798981918da6d27056f70376674878d23b600555600554600060207395ab1c33798981918da6d27056f70376674878d23c602051600655", + "nonce" : "0x00", + "storage" : { + } + }, + "0xcccccccc00000000000000000000000000000000" : { + "balance" : "0x00", + "code" : "0x73bbbbbbbb00000000000000000000000000000000ff", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x061a80" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0x01" + ] + } + } +}
\ No newline at end of file diff --git a/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount4.json b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount4.json new file mode 100644 index 000000000..c5a02acc2 --- /dev/null +++ b/GeneralStateTests/stExtCodeHash/extCodeHashDeletedAccount4.json @@ -0,0 +1,84 @@ +{ + "extCodeHashDeletedAccount4" : { + "_info" : { + "comment" : "4) Call creates Account A\nCall to Account B stores Account A hash to 1\nCall to Account C runs self destruct on A\nCall to Account B stores Account a hash to 2\n", + "filledwith" : "testeth 1.5.0-alpha.6-49+commit.4897b8bb", + "lllcversion" : "Version: 0.5.0-develop.2018.11.8+commit.20481055.Linux.g++", + "source" : "src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount4Filler.yml", + "sourceHash" : "4ac76949182f9d30a1b62b30ea5a5e4a86f764a49b779494bf303f71f2f48bb2" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Constantinople" : [ + { + "hash" : "0x599cc0fcffdf19148006073244457e01beb7102dd483aa57f5a5c159573a3270", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6000603c80609360003960006000f560005260005160005560016020526020600060206020600073bbbbbbbb00000000000000000000000000000000620249f0f1506020600060006000600073cccccccc00000000000000000000000000000000620249f0f15060046040526020600060206040600073bbbbbbbb00000000000000000000000000000000620249f0f15000fe73dddddddd000000000000000000000000000000003b6000526000516000602073dddddddd000000000000000000000000000000003c6000516020f3", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "", + "nonce" : "0x00", + "storage" : { + } + }, + "0xbbbbbbbb00000000000000000000000000000000" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6020600060003773e713449c212d891357cc2966816b1d528cfb59e03f6000515560016000510160005273e713449c212d891357cc2966816b1d528cfb59e03b60005155600051546000602073e713449c212d891357cc2966816b1d528cfb59e03c60016000510160005260205160005155", + "nonce" : "0x00", + "storage" : { + } + }, + "0xcccccccc00000000000000000000000000000000" : { + "balance" : "0x00", + "code" : "0x6020600060006000600073e713449c212d891357cc2966816b1d528cfb59e0620249f0f1", + "nonce" : "0x00", + "storage" : { + } + }, + "0xdddddddd00000000000000000000000000000000" : { + "balance" : "0x00", + "code" : "0x73bbbbbbbb00000000000000000000000000000000ff", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x061a80" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0x01" + ] + } + } +}
\ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount1Filler.yml b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount1Filler.yml new file mode 100644 index 000000000..cf5bc3abd --- /dev/null +++ b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount1Filler.yml @@ -0,0 +1,103 @@ +# EXTCODEHASH to a deleted account +--- +extCodeHashDeletedAccount1: + _info: + comment: | + 1) Account A already exists in the state and contains code + Call to Account B do the following: + - stores Account A code hash to 1 + - stores Account A code size to 2 + - stores Account A code to 3 + - Run selfdestruct on A + - stores Account A code hash to 4 + - stores Account A code size to 5 + - stores Account A code to 6 + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: '0x20000' + currentGasLimit: "1000000" + currentNumber: "1" + currentTimestamp: "1000" + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + pre: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000000' + code: | + { + (CALL 160000 0xbbbbbbbb00000000000000000000000000000000 0 0 0 0 32) + } + nonce: '0' + storage: {} + # Account A: already exists in the state + # contains selfdestruct code + aaaaaaaa00000000000000000000000000000000: + balance: '1000000000000000000' + code: | + { + (SELFDESTRUCT (BALANCE 0xdeadbeef00000000000000000000000000000000)) + } + nonce: '0' + storage: {} + # Account B + # Stores Account A code hash to 1, code size to 2, code to 3 + # Run selfdestruct on A + # Stores Account A code hash to 4, code size to 5, code to 6 + bbbbbbbb00000000000000000000000000000000: + balance: '1000000000000000000' + code: | + { + [[1]] (EXTCODEHASH 0xaaaaaaaa00000000000000000000000000000000) + [[2]] (EXTCODESIZE 0xaaaaaaaa00000000000000000000000000000000) + (EXTCODECOPY 0xaaaaaaaa00000000000000000000000000000000 0 0 (SLOAD 2)) + [[3]] (MLOAD 0) + + (CALL 150000 0xaaaaaaaa00000000000000000000000000000000 0 0 0 0 32) + + [[4]] (EXTCODEHASH 0xaaaaaaaa00000000000000000000000000000000) + [[5]] (EXTCODESIZE 0xaaaaaaaa00000000000000000000000000000000) + (EXTCODECOPY 0xaaaaaaaa00000000000000000000000000000000 32 0 (SLOAD 5)) + [[6]] (MLOAD 32) + } + nonce: '0' + storage: {} + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '0x00' + nonce: '0' + storage: {} + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + network: + - '>=Constantinople' + result: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000001' + storage: { + + } + aaaaaaaa00000000000000000000000000000000: + shouldnotexist: '1' + bbbbbbbb00000000000000000000000000000000: + balance: '1000000000000000000' + storage: { + 1: '0x9dff858fbcae72e5644a465fa893f46deb3e03b9cd5a8b531109cd577f7fb293', + 2: '0x17', + 3: '0x73deadbeef0000000000000000000000000000000031ff000000000000000000', + 4: '0x9dff858fbcae72e5644a465fa893f46deb3e03b9cd5a8b531109cd577f7fb293', + 5: '0X17', + 6: '0x73deadbeef0000000000000000000000000000000031ff000000000000000000' + } + transaction: + data: + - '' + gasLimit: + - '400000' + gasPrice: '1' + nonce: '0' + secretKey: 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 + to: 095e7baea6a6c7c4c2dfeb977efac326af552d87 + value: + - '1' diff --git a/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount2Filler.yml b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount2Filler.yml new file mode 100644 index 000000000..aa2a0d0a6 --- /dev/null +++ b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount2Filler.yml @@ -0,0 +1,101 @@ +# EXTCODEHASH to a deleted account +--- +extCodeHashDeletedAccount2: + _info: + comment: | + 2) Account A already exists in the state and contains code + Call to Account B stores Account A code hash to 1, code size to 2, code to 3 + Call to Account C runs self destruct on A + Call to Account B stores Account A code hash to 4, code size to 5, code to 6 + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: '0x20000' + currentGasLimit: "1000000" + currentNumber: "1" + currentTimestamp: "1000" + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + pre: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000000' + code: | + { + (MSTORE 0 0x01) + (CALL 150000 0xbbbbbbbb00000000000000000000000000000000 0 0 32 0 32) + + (CALL 150000 0xaaaaaaaa00000000000000000000000000000000 0 0 0 0 32) + + (MSTORE 32 0x04) + (CALL 150000 0xbbbbbbbb00000000000000000000000000000000 0 32 32 0 32) + } + nonce: '0' + storage: {} + # Acount A: already exists in the state + # contains selfdestruct code + aaaaaaaa00000000000000000000000000000000: + balance: '1000000000000000000' + code: | + { + (SELFDESTRUCT (BALANCE 0xdeadbeef00000000000000000000000000000000)) + } + nonce: '0' + storage: {} + # Account B + # Receives storage key as call data + bbbbbbbb00000000000000000000000000000000: + balance: '1000000000000000000' + code: | + { + (CALLDATACOPY 0 0 32) + (SSTORE (MLOAD 0) (EXTCODEHASH 0xaaaaaaaa00000000000000000000000000000000)) + + (MSTORE 32 (EXTCODESIZE 0xaaaaaaaa00000000000000000000000000000000)) + + (MSTORE 0 (ADD (MLOAD 0) 1)) + (SSTORE (MLOAD 0) (MLOAD 32)) + + (MSTORE 0 (ADD (MLOAD 0) 1)) + (EXTCODECOPY 0xaaaaaaaa00000000000000000000000000000000 64 0 (MLOAD 32)) + (SSTORE (MLOAD 0) (MLOAD 64)) + } + nonce: '0' + storage: {} + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '0x00' + nonce: '0' + storage: {} + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + network: + - '>=Constantinople' + result: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000001' + storage: {} + aaaaaaaa00000000000000000000000000000000: + shouldnotexist: '1' + bbbbbbbb00000000000000000000000000000000: + balance: '1000000000000000000' + storage: { + 1: '0x9dff858fbcae72e5644a465fa893f46deb3e03b9cd5a8b531109cd577f7fb293', + 2: '0x17', + 3: '0x73deadbeef0000000000000000000000000000000031ff000000000000000000', + 4: '0x9dff858fbcae72e5644a465fa893f46deb3e03b9cd5a8b531109cd577f7fb293', + 5: '0x17', + 6: '0x73deadbeef0000000000000000000000000000000031ff000000000000000000' + } + transaction: + data: + - '' + gasLimit: + - '400000' + gasPrice: '1' + nonce: '0' + secretKey: 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 + to: 095e7baea6a6c7c4c2dfeb977efac326af552d87 + value: + - '1' + diff --git a/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount3Filler.yml b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount3Filler.yml new file mode 100644 index 000000000..2e1480d12 --- /dev/null +++ b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount3Filler.yml @@ -0,0 +1,121 @@ +# EXTCODEHASH to a deleted account +--- +extCodeHashDeletedAccount3: + _info: + comment: | + 3) Call creates Account A (0x95ab1c33798981918da6d27056f70376674878d2) + Call to Account B do the following: + - stores Account A code hash to 1 + - stores Account A code size to 2 + - stores Account A code to 3 + - Run selfdestruct on A + - stores Account A code hash to 4 + - stores Account A code size to 5 + - stores Account A code to 6 + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: '0x20000' + currentGasLimit: "1000000" + currentNumber: "1" + currentTimestamp: "1000" + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + pre: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000000' + code: | + { + ;; Creates Account A using code in existing account C + (MSTORE 0 + (CREATE2 0 0 + (lll + { + (MSTORE 0 (EXTCODESIZE 0xcccccccc00000000000000000000000000000000)) + (EXTCODECOPY 0xcccccccc00000000000000000000000000000000 + 32 + 0 + (MLOAD 0)) + (RETURN 32 (MLOAD 0)) + } + 0) + 0)) + + ;; Stores new Account A address + [[0]] (MLOAD 0) + + ;; Call Account B: + (CALL 150000 0xbbbbbbbb00000000000000000000000000000000 0 0 0 0 32) + (STOP) + } + nonce: '0' + storage: {} + bbbbbbbb00000000000000000000000000000000: + balance: '1000000000000000000' + code: | + { + ;; Stores Account A hash to 1 + [[1]] (EXTCODEHASH 0x95ab1c33798981918da6d27056f70376674878d2) + [[2]] (EXTCODESIZE 0x95ab1c33798981918da6d27056f70376674878d2) + + (EXTCODECOPY 0x95ab1c33798981918da6d27056f70376674878d2 0 0 (SLOAD 2)) + [[3]] (MLOAD 0) + ;; Run self destruct on Account A + (CALL 150000 0x95ab1c33798981918da6d27056f70376674878d2 0 0 0 0 32) + + ;; Stores Account A hash to 2 + [[4]] (EXTCODEHASH 0x95ab1c33798981918da6d27056f70376674878d2) + [[5]] (EXTCODESIZE 0x95ab1c33798981918da6d27056f70376674878d2) + (EXTCODECOPY 0x95ab1c33798981918da6d27056f70376674878d2 32 0 (SLOAD 5)) + [[6]] (MLOAD 32) + } + nonce: '0' + storage: {} + cccccccc00000000000000000000000000000000: + balance: '0' + code: | + { + (SELFDESTRUCT 0xbbbbbbbb00000000000000000000000000000000) + } + nonce: '0' + storage: {} + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '0x00' + nonce: '0' + storage: {} + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + network: + - '>=Constantinople' + result: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000001' + storage: { + 0: '0x95ab1c33798981918da6d27056f70376674878d2' + } + bbbbbbbb00000000000000000000000000000000: + balance: '1000000000000000000' + storage: { + 1: '0xb05d47e0911e4f67786f4cdc582608ee5f731e845a1e95ddc99759e2b3da81bf', + 2: '0x16', + 3: '0x73bbbbbbbb00000000000000000000000000000000ff00000000000000000000', + 4: '0xb05d47e0911e4f67786f4cdc582608ee5f731e845a1e95ddc99759e2b3da81bf', + 5: '0X16', + 6: '0x73bbbbbbbb00000000000000000000000000000000ff00000000000000000000', + } + 95ab1c33798981918da6d27056f70376674878d2: + shouldnotexist: '1' + transaction: + data: + - '' + gasLimit: + - '400000' + gasPrice: '1' + nonce: '0' + secretKey: 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 + to: 095e7baea6a6c7c4c2dfeb977efac326af552d87 + value: + - '1' + diff --git a/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount4Filler.yml b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount4Filler.yml new file mode 100644 index 000000000..2ded64eef --- /dev/null +++ b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccount4Filler.yml @@ -0,0 +1,135 @@ +# EXTCODEHASH to a deleted account +--- +extCodeHashDeletedAccount4: + _info: + comment: | + 4) Call creates Account A + Call to Account B stores Account A hash to 1 + Call to Account C runs self destruct on A + Call to Account B stores Account a hash to 2 + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: '0x20000' + currentGasLimit: "1000000" + currentNumber: "1" + currentTimestamp: "1000" + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + pre: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000000' + code: | + { + ;; Creates Account A using code in existing account D + (MSTORE 0 + (CREATE2 0 0 + (lll + { + (MSTORE 0 (EXTCODESIZE 0xdddddddd00000000000000000000000000000000)) + (EXTCODECOPY 0xdddddddd00000000000000000000000000000000 + 32 + 0 + (MLOAD 0)) + (RETURN 32 (MLOAD 0)) + } + 0) + 0)) + + ;; Stores new Account A address + [[0]] (MLOAD 0) + + ;; Call Account B: + ;; Stores Account A code hash to 1, code size to 2, code to 3 + (MSTORE 32 0x01) + (CALL 150000 0xbbbbbbbb00000000000000000000000000000000 0 32 32 0 32) + + ;; Call Account C: + ;; Runs self Destructs on Account A + (CALL 150000 0xcccccccc00000000000000000000000000000000 0 0 0 0 32) + + ;; Call Account B: + ;; Stores Account B code hash to 4, code size to 5, code to 6 + (MSTORE 64 0x04) + (CALL 150000 0xbbbbbbbb00000000000000000000000000000000 0 64 32 0 32) + + (STOP) + } + nonce: '0' + storage: {} + bbbbbbbb00000000000000000000000000000000: + balance: '1000000000000000000' + code: | + { + ;; get key from call data + (CALLDATACOPY 0 0 32) + + ;; store Account A code hash + [[(MLOAD 0)]] (EXTCODEHASH 0xe713449c212d891357cc2966816b1d528cfb59e0) + + (MSTORE 0 (ADD (MLOAD 0) 1)) ;; increments storage key + [[(MLOAD 0)]] (EXTCODESIZE 0xe713449c212d891357cc2966816b1d528cfb59e0) + + (EXTCODECOPY 0xe713449c212d891357cc2966816b1d528cfb59e0 32 0 (SLOAD (MLOAD 0))) + (MSTORE 0 (ADD (MLOAD 0) 1)) ;; increments storage key + [[(MLOAD 0)]] (MLOAD 32) + } + nonce: '0' + storage: {} + cccccccc00000000000000000000000000000000: + balance: '0' + code: | + { + ;; Run self destruct on Account A + (CALL 150000 0xe713449c212d891357cc2966816b1d528cfb59e0 0 0 0 0 32) + } + nonce: '0' + storage: {} + dddddddd00000000000000000000000000000000: + balance: '0' + code: | + { + (SELFDESTRUCT 0xbbbbbbbb00000000000000000000000000000000) + } + nonce: '0' + storage: {} + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '' + nonce: '0' + storage: {} + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + network: + - '>=Constantinople' + result: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000001' + storage: { + 0: '0xe713449c212d891357cc2966816b1d528cfb59e0' + } + bbbbbbbb00000000000000000000000000000000: + balance: '1000000000000000000' + storage: { + 1: '0xb05d47e0911e4f67786f4cdc582608ee5f731e845a1e95ddc99759e2b3da81bf', + 2: '0x16', + 3: '0x73bbbbbbbb00000000000000000000000000000000ff00000000000000000000', + 4: '0xb05d47e0911e4f67786f4cdc582608ee5f731e845a1e95ddc99759e2b3da81bf', + 5: '0x16', + 6: '0x73bbbbbbbb00000000000000000000000000000000ff00000000000000000000' + } + e713449c212d891357cc2966816b1d528cfb59e0: + shouldnotexist: '1' + transaction: + data: + - '' + gasLimit: + - '400000' + gasPrice: '1' + nonce: '0' + secretKey: 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 + to: 095e7baea6a6c7c4c2dfeb977efac326af552d87 + value: + - '1' + diff --git a/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccountFiller.yml b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccountFiller.yml new file mode 100644 index 000000000..74e6f0f8e --- /dev/null +++ b/src/GeneralStateTestsFiller/stExtCodeHash/extCodeHashDeletedAccountFiller.yml @@ -0,0 +1,143 @@ +# EXTCODEHASH to a deleted account same transaction +--- +extCodeHashDeletedAccount: + _info: + comment: | + Get account A (aaaaaaaa00000000000000000000000000000000) code hash, code size, and code + Calls Account A's code which causes self destruction of A + Get account A codehash, code size and code + It is still getting the same values because selfdestruct is performed + at the end of transaction during state finalization stage. + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: '0x20000' + currentGasLimit: "1000000" + currentNumber: "1" + currentTimestamp: "1000" + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + pre: + # get account A codehash, destructs account A, get account A codehash + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000000' + code: | + { + ;; Gets external code hash, stores it in [[0]] + (CALL 150000 0xdeadbeef00000000000000000000000000000000 0 0 0 0 32) + (RETURNDATACOPY 0 0 32) + [[0]] (MLOAD 0) + + ;; Gets external code size, stores it in [[1]] + (CALL 150000 0xdeadbeef00000000000000000000000000000001 0 0 0 0 32) + (RETURNDATACOPY 0 0 32) + [[1]] (MLOAD 0) + + ;; Gets external code, stores it in [[2]] + (CALL 150000 0xdeadbeef00000000000000000000000000000002 0 0 0 0 32) + (RETURNDATACOPY 0 0 32) + [[2]] (MLOAD 0) + + + ;; Call Account A (self destructs) + (CALL 150000 0xaaaaaaaa00000000000000000000000000000000 0 0 0 0 32) + + + ;; Gets external code hash, stores it in [[3]] + (CALL 150000 0xdeadbeef00000000000000000000000000000000 0 0 0 0 32) + (RETURNDATACOPY 0 0 32) + [[3]] (MLOAD 0) + + ;; Gets external code size, stores it in [[4]] + (CALL 150000 0xdeadbeef00000000000000000000000000000001 0 0 0 0 32) + (RETURNDATACOPY 0 0 32) + [[4]] (MLOAD 0) + + ;; Gets external code, stores it in [[5]] + (CALL 150000 0xdeadbeef00000000000000000000000000000002 0 0 0 0 32) + (RETURNDATACOPY 0 0 32) + [[5]] (MLOAD 0) + + } + nonce: '0' + storage: {} + aaaaaaaa00000000000000000000000000000000: + balance: '1000000000000000000' + code: | + { + (SELFDESTRUCT 0xdeadbeef00000000000000000000000000000000) + } + nonce: '0' + storage: {} + # Returns External Code Hash + deadbeef00000000000000000000000000000000: + balance: '1000000000000000000' + code: | + { + (MSTORE 0 (EXTCODEHASH 0xaaaaaaaa00000000000000000000000000000000)) + (RETURN 0 32) + } + nonce: '0' + storage: {} + # Returns External Code Size + deadbeef00000000000000000000000000000001: + balance: '1000000000000000000' + code: | + { + (MSTORE 0 (EXTCODESIZE 0xaaaaaaaa00000000000000000000000000000000)) + (RETURN 0 32) + } + nonce: '0' + storage: {} + # Returns the first 32 bytes of the External Code + deadbeef00000000000000000000000000000002: + balance: '1000000000000000000' + code: | + { + ;;(MSTORE 0 (EXTCODESIZE 0xaaaaaaaa00000000000000000000000000000000)) + ;;(EXTCODECOPY 0xaaaaaaaa00000000000000000000000000000000 + + (EXTCODECOPY 0xaaaaaaaa00000000000000000000000000000000 + 0 + 0 + (EXTCODESIZE 0xaaaaaaaa00000000000000000000000000000000)) + (RETURN 0 32) + } + nonce: '0' + storage: {} + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '0x00' + nonce: '0' + storage: {} + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + network: + - '>=Constantinople' + result: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000001' + storage: { + 0: '0x4f8f2f49aec2d92b196659c9d1dc920d271503707a57472bd99eca81b9187f0f', + 1: '0x16', + 2: '0x73deadbeef00000000000000000000000000000000ff00000000000000000000', + 3: '0x4f8f2f49aec2d92b196659c9d1dc920d271503707a57472bd99eca81b9187f0f', + 4: '0x16', + 5: '0x73deadbeef00000000000000000000000000000000ff00000000000000000000' + } + aaaaaaaa00000000000000000000000000000000: + shouldnotexist: '1' + deadbeef00000000000000000000000000000000: + balance: '2000000000000000000' + transaction: + data: + - '' + gasLimit: + - '400000' + gasPrice: '1' + nonce: '0' + secretKey: 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 + to: 095e7baea6a6c7c4c2dfeb977efac326af552d87 + value: + - '1' |