From a8264ea378efee82e0c3dd965682b9e10680920b Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Fri, 8 Apr 2022 07:41:50 +0000 Subject: [PATCH 1/2] wip: test case for SENDALL with self as beneficiary. needs pre-eip4758 expect cases --- .../stEIP4758/sendallToSelf.json | 67 ++++++++++++++++++ .../stEIP4758/sendallToSelfFiller.json | 68 +++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 GeneralStateTests/stEIP4758/sendallToSelf.json create mode 100644 src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json diff --git a/GeneralStateTests/stEIP4758/sendallToSelf.json b/GeneralStateTests/stEIP4758/sendallToSelf.json new file mode 100644 index 00000000000..53947d5ca3b --- /dev/null +++ b/GeneralStateTests/stEIP4758/sendallToSelf.json @@ -0,0 +1,67 @@ +{ + "sendallToSelf" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "evm version 1.10.16-unstable-259df372-20220408", + "filling-tool-version" : "retesteth-0.2.1-difficulty+commit.5d84e4d6.Linux.g++", + "generatedTestHash" : "eaf02901d40091289ec5a5b0f04b0633ab050bda88d3cb39867fdf334b5eebc3", + "lllcversion" : "Version: 0.5.14-develop.2022.4.7+commit.401d5358.Linux.g++", + "source" : "src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json", + "sourceHash" : "59bb68076fc79e5cc4c40d4c9b008d32c88aca71201d5cc4cf97c5954018b8c8" + }, + "env" : { + "currentBaseFee" : "0x0a", + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "EIP4758" : [ + { + "hash" : "0xaf65545b4fa89552b5b8366e16c9032493a5ef0466b5aa3e4d650ba2bd9d83c5", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "txbytes" : "0xf860800a83061a8094095e7baea6a6c7c4c2dfeb977efac326af552d8780801ba072ed817487b84ba367d15d2f039b5fc5f087d0a8882fbdf73e8cb49357e1ce30a0403d800545b8fc544f92ce8124e2255f8c3c6af93f28243a120585d4c4c6a2a3" + } + ] + }, + "pre" : { + "0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73095e7baea6a6c7c4c2dfeb977efac326af552d87ff", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x061a80" + ], + "gasPrice" : "0x0a", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json b/src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json new file mode 100644 index 00000000000..68314095329 --- /dev/null +++ b/src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json @@ -0,0 +1,68 @@ +{ + "sendallToSelf" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentBaseFee": "10" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=EIP4758"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "code" : "0x", + "nonce" : "1", + "storage" : { + } + } + } + } + ], + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "// code" : "PUSH20 095e7baea6a6c7c4c2dfeb977efac326af552d87 SELFDESTRUCT", + "code" : ":raw 0x73095e7baea6a6c7c4c2dfeb977efac326af552d87ff", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "400000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0" + ] + } + } +} From dd453ff9254559dc6debefbd3e67271f7b75d271 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Tue, 12 Apr 2022 05:50:05 +0000 Subject: [PATCH 2/2] add another test --- GeneralStateTests/stEIP4758/sendallBasic.json | 67 +++++++++++++++++ .../stEIP4758/sendallToSelf.json | 7 +- .../stEIP4758/sendallBasicFiller.json | 75 +++++++++++++++++++ .../stEIP4758/sendallToSelfFiller.json | 3 + 4 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 GeneralStateTests/stEIP4758/sendallBasic.json create mode 100644 src/GeneralStateTestsFiller/stEIP4758/sendallBasicFiller.json diff --git a/GeneralStateTests/stEIP4758/sendallBasic.json b/GeneralStateTests/stEIP4758/sendallBasic.json new file mode 100644 index 00000000000..fa382016acb --- /dev/null +++ b/GeneralStateTests/stEIP4758/sendallBasic.json @@ -0,0 +1,67 @@ +{ + "sendallBasic" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "evm version 1.10.16-unstable-259df372-20220408", + "filling-tool-version" : "retesteth-0.2.1-difficulty+commit.5d84e4d6.Linux.g++", + "generatedTestHash" : "65dc1c297e88a2434562f7fb15db3ae3433beb2f186968d289a7270a3c4e0884", + "lllcversion" : "Version: 0.5.14-develop.2022.4.7+commit.401d5358.Linux.g++", + "source" : "src/GeneralStateTestsFiller/stEIP4758/sendallBasicFiller.json", + "sourceHash" : "b76ade103b0c44a19133bbd3069e654ece6077ef5dd2e874029a935085333631" + }, + "env" : { + "currentBaseFee" : "0x0a", + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "EIP4758" : [ + { + "hash" : "0x57658f4bd729afb7ebc9c3f97c7eadd295428e32bf31b7553a05216bd25cf65b", + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "txbytes" : "0xf860800a83061a8094bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb80801ba0a7a7bdbe9a66d07ecd9439612352c4364c77acdb80a5343b7d279562c500104fa021aa2eff8617f16642b2e11264ce92f971afb78fc1bbfdd20922fbea7a943c1b" + } + ] + }, + "pre" : { + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + }, + "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x73aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaff", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x061a80" + ], + "gasPrice" : "0x0a", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/GeneralStateTests/stEIP4758/sendallToSelf.json b/GeneralStateTests/stEIP4758/sendallToSelf.json index 53947d5ca3b..8ec3c92a6ed 100644 --- a/GeneralStateTests/stEIP4758/sendallToSelf.json +++ b/GeneralStateTests/stEIP4758/sendallToSelf.json @@ -4,10 +4,10 @@ "comment" : "", "filling-rpc-server" : "evm version 1.10.16-unstable-259df372-20220408", "filling-tool-version" : "retesteth-0.2.1-difficulty+commit.5d84e4d6.Linux.g++", - "generatedTestHash" : "eaf02901d40091289ec5a5b0f04b0633ab050bda88d3cb39867fdf334b5eebc3", + "generatedTestHash" : "93a734ae0cfc093f441b54d63ea8c9aeaec81e98cac6f2ffc30baf4b0784a43e", "lllcversion" : "Version: 0.5.14-develop.2022.4.7+commit.401d5358.Linux.g++", "source" : "src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json", - "sourceHash" : "59bb68076fc79e5cc4c40d4c9b008d32c88aca71201d5cc4cf97c5954018b8c8" + "sourceHash" : "c40e58dbf7b9f7574622425e1ebb909e7560d12eb62353d8699358eb34731d3e" }, "env" : { "currentBaseFee" : "0x0a", @@ -21,7 +21,7 @@ "post" : { "EIP4758" : [ { - "hash" : "0xaf65545b4fa89552b5b8366e16c9032493a5ef0466b5aa3e4d650ba2bd9d83c5", + "hash" : "0xae6526981d45303633e7d335e8a6f2c7d8aa53b2958ad32acbb2f22c27bd530d", "indexes" : { "data" : 0, "gas" : 0, @@ -38,6 +38,7 @@ "code" : "0x73095e7baea6a6c7c4c2dfeb977efac326af552d87ff", "nonce" : "0x00", "storage" : { + "0x00" : "0x01" } }, "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { diff --git a/src/GeneralStateTestsFiller/stEIP4758/sendallBasicFiller.json b/src/GeneralStateTestsFiller/stEIP4758/sendallBasicFiller.json new file mode 100644 index 00000000000..0c4189c742f --- /dev/null +++ b/src/GeneralStateTestsFiller/stEIP4758/sendallBasicFiller.json @@ -0,0 +1,75 @@ +{ + "sendallBasic" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentBaseFee": "10" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=EIP4758"], + "result" : { + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" : { + "balance" : "0", + "code" : "0x73aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaff", + "nonce" : "0", + "storage" : { + } + }, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" : { + "balance" : "1000000000000000000", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "code" : "0x", + "nonce" : "1", + "storage" : { + } + } + } + } + ], + "pre" : { + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" : { + "balance" : "1000000000000000000", + "// code" : "PUSH20 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa SELFDESTRUCT", + "code" : ":raw 0x73aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaff", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "400000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "value" : [ + "0" + ] + } + } +} diff --git a/src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json b/src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json index 68314095329..d61d8989098 100644 --- a/src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json +++ b/src/GeneralStateTestsFiller/stEIP4758/sendallToSelfFiller.json @@ -20,7 +20,9 @@ "result" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "1000000000000000000", + "code" : "0x73095e7baea6a6c7c4c2dfeb977efac326af552d87ff", "storage" : { + "0x00": "0x01" } }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { @@ -39,6 +41,7 @@ "code" : ":raw 0x73095e7baea6a6c7c4c2dfeb977efac326af552d87ff", "nonce" : "0", "storage" : { + "0x00": "0x01" } }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {