From 805f4f7f67ed009dfb418a49511b1b453f9e89c8 Mon Sep 17 00:00:00 2001 From: shemnon Date: Wed, 21 Aug 2019 08:14:54 -0600 Subject: [PATCH 1/9] Chain ID tests --- GeneralStateTests/stChainId/chainId.json | 64 +++++++++++++++++++ .../stChainId/chainIdGasCost.json | 64 +++++++++++++++++++ .../stChainId/chainIdFiller.json | 56 ++++++++++++++++ .../stChainId/chainIdGasCostFiller.json | 55 ++++++++++++++++ 4 files changed, 239 insertions(+) create mode 100644 GeneralStateTests/stChainId/chainId.json create mode 100644 GeneralStateTests/stChainId/chainIdGasCost.json create mode 100644 src/GeneralStateTestsFiller/stChainId/chainIdFiller.json create mode 100644 src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json diff --git a/GeneralStateTests/stChainId/chainId.json b/GeneralStateTests/stChainId/chainId.json new file mode 100644 index 00000000000..83b8cb9019a --- /dev/null +++ b/GeneralStateTests/stChainId/chainId.json @@ -0,0 +1,64 @@ +{ + "chainId" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", + "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "source" : "src/GeneralStateTestsFiller/stChainId/chainIdFiller.json", + "sourceHash" : "a86b41e90bb76ae6e7c7496a31884835aef3221ab67260feb3d7cac0fa0bdd28" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x02540be400", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Istanbul" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x4e879c4816591f5f99f99b72b3223d32dd5f0a485bcefda54b0cadc92c40145a", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x1000000000000000000000000000000000000000" : { + "balance" : "0x00", + "code" : "0x46600155", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x3635c9adc5dea00000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x05f5e100" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x1000000000000000000000000000000000000000", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/GeneralStateTests/stChainId/chainIdGasCost.json b/GeneralStateTests/stChainId/chainIdGasCost.json new file mode 100644 index 00000000000..a8fcfdd4c28 --- /dev/null +++ b/GeneralStateTests/stChainId/chainIdGasCost.json @@ -0,0 +1,64 @@ +{ + "chainIdGasCost" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", + "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "source" : "src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json", + "sourceHash" : "ec03e6b1c3f55409ccc9d8af7307dc82bc00001eb13f97f6abf00cdbd7c7f8de" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x02540be400", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Istanbul" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x19fa317b2b62438ec519f62b4c192bbd3ee940f6abbdd77dae92778acc66cff3", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x1000000000000000000000000000000000000000" : { + "balance" : "0x00", + "code" : "0x5a465a9050900360019003600155", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x3635c9adc5dea00000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x05f5e100" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x1000000000000000000000000000000000000000", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stChainId/chainIdFiller.json b/src/GeneralStateTestsFiller/stChainId/chainIdFiller.json new file mode 100644 index 00000000000..cb68ca494cf --- /dev/null +++ b/src/GeneralStateTestsFiller/stChainId/chainIdFiller.json @@ -0,0 +1,56 @@ +{ + "chainId": { + "env": { + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty": "0x20000", + "currentGasLimit": "10000000000", + "currentNumber": "1", + "currentTimestamp": "1000", + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [">=Istanbul"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "999999999999999958995" + } + } + } + ], + "pre": { + "1000000000000000000000000000000000000000": { + "balance": "", + "//code": "{ [[ 1 ]] (CHAINID) }", + "code": "0x46600155", + "nonce": "0", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000000", + "code": "", + "nonce": "0", + "storage": {} + } + }, + "transaction": { + "data": ["0x"], + "gasLimit": ["100000000"], + "gasPrice": "1", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "1000000000000000000000000000000000000000", + "value": ["0"] + } + } +} diff --git a/src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json b/src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json new file mode 100644 index 00000000000..bd60e64fe6d --- /dev/null +++ b/src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json @@ -0,0 +1,55 @@ +{ + "chainIdGasCost": { + "env": { + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty": "0x20000", + "currentGasLimit": "10000000000", + "currentNumber": "1", + "currentTimestamp": "1000", + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [">=Istanbul"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "3" + } + } + } + } + ], + "pre": { + "1000000000000000000000000000000000000000": { + "balance": "", + "//code": "record the gas, run the operation, then record the gas again. Drop output, subtract 2 for GAS, what is left is the cost of the operation, store in storage 0x01.", + "//codeLLL": "(asm GAS CHAINID GAS SWAP1 POP SWAP1 SUB 5 SWAP1 SUB 0x01 SSTORE)", + "code": "0x5a465a9050900360019003600155", + "nonce": "0", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000000", + "code": "", + "nonce": "0", + "storage": {} + } + }, + "transaction": { + "data": ["0x"], + "gasLimit": ["100000000"], + "gasPrice": "1", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "1000000000000000000000000000000000000000", + "value": ["0"] + } + } + } + \ No newline at end of file From 88a84c2fbece8b7ac86b81099e1acde38d61318c Mon Sep 17 00:00:00 2001 From: shemnon Date: Wed, 21 Aug 2019 08:15:16 -0600 Subject: [PATCH 2/9] selfbalance tests --- .../stSelfBalance/selfBalance.json | 64 +++++++++++++++++++ .../selfBalanceEqualsBalance.json | 64 +++++++++++++++++++ .../stSelfBalance/selfBalanceGasCost.json | 64 +++++++++++++++++++ .../selfBalanceEqualsBalanceFiller.json | 54 ++++++++++++++++ .../stSelfBalance/selfBalanceFiller.json | 54 ++++++++++++++++ .../selfBalanceGasCostFiller.json | 55 ++++++++++++++++ 6 files changed, 355 insertions(+) create mode 100644 GeneralStateTests/stSelfBalance/selfBalance.json create mode 100644 GeneralStateTests/stSelfBalance/selfBalanceEqualsBalance.json create mode 100644 GeneralStateTests/stSelfBalance/selfBalanceGasCost.json create mode 100644 src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json create mode 100644 src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json create mode 100644 src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json diff --git a/GeneralStateTests/stSelfBalance/selfBalance.json b/GeneralStateTests/stSelfBalance/selfBalance.json new file mode 100644 index 00000000000..99711d06b6f --- /dev/null +++ b/GeneralStateTests/stSelfBalance/selfBalance.json @@ -0,0 +1,64 @@ +{ + "selfBalance" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", + "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "source" : "src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json", + "sourceHash" : "0ed649d9a7b4b467602b43947450b40c6c1394a062e4f424b0e254d12131c172" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x02540be400", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Istanbul" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0xf74d44138839ddca5189feb9cc924207992f8d780f1cde9ef7e6d3143e3a6866", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x1000000000000000000000000000000000000000" : { + "balance" : "0x01f4", + "code" : "0x47600155", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x3635c9adc5dea00000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x05f5e100" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x1000000000000000000000000000000000000000", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/GeneralStateTests/stSelfBalance/selfBalanceEqualsBalance.json b/GeneralStateTests/stSelfBalance/selfBalanceEqualsBalance.json new file mode 100644 index 00000000000..0c47831bd71 --- /dev/null +++ b/GeneralStateTests/stSelfBalance/selfBalanceEqualsBalance.json @@ -0,0 +1,64 @@ +{ + "selfBalanceEqualsBalance" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", + "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "source" : "src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json", + "sourceHash" : "3179ebbfcfdc8e055ae408e92f34eedc560471f34e5a82a56d6dcd8398cfdc0d" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x02540be400", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Istanbul" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x6a9a77dbc62e9ea857a74a4bc4f40c319068055aab5fa4be894f04e0348b49b2", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x1000000000000000000000000000000000000000" : { + "balance" : "0x01f4", + "code" : "0x30314714600155", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x3635c9adc5dea00000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x05f5e100" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x1000000000000000000000000000000000000000", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/GeneralStateTests/stSelfBalance/selfBalanceGasCost.json b/GeneralStateTests/stSelfBalance/selfBalanceGasCost.json new file mode 100644 index 00000000000..25e2fa39972 --- /dev/null +++ b/GeneralStateTests/stSelfBalance/selfBalanceGasCost.json @@ -0,0 +1,64 @@ +{ + "selfBalanceGasCost" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", + "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "source" : "src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json", + "sourceHash" : "2a27c2b5304c1201b4d231671cdbfb3299abefcb36c5e8373e74a1842165cdb0" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x02540be400", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Istanbul" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x4fac02aa9131dc096a61aadd8bf41e135cac0c5c0646ca5c44e16aad97c5ab42", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x1000000000000000000000000000000000000000" : { + "balance" : "0x00", + "code" : "0x5a475a9050900360019003600155", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x3635c9adc5dea00000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x05f5e100" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x1000000000000000000000000000000000000000", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json new file mode 100644 index 00000000000..81aab64a284 --- /dev/null +++ b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json @@ -0,0 +1,54 @@ +{ + "selfBalanceEqualsBalance": { + "env": { + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty": "0x20000", + "currentGasLimit": "10000000000", + "currentNumber": "1", + "currentTimestamp": "1000", + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [">=Istanbul"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "0x01" + } + } + } + } + ], + "pre": { + "1000000000000000000000000000000000000000": { + "balance": "0x01f4", + "//code": "{ [[ 1 ]] (EQ (BALANCE (ADDRESS)) (SELFBALANCE)) }", + "code": "0x30314714600155", + "nonce": "0", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000000", + "code": "", + "nonce": "0", + "storage": {} + } + }, + "transaction": { + "data": ["0x"], + "gasLimit": ["100000000"], + "gasPrice": "1", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "1000000000000000000000000000000000000000", + "value": ["0"] + } + } + } + \ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json new file mode 100644 index 00000000000..4c97f4111aa --- /dev/null +++ b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json @@ -0,0 +1,54 @@ +{ + "selfBalance": { + "env": { + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty": "0x20000", + "currentGasLimit": "10000000000", + "currentNumber": "1", + "currentTimestamp": "1000", + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [">=Istanbul"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "0x01f4" + } + } + } + } + ], + "pre": { + "1000000000000000000000000000000000000000": { + "balance": "0x01f4", + "//code": "{ [[ 1 ]] (SELFBALANCE) }", + "code": "0x47600155", + "nonce": "0", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000000", + "code": "", + "nonce": "0", + "storage": {} + } + }, + "transaction": { + "data": ["0x"], + "gasLimit": ["100000000"], + "gasPrice": "1", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "1000000000000000000000000000000000000000", + "value": ["0"] + } + } + } + \ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json new file mode 100644 index 00000000000..0445aa2bbb1 --- /dev/null +++ b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json @@ -0,0 +1,55 @@ +{ + "selfBalanceGasCost": { + "env": { + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty": "0x20000", + "currentGasLimit": "10000000000", + "currentNumber": "1", + "currentTimestamp": "1000", + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [">=Istanbul"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "6" + } + } + } + } + ], + "pre": { + "1000000000000000000000000000000000000000": { + "balance": "", + "//code": "record the gas, run the operation, then record the gas again. Drop output, subtract 2 for GAS, what is left is the cost of the operation, store in storage 0x01.", + "//codeLLL": "(asm GAS SELFBALANCE GAS SWAP1 POP SWAP1 SUB 5 SWAP1 SUB 0x01 SSTORE)", + "code": "0x5a475a9050900360019003600155", + "nonce": "0", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000000", + "code": "", + "nonce": "0", + "storage": {} + } + }, + "transaction": { + "data": ["0x"], + "gasLimit": ["100000000"], + "gasPrice": "1", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "1000000000000000000000000000000000000000", + "value": ["0"] + } + } + } + \ No newline at end of file From fd5b414d45974fb587fe57df03872c5c54cc1856 Mon Sep 17 00:00:00 2001 From: shemnon Date: Wed, 21 Aug 2019 08:15:37 -0600 Subject: [PATCH 3/9] sload tests --- .../stSLoadTest/sloadGasCost.json | 141 ++++++++++++++++++ .../stSLoadTest/sloadGasCostFiller.json | 84 +++++++++++ 2 files changed, 225 insertions(+) create mode 100644 GeneralStateTests/stSLoadTest/sloadGasCost.json create mode 100644 src/GeneralStateTestsFiller/stSLoadTest/sloadGasCostFiller.json diff --git a/GeneralStateTests/stSLoadTest/sloadGasCost.json b/GeneralStateTests/stSLoadTest/sloadGasCost.json new file mode 100644 index 00000000000..f38eaa310fe --- /dev/null +++ b/GeneralStateTests/stSLoadTest/sloadGasCost.json @@ -0,0 +1,141 @@ +{ + "sloadGasCost" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", + "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "source" : "src/GeneralStateTestsFiller/stSLoadTest/sloadGasCostFiller.json", + "sourceHash" : "478582c0b2c5977ffa9a57c3ba417179cb42f2e67404d1ecc60346edaac6110f" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x02540be400", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Byzantium" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "Constantinople" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "ConstantinopleFix" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "EIP150" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "EIP158" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "Frontier" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0xacb5afa0f59bad014ad16046c097ba1c6c3098e8c453e67c0933fc78bae62532", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "Homestead" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0xacb5afa0f59bad014ad16046c097ba1c6c3098e8c453e67c0933fc78bae62532", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ], + "Istanbul" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x8e9f589e1399931416595f7798870a0e2a279fe3dfeb37c64a797376c552ccb8", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x1000000000000000000000000000000000000000" : { + "balance" : "0x00", + "code" : "0x5a80545a9050900360059003600155", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x3635c9adc5dea00000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x05f5e100" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x1000000000000000000000000000000000000000", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stSLoadTest/sloadGasCostFiller.json b/src/GeneralStateTestsFiller/stSLoadTest/sloadGasCostFiller.json new file mode 100644 index 00000000000..f94d618d43a --- /dev/null +++ b/src/GeneralStateTestsFiller/stSLoadTest/sloadGasCostFiller.json @@ -0,0 +1,84 @@ +{ + "sloadGasCost": { + "env": { + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty": "0x20000", + "currentGasLimit": "10000000000", + "currentNumber": "1", + "currentTimestamp": "1000", + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": ["Frontier", "Homestead"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "50" + } + } + } + }, + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": ["EIP150", "EIP158", "Byzantium", "Constantinople", "ConstantinopleFix"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "200" + } + } + } + }, + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [">=Istanbul"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "800" + } + } + } + } + ], + "pre": { + "1000000000000000000000000000000000000000": { + "balance": "", + "//code": "record the gas, prep and run the operation, then record the gas again. Drop output, subtract 5 for GAS and DUP1, what is left is the cost of the operation, store in storage 0x01.", + "code": "(asm GAS DUP1 SLOAD GAS SWAP1 POP SWAP1 SUB 5 SWAP1 SUB 0x01 SSTORE)", + "nonce": "0", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000000", + "code": "", + "nonce": "0", + "storage": {} + } + }, + "transaction": { + "data": ["0x"], + "gasLimit": ["100000000"], + "gasPrice": "1", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "1000000000000000000000000000000000000000", + "value": ["0"] + } + } + } + \ No newline at end of file From d700880245f88e17277123e7371288bda727f7b7 Mon Sep 17 00:00:00 2001 From: shemnon Date: Wed, 21 Aug 2019 08:15:56 -0600 Subject: [PATCH 4/9] Istanbul retsteth chainparams --- Retesteth/default/genesis/Istanbul.json | 82 +++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Retesteth/default/genesis/Istanbul.json diff --git a/Retesteth/default/genesis/Istanbul.json b/Retesteth/default/genesis/Istanbul.json new file mode 100644 index 00000000000..57f8cb26102 --- /dev/null +++ b/Retesteth/default/genesis/Istanbul.json @@ -0,0 +1,82 @@ +{ + "params" : { + "homesteadForkBlock" : "0x00", + "EIP150ForkBlock" : "0x00", + "EIP158ForkBlock" : "0x00", + "byzantiumForkBlock" : "0x00", + "constantinopleForkBlock" : "0x00", + "constantinopleFixForkBlock" : "0x00", + "istanbulForkBlock" : "0x00" + }, + "accounts" : { + "0x0000000000000000000000000000000000000001" : { + "precompiled" : { + "name" : "ecrecover", + "linear" : { + "base" : 3000, + "word" : 0 + } + } + }, + "0x0000000000000000000000000000000000000002" : { + "precompiled" : { + "name" : "sha256", + "linear" : { + "base" : 60, + "word" : 12 + } + } + }, + "0x0000000000000000000000000000000000000003" : { + "precompiled" : { + "name" : "sha256", + "linear" : { + "base" : 600, + "word" : 120 + } + } + }, + "0x0000000000000000000000000000000000000004" : { + "precompiled" : { + "name" : "identity", + "linear" : { + "base" : 15, + "word" : 3 + } + } + }, + "0x0000000000000000000000000000000000000005" : { + "precompiled" : { + "name" : "modexp" + } + }, + "0x0000000000000000000000000000000000000006" : { + "precompiled" : { + "name" : "alt_bn128_G1_add", + "linear" : { + "base" : 500, + "word" : 0 + } + } + }, + "0x0000000000000000000000000000000000000007" : { + "precompiled" : { + "name" : "alt_bn128_G1_mul", + "linear" : { + "base" : 40000, + "word" : 0 + } + } + }, + "0x0000000000000000000000000000000000000008" : { + "precompiled" : { + "name" : "alt_bn128_pairing_product" + } + }, + "0x0000000000000000000000000000000000000009" : { + "precompiled" : { + "name" : "blake2f" + } + } + } +} From 413c19199859af0bb0647c7f8836df0f9b1d70e9 Mon Sep 17 00:00:00 2001 From: shemnon Date: Wed, 21 Aug 2019 08:28:57 -0600 Subject: [PATCH 5/9] add istanbul to json schema --- JSONSchema/bc-filler-schema.json | 3 +++ JSONSchema/bc-schema.json | 3 +++ JSONSchema/st-schema.json | 3 +++ 3 files changed, 9 insertions(+) diff --git a/JSONSchema/bc-filler-schema.json b/JSONSchema/bc-filler-schema.json index 1d34fee998a..3a9160046c4 100644 --- a/JSONSchema/bc-filler-schema.json +++ b/JSONSchema/bc-filler-schema.json @@ -62,6 +62,9 @@ "expectExceptionHomestead": { "type": "string" }, + "expectExceptionIstanbul": { + "type": "string" + }, "rlp": { "$ref": "#/definitions/BadHexData" }, diff --git a/JSONSchema/bc-schema.json b/JSONSchema/bc-schema.json index 5ef586791a1..a83e6be9b0e 100644 --- a/JSONSchema/bc-schema.json +++ b/JSONSchema/bc-schema.json @@ -46,6 +46,9 @@ "expectExceptionHomestead": { "type": "string" }, + "expectExceptionIstanbul": { + "type": "string" + }, "rlp": { "$ref": "#/definitions/BadHexData" }, diff --git a/JSONSchema/st-schema.json b/JSONSchema/st-schema.json index 93dc2c95252..12b80de75fc 100644 --- a/JSONSchema/st-schema.json +++ b/JSONSchema/st-schema.json @@ -232,6 +232,9 @@ }, "Homestead": { "$ref": "#/definitions/TransactionResults" + }, + "Istanbul": { + "$ref": "#/definitions/TransactionResults" } }, "type": "object" From ae4c9c49f7ffbb7e4937f99a1cec293a4d270cf2 Mon Sep 17 00:00:00 2001 From: shemnon Date: Fri, 23 Aug 2019 15:08:25 -0600 Subject: [PATCH 6/9] Mutating self balance --- .../stSelfBalance/selfBalanceUpdate.json | 64 +++++++++++++++++++ .../selfBalanceUpdateFiller.json | 56 ++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 GeneralStateTests/stSelfBalance/selfBalanceUpdate.json create mode 100644 src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json diff --git a/GeneralStateTests/stSelfBalance/selfBalanceUpdate.json b/GeneralStateTests/stSelfBalance/selfBalanceUpdate.json new file mode 100644 index 00000000000..9ce6925cd1c --- /dev/null +++ b/GeneralStateTests/stSelfBalance/selfBalanceUpdate.json @@ -0,0 +1,64 @@ +{ + "selfBalanceUpdate" : { + "_info" : { + "comment" : "", + "filling-rpc-server" : "pantheon/v1.2.2-dev-971fea4b/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.e7eb725f.Darwin.appleclang", + "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "source" : "src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json", + "sourceHash" : "97f5c0e3a48c072de32e0d408a64262c5a09064c8681313c03233b23fc1059cf" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x020000", + "currentGasLimit" : "0x02540be400", + "currentNumber" : "0x01", + "currentTimestamp" : "0x03e8", + "previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "post" : { + "Istanbul" : [ + { + "indexes" : { + "data" : 0, + "gas" : 0, + "value" : 0 + }, + "hash" : "0x31e3e6c8fa0060221ef16232aedb74890cab1e6cc385736629629d9f7e5ab121", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + "pre" : { + "0x1000000000000000000000000000000000000000" : { + "balance" : "0x01f4", + "code" : "0x47806001556000600060006000600160006000f15047806002559003600355", + "nonce" : "0x00", + "storage" : { + } + }, + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x3635c9adc5dea00000", + "code" : "0x", + "nonce" : "0x00", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "0x" + ], + "gasLimit" : [ + "0x05f5e100" + ], + "gasPrice" : "0x01", + "nonce" : "0x00", + "secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "0x1000000000000000000000000000000000000000", + "value" : [ + "0x00" + ] + } + } +} \ No newline at end of file diff --git a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json new file mode 100644 index 00000000000..beb3304f50d --- /dev/null +++ b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json @@ -0,0 +1,56 @@ +{ + "selfBalanceUpdate": { + "env": { + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty": "0x20000", + "currentGasLimit": "10000000000", + "currentNumber": "1", + "currentTimestamp": "1000", + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "indexes": { + "data": -1, + "gas": -1, + "value": -1 + }, + "network": [">=Istanbul"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "0x01f4", + "0x02": "0x01f3", + "0x03": "0x01" + } + } + } + } + ], + "pre": { + "1000000000000000000000000000000000000000": { + "balance": "0x01f4", + "//code": "(asm SELFBALANCE DUP1 1 SSTORE 0 0 0 0 1 0 0 CALL POP SELFBALANCE DUP1 2 SSTORE SWAP1 SUB 3 SSTORE)", + "code" : "0x47806001556000600060006000600160006000f15047806002559003600355", + "nonce": "0", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000000", + "code": "", + "nonce": "0", + "storage": {} + } + }, + "transaction": { + "data": ["0x"], + "gasLimit": ["100000000"], + "gasPrice": "1", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "1000000000000000000000000000000000000000", + "value": ["0"] + } + } + } + \ No newline at end of file From ffabd239ce6a024e1607a1359912bf126b950862 Mon Sep 17 00:00:00 2001 From: shemnon Date: Mon, 16 Sep 2019 14:01:10 -0600 Subject: [PATCH 7/9] Update to new LLL update to new CHAINID opcode for LLL Also, the calculation for GAS and target value of CHAINID needed an update (offsetting off by 1 errors) --- GeneralStateTests/stChainId/chainId.json | 12 ++++++------ GeneralStateTests/stChainId/chainIdGasCost.json | 12 ++++++------ .../stChainId/chainIdFiller.json | 3 +-- .../stChainId/chainIdGasCostFiller.json | 5 ++--- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/GeneralStateTests/stChainId/chainId.json b/GeneralStateTests/stChainId/chainId.json index 83b8cb9019a..7d2a737858a 100644 --- a/GeneralStateTests/stChainId/chainId.json +++ b/GeneralStateTests/stChainId/chainId.json @@ -2,11 +2,11 @@ "chainId" : { "_info" : { "comment" : "", - "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", - "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", - "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "filling-rpc-server" : "besu/v1.2.4-dev-9aadbcb9/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.4382e070.Darwin.appleclang", + "lllcversion" : "Version: 0.5.12-develop.2019.9.16+commit.2d601a4f.Darwin.appleclang", "source" : "src/GeneralStateTestsFiller/stChainId/chainIdFiller.json", - "sourceHash" : "a86b41e90bb76ae6e7c7496a31884835aef3221ab67260feb3d7cac0fa0bdd28" + "sourceHash" : "bfb9e9bcd0567eed6b0121ff03cbc724c7942751affdf0a33a677ea0b3c7b87c" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -24,7 +24,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x4e879c4816591f5f99f99b72b3223d32dd5f0a485bcefda54b0cadc92c40145a", + "hash" : "0xbf7140c2bdddefaf68a79a2516ebb350be5f6e51e2dda7c8c81eb7a94fb7bf73", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] @@ -32,7 +32,7 @@ "pre" : { "0x1000000000000000000000000000000000000000" : { "balance" : "0x00", - "code" : "0x46600155", + "code" : "0x4660015500", "nonce" : "0x00", "storage" : { } diff --git a/GeneralStateTests/stChainId/chainIdGasCost.json b/GeneralStateTests/stChainId/chainIdGasCost.json index a8fcfdd4c28..08b1eb5f55a 100644 --- a/GeneralStateTests/stChainId/chainIdGasCost.json +++ b/GeneralStateTests/stChainId/chainIdGasCost.json @@ -2,11 +2,11 @@ "chainIdGasCost" : { "_info" : { "comment" : "", - "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", - "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", - "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "filling-rpc-server" : "besu/v1.2.4-dev-9aadbcb9/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.4382e070.Darwin.appleclang", + "lllcversion" : "Version: 0.5.12-develop.2019.9.16+commit.2d601a4f.Darwin.appleclang", "source" : "src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json", - "sourceHash" : "ec03e6b1c3f55409ccc9d8af7307dc82bc00001eb13f97f6abf00cdbd7c7f8de" + "sourceHash" : "505de18505329314140591e82531ad9ac2b4d2ff85618170a0d8910a22a1b477" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -24,7 +24,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x19fa317b2b62438ec519f62b4c192bbd3ee940f6abbdd77dae92778acc66cff3", + "hash" : "0x5a2faa4d31826fed9b9524014a42a56d19e9b39f4ce887e6e02941278a1df902", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] @@ -32,7 +32,7 @@ "pre" : { "0x1000000000000000000000000000000000000000" : { "balance" : "0x00", - "code" : "0x5a465a9050900360019003600155", + "code" : "0x5a465a905090036002900360015500", "nonce" : "0x00", "storage" : { } diff --git a/src/GeneralStateTestsFiller/stChainId/chainIdFiller.json b/src/GeneralStateTestsFiller/stChainId/chainIdFiller.json index cb68ca494cf..19259b69f5f 100644 --- a/src/GeneralStateTestsFiller/stChainId/chainIdFiller.json +++ b/src/GeneralStateTestsFiller/stChainId/chainIdFiller.json @@ -31,8 +31,7 @@ "pre": { "1000000000000000000000000000000000000000": { "balance": "", - "//code": "{ [[ 1 ]] (CHAINID) }", - "code": "0x46600155", + "code": "{ [[ 1 ]] (CHAINID) }", "nonce": "0", "storage": {} }, diff --git a/src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json b/src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json index bd60e64fe6d..09f4d407fc1 100644 --- a/src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json +++ b/src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json @@ -19,7 +19,7 @@ "result": { "1000000000000000000000000000000000000000": { "storage": { - "0x01": "3" + "0x01": "2" } } } @@ -29,8 +29,7 @@ "1000000000000000000000000000000000000000": { "balance": "", "//code": "record the gas, run the operation, then record the gas again. Drop output, subtract 2 for GAS, what is left is the cost of the operation, store in storage 0x01.", - "//codeLLL": "(asm GAS CHAINID GAS SWAP1 POP SWAP1 SUB 5 SWAP1 SUB 0x01 SSTORE)", - "code": "0x5a465a9050900360019003600155", + "code": "(asm GAS CHAINID GAS SWAP1 POP SWAP1 SUB 2 SWAP1 SUB 0x01 SSTORE)", "nonce": "0", "storage": {} }, From 0977187dd758272d7a37421bb93428af25515f59 Mon Sep 17 00:00:00 2001 From: shemnon Date: Mon, 16 Sep 2019 14:10:13 -0600 Subject: [PATCH 8/9] update sload test --- .../stSLoadTest/sloadGasCost.json | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/GeneralStateTests/stSLoadTest/sloadGasCost.json b/GeneralStateTests/stSLoadTest/sloadGasCost.json index f38eaa310fe..f8a3d3e3a39 100644 --- a/GeneralStateTests/stSLoadTest/sloadGasCost.json +++ b/GeneralStateTests/stSLoadTest/sloadGasCost.json @@ -2,9 +2,9 @@ "sloadGasCost" : { "_info" : { "comment" : "", - "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", - "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", - "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "filling-rpc-server" : "besu/v1.2.4-dev-9aadbcb9/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.4382e070.Darwin.appleclang", + "lllcversion" : "Version: 0.5.12-develop.2019.9.16+commit.2d601a4f.Darwin.appleclang", "source" : "src/GeneralStateTestsFiller/stSLoadTest/sloadGasCostFiller.json", "sourceHash" : "478582c0b2c5977ffa9a57c3ba417179cb42f2e67404d1ecc60346edaac6110f" }, @@ -24,7 +24,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "hash" : "0xc85ad1bf7eb936b237602f5f64995dd499e99ecbdf619ff238602357f2ca6f8d", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], @@ -35,7 +35,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "hash" : "0xc85ad1bf7eb936b237602f5f64995dd499e99ecbdf619ff238602357f2ca6f8d", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], @@ -46,7 +46,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "hash" : "0xc85ad1bf7eb936b237602f5f64995dd499e99ecbdf619ff238602357f2ca6f8d", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], @@ -57,7 +57,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "hash" : "0xc85ad1bf7eb936b237602f5f64995dd499e99ecbdf619ff238602357f2ca6f8d", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], @@ -68,7 +68,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x23d9c7db97dfff3eb4b1a69cb03158ba4511a5f7714e689884f9b4ff9f195469", + "hash" : "0xc85ad1bf7eb936b237602f5f64995dd499e99ecbdf619ff238602357f2ca6f8d", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], @@ -79,7 +79,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0xacb5afa0f59bad014ad16046c097ba1c6c3098e8c453e67c0933fc78bae62532", + "hash" : "0x118b5fad5ddd51823bca3079d1e7351dfe1ed0a01c30c5c7e4a49c499389e716", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], @@ -90,7 +90,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0xacb5afa0f59bad014ad16046c097ba1c6c3098e8c453e67c0933fc78bae62532", + "hash" : "0x118b5fad5ddd51823bca3079d1e7351dfe1ed0a01c30c5c7e4a49c499389e716", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ], @@ -101,7 +101,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x8e9f589e1399931416595f7798870a0e2a279fe3dfeb37c64a797376c552ccb8", + "hash" : "0xe9e3795e916b9ee682f9b05bcd0e6857a76b6835a4061229c3a38e936537f313", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] @@ -109,7 +109,7 @@ "pre" : { "0x1000000000000000000000000000000000000000" : { "balance" : "0x00", - "code" : "0x5a80545a9050900360059003600155", + "code" : "0x5a80545a905090036005900360015500", "nonce" : "0x00", "storage" : { } From 1097b04198ff4171baa48a0eb15d05fdd4ccd930 Mon Sep 17 00:00:00 2001 From: shemnon Date: Mon, 16 Sep 2019 14:17:57 -0600 Subject: [PATCH 9/9] Update SelfBalance for LLLC Update to use SELFBALANCE ASM from new LLLC Also, there was another offsetting off by 1 error pair in the data and the raw bytecode --- GeneralStateTests/stChainId/chainIdGasCost.json | 2 +- GeneralStateTests/stSelfBalance/selfBalance.json | 12 ++++++------ .../stSelfBalance/selfBalanceEqualsBalance.json | 12 ++++++------ .../stSelfBalance/selfBalanceGasCost.json | 12 ++++++------ .../stSelfBalance/selfBalanceUpdate.json | 12 ++++++------ .../selfBalanceEqualsBalanceFiller.json | 3 +-- .../stSelfBalance/selfBalanceFiller.json | 4 ++-- .../stSelfBalance/selfBalanceGasCostFiller.json | 5 ++--- .../stSelfBalance/selfBalanceUpdateFiller.json | 3 +-- 9 files changed, 31 insertions(+), 34 deletions(-) diff --git a/GeneralStateTests/stChainId/chainIdGasCost.json b/GeneralStateTests/stChainId/chainIdGasCost.json index 08b1eb5f55a..fc548b58311 100644 --- a/GeneralStateTests/stChainId/chainIdGasCost.json +++ b/GeneralStateTests/stChainId/chainIdGasCost.json @@ -6,7 +6,7 @@ "filling-tool-version" : "retesteth-0.0.1+commit.4382e070.Darwin.appleclang", "lllcversion" : "Version: 0.5.12-develop.2019.9.16+commit.2d601a4f.Darwin.appleclang", "source" : "src/GeneralStateTestsFiller/stChainId/chainIdGasCostFiller.json", - "sourceHash" : "505de18505329314140591e82531ad9ac2b4d2ff85618170a0d8910a22a1b477" + "sourceHash" : "240e12afa293934d07aa02609b0e40bc3ea843970525545f05fc33ae8a40a1c1" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", diff --git a/GeneralStateTests/stSelfBalance/selfBalance.json b/GeneralStateTests/stSelfBalance/selfBalance.json index 99711d06b6f..25bbb94d2f9 100644 --- a/GeneralStateTests/stSelfBalance/selfBalance.json +++ b/GeneralStateTests/stSelfBalance/selfBalance.json @@ -2,11 +2,11 @@ "selfBalance" : { "_info" : { "comment" : "", - "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", - "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", - "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "filling-rpc-server" : "besu/v1.2.4-dev-9aadbcb9/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.4382e070.Darwin.appleclang", + "lllcversion" : "Version: 0.5.12-develop.2019.9.16+commit.2d601a4f.Darwin.appleclang", "source" : "src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json", - "sourceHash" : "0ed649d9a7b4b467602b43947450b40c6c1394a062e4f424b0e254d12131c172" + "sourceHash" : "5c0e27200184ae2b4b3bdd7e41d07f8fea4f339bca87644310d955549b331fcc" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -24,7 +24,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0xf74d44138839ddca5189feb9cc924207992f8d780f1cde9ef7e6d3143e3a6866", + "hash" : "0x9643f658f61955b82d5ef1bd8a3e0100ea566d186dde9b2888b5e975a8f82aee", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] @@ -32,7 +32,7 @@ "pre" : { "0x1000000000000000000000000000000000000000" : { "balance" : "0x01f4", - "code" : "0x47600155", + "code" : "0x4760015500", "nonce" : "0x00", "storage" : { } diff --git a/GeneralStateTests/stSelfBalance/selfBalanceEqualsBalance.json b/GeneralStateTests/stSelfBalance/selfBalanceEqualsBalance.json index 0c47831bd71..61790bb3bb6 100644 --- a/GeneralStateTests/stSelfBalance/selfBalanceEqualsBalance.json +++ b/GeneralStateTests/stSelfBalance/selfBalanceEqualsBalance.json @@ -2,11 +2,11 @@ "selfBalanceEqualsBalance" : { "_info" : { "comment" : "", - "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", - "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", - "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "filling-rpc-server" : "besu/v1.2.4-dev-9aadbcb9/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.4382e070.Darwin.appleclang", + "lllcversion" : "Version: 0.5.12-develop.2019.9.16+commit.2d601a4f.Darwin.appleclang", "source" : "src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json", - "sourceHash" : "3179ebbfcfdc8e055ae408e92f34eedc560471f34e5a82a56d6dcd8398cfdc0d" + "sourceHash" : "25d5ef29eeff750567c6438d8a02271078f64f4e07215fc232f0a3a486910ef3" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -24,7 +24,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x6a9a77dbc62e9ea857a74a4bc4f40c319068055aab5fa4be894f04e0348b49b2", + "hash" : "0x76e8d4a35a49bf037aa18854446f92d5b78c1bc06bf154c0a324e9fcf219ea98", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] @@ -32,7 +32,7 @@ "pre" : { "0x1000000000000000000000000000000000000000" : { "balance" : "0x01f4", - "code" : "0x30314714600155", + "code" : "0x3031471460015500", "nonce" : "0x00", "storage" : { } diff --git a/GeneralStateTests/stSelfBalance/selfBalanceGasCost.json b/GeneralStateTests/stSelfBalance/selfBalanceGasCost.json index 25e2fa39972..9932a712525 100644 --- a/GeneralStateTests/stSelfBalance/selfBalanceGasCost.json +++ b/GeneralStateTests/stSelfBalance/selfBalanceGasCost.json @@ -2,11 +2,11 @@ "selfBalanceGasCost" : { "_info" : { "comment" : "", - "filling-rpc-server" : "pantheon/v1.2.2-dev-bafed7fc/osx-x86_64/corretto-java-11", - "filling-tool-version" : "retesteth-0.0.1+commit.9c33be89.Darwin.appleclang", - "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "filling-rpc-server" : "besu/v1.2.4-dev-9aadbcb9/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.4382e070.Darwin.appleclang", + "lllcversion" : "Version: 0.5.12-develop.2019.9.16+commit.2d601a4f.Darwin.appleclang", "source" : "src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json", - "sourceHash" : "2a27c2b5304c1201b4d231671cdbfb3299abefcb36c5e8373e74a1842165cdb0" + "sourceHash" : "72fbb11ecf74d7b483a3070727e34f9a327e7097f841a0a137ad210dccb4dab5" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -24,7 +24,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x4fac02aa9131dc096a61aadd8bf41e135cac0c5c0646ca5c44e16aad97c5ab42", + "hash" : "0x734634c3ab7385473db79fddef4533643bd3743e07c51849439e7de83efeefcf", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] @@ -32,7 +32,7 @@ "pre" : { "0x1000000000000000000000000000000000000000" : { "balance" : "0x00", - "code" : "0x5a475a9050900360019003600155", + "code" : "0x5a475a905090036002900360015500", "nonce" : "0x00", "storage" : { } diff --git a/GeneralStateTests/stSelfBalance/selfBalanceUpdate.json b/GeneralStateTests/stSelfBalance/selfBalanceUpdate.json index 9ce6925cd1c..ddae8989451 100644 --- a/GeneralStateTests/stSelfBalance/selfBalanceUpdate.json +++ b/GeneralStateTests/stSelfBalance/selfBalanceUpdate.json @@ -2,11 +2,11 @@ "selfBalanceUpdate" : { "_info" : { "comment" : "", - "filling-rpc-server" : "pantheon/v1.2.2-dev-971fea4b/osx-x86_64/corretto-java-11", - "filling-tool-version" : "retesteth-0.0.1+commit.e7eb725f.Darwin.appleclang", - "lllcversion" : "Version: 0.5.0-develop.2019.8.6+commit.9709dfe0.Darwin.appleclang", + "filling-rpc-server" : "besu/v1.2.4-dev-9aadbcb9/osx-x86_64/corretto-java-11", + "filling-tool-version" : "retesteth-0.0.1+commit.4382e070.Darwin.appleclang", + "lllcversion" : "Version: 0.5.12-develop.2019.9.16+commit.2d601a4f.Darwin.appleclang", "source" : "src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json", - "sourceHash" : "97f5c0e3a48c072de32e0d408a64262c5a09064c8681313c03233b23fc1059cf" + "sourceHash" : "928dc9207aa93670f7bb0a06c73b3ea2960ec433bdfa994e69dcf17bbe8b1230" }, "env" : { "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -24,7 +24,7 @@ "gas" : 0, "value" : 0 }, - "hash" : "0x31e3e6c8fa0060221ef16232aedb74890cab1e6cc385736629629d9f7e5ab121", + "hash" : "0x0ecc7a0a1b83b10575f78f92d8150f7479d5b02ed523fc5ff9ff8e140361c416", "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" } ] @@ -32,7 +32,7 @@ "pre" : { "0x1000000000000000000000000000000000000000" : { "balance" : "0x01f4", - "code" : "0x47806001556000600060006000600160006000f15047806002559003600355", + "code" : "0x47806001556000600060006000600160006000f1504780600255900360035500", "nonce" : "0x00", "storage" : { } diff --git a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json index 81aab64a284..e14dea7f155 100644 --- a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json +++ b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceEqualsBalanceFiller.json @@ -28,8 +28,7 @@ "pre": { "1000000000000000000000000000000000000000": { "balance": "0x01f4", - "//code": "{ [[ 1 ]] (EQ (BALANCE (ADDRESS)) (SELFBALANCE)) }", - "code": "0x30314714600155", + "code": "{ [[ 1 ]] (EQ (SELFBALANCE) (BALANCE (ADDRESS))) }", "nonce": "0", "storage": {} }, diff --git a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json index 4c97f4111aa..e5cdfcbce82 100644 --- a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json +++ b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceFiller.json @@ -28,8 +28,8 @@ "pre": { "1000000000000000000000000000000000000000": { "balance": "0x01f4", - "//code": "{ [[ 1 ]] (SELFBALANCE) }", - "code": "0x47600155", + "code": "{ [[ 1 ]] (SELFBALANCE) }", + "//code": "0x47600155", "nonce": "0", "storage": {} }, diff --git a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json index 0445aa2bbb1..2ac871f356b 100644 --- a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json +++ b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceGasCostFiller.json @@ -19,7 +19,7 @@ "result": { "1000000000000000000000000000000000000000": { "storage": { - "0x01": "6" + "0x01": "5" } } } @@ -29,8 +29,7 @@ "1000000000000000000000000000000000000000": { "balance": "", "//code": "record the gas, run the operation, then record the gas again. Drop output, subtract 2 for GAS, what is left is the cost of the operation, store in storage 0x01.", - "//codeLLL": "(asm GAS SELFBALANCE GAS SWAP1 POP SWAP1 SUB 5 SWAP1 SUB 0x01 SSTORE)", - "code": "0x5a475a9050900360019003600155", + "code": "(asm GAS SELFBALANCE GAS SWAP1 POP SWAP1 SUB 2 SWAP1 SUB 0x01 SSTORE)", "nonce": "0", "storage": {} }, diff --git a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json index beb3304f50d..f12eb06e6da 100644 --- a/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json +++ b/src/GeneralStateTestsFiller/stSelfBalance/selfBalanceUpdateFiller.json @@ -30,8 +30,7 @@ "pre": { "1000000000000000000000000000000000000000": { "balance": "0x01f4", - "//code": "(asm SELFBALANCE DUP1 1 SSTORE 0 0 0 0 1 0 0 CALL POP SELFBALANCE DUP1 2 SSTORE SWAP1 SUB 3 SSTORE)", - "code" : "0x47806001556000600060006000600160006000f15047806002559003600355", + "code": "(asm SELFBALANCE DUP1 1 SSTORE 0 0 0 0 1 0 0 CALL POP SELFBALANCE DUP1 2 SSTORE SWAP1 SUB 3 SSTORE)", "nonce": "0", "storage": {} },