From 211e7717f1c5f72b12f29c70c05ee650f586a16d Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Thu, 17 Nov 2022 18:31:51 +0100 Subject: [PATCH 1/7] etc patch --- makeetc.sh | 134 ++++++++++++++++ .../stRefundTest/refund50_1Filler.json | 98 ++++++++++++ .../stRefundTest/refund50_2Filler.json | 125 +++++++++++++++ .../refund50percentCapFiller.json | 123 +++++++++++++++ .../stRefundTest/refund600Filler.json | 120 +++++++++++++++ .../stRefundTest/refund_CallAFiller.json | 144 ++++++++++++++++++ .../stRefundTest/refund_CallA_OOGFiller.json | 116 ++++++++++++++ ...refund_CallA_notEnoughGasInCallFiller.json | 144 ++++++++++++++++++ .../stRefundTest/refund_NoOOG_1Filler.json | 94 ++++++++++++ .../stRefundTest/refund_OOGFiller.json | 98 ++++++++++++ .../refund_TxToSuicideFiller.json | 128 ++++++++++++++++ .../refund_TxToSuicideOOGFiller.json | 99 ++++++++++++ .../refund_changeNonZeroStorageFiller.json | 98 ++++++++++++ .../refund_getEtherBackFiller.json | 96 ++++++++++++ .../refund_multimpleSuicideFiller.json | 127 +++++++++++++++ .../refund_singleSuicideFiller.json | 126 +++++++++++++++ 16 files changed, 1870 insertions(+) create mode 100755 makeetc.sh create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund50_1Filler.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund50_2Filler.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund50percentCapFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund600Filler.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallAFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallA_OOGFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallA_notEnoughGasInCallFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_NoOOG_1Filler.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_OOGFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_TxToSuicideFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_TxToSuicideOOGFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_changeNonZeroStorageFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_getEtherBackFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_multimpleSuicideFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stRefundTest/refund_singleSuicideFiller.json diff --git a/makeetc.sh b/makeetc.sh new file mode 100755 index 00000000000..95fa16f9005 --- /dev/null +++ b/makeetc.sh @@ -0,0 +1,134 @@ +#!/bin/bash + +echo "Translate all known forks to ETC style forks..." +sleep 2 + +replaceForks() { + sources=`find ./src | grep ".json\|.yml"` + for eachfile in $sources + do + + if [[ "$eachfile" == *".yml"* ]]; then + sed -i -e 's/- Byzantium/- ETC_Atlantis/g' $eachfile + sed -i -e 's/\x27Byzantium/\x27ETC_Atlantis/g' $eachfile + sed -i -e 's/ Byzantium:/ ETC_Atlantis:/g' $eachfile + + sed -i -e 's/- Istanbul/- ETC_Phoenix/g' $eachfile + sed -i -e 's/\x27Istanbul/\x27ETC_Phoenix/g' $eachfile + sed -i -e 's/ Istanbul:/ ETC_Phoenix:/g' $eachfile + + sed -i -e 's/- ConstantinopleFix/- ETC_Agharta/g' $eachfile + sed -i -e 's/\x27ConstantinopleFix/\x27ETC_Agharta/g' $eachfile + sed -i -e 's/ ConstantinopleFix:/ ETC_Agharta:/g' $eachfile + + sed -i -e 's/- Constantinople/- ETC_Agharta/g' $eachfile + sed -i -e 's/\x27Constantinople/\x27ETC_Agharta/g' $eachfile + sed -i -e 's/ Constantinople:/ ETC_Agharta:/g' $eachfile + + sed -i -e 's/- Berlin/- ETC_Magneto/g' $eachfile + sed -i -e 's/\x27Berlin/\x27ETC_Magneto/g' $eachfile + sed -i -e 's/ Berlin:/ ETC_Magneto:/g' $eachfile + + sed -i -e 's/- London/- ETC_Mystique/g' $eachfile + sed -i -e 's/\x27London/\x27ETC_Mystique/g' $eachfile + sed -i -e 's/ London:/ ETC_Mystique:/g' $eachfile + + + sed -i -e 's/- Merge/- ETC_Mystique/g' $eachfile + sed -i -e 's/\x27Merge/\x27ETC_Mystique/g' $eachfile + sed -i -e 's/ Merge:/ ETC_Mystique:/g' $eachfile + fi + + sed -i -e 's/\"Byzantium/\"ETC_Atlantis/g' $eachfile + sed -i -e 's/=Byzantium/=ETC_Atlantis/g' $eachfile + sed -i -e 's/>Byzantium/>ETC_Atlantis/g' $eachfile + sed -i -e 's/Istanbul/>ETC_Phoenix/g' $eachfile + sed -i -e 's/ConstantinopleFix/>ETC_Agharta/g' $eachfile + sed -i -e 's/Constantinople/>ETC_Agharta/g' $eachfile + sed -i -e 's/Berlin/>ETC_Magneto/g' $eachfile + sed -i -e 's/London/>ETC_Mystique/g' $eachfile + sed -i -e 's/Merge/>ETC_Mystique/g' $eachfile + sed -i -e 's/=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "368240" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9631760", + "nonce" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 1 ]] 0 [[ 2 ]] 0 [[ 3 ]] 0 [[ 4 ]] 0 [[ 5 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01", + "0x02" : "0x01", + "0x03" : "0x01", + "0x04" : "0x01", + "0x05" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "100000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund50_2Filler.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund50_2Filler.json new file mode 100644 index 00000000000..a186cd9ab49 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund50_2Filler.json @@ -0,0 +1,125 @@ +{ + "refund50_2" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0a" : "0x01", + "0x0b" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "430210" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9569790", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0a" : "0x01", + "0x0b" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "451210" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9548790", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0a" : "0x01", + "0x0b" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "721940" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9278060", + "nonce" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "nonce" : "1", + "code" : "", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 10 ]] 1 [[ 11 ]] 1 [[ 1 ]] 0 [[ 2 ]] 0 [[ 3 ]] 0 [[ 4 ]] 0 [[ 5 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01", + "0x02" : "0x01", + "0x03" : "0x01", + "0x04" : "0x01", + "0x05" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "100000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund50percentCapFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund50percentCapFiller.json new file mode 100644 index 00000000000..e6df6cf2162 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund50percentCapFiller.json @@ -0,0 +1,123 @@ +{ + "refund50percentCap" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0a" : "0x8000000000000000000000000000000000000000000000000000000000000000", + "0x0b" : "0x0de0b6b3a7640000" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "763360" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9236640" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0a" : "0x8000000000000000000000000000000000000000000000000000000000000000", + "0x0b" : "0x0de0b6b3a7640000" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "477100" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9522900" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0a" : "0x8000000000000000000000000000000000000000000000000000000000000000", + "0x0b" : "0x0de0b6b3a7640000" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "467100" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9532900" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ @@1 @@2 [[ 10 ]] (EXP 2 0xff) [[ 11 ]] (BALANCE (ADDRESS)) [[ 1 ]] 0 [[ 2 ]] 0 [[ 3 ]] 0 [[ 4 ]] 0 [[ 5 ]] 0 [[ 6 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01", + "0x02" : "0x01", + "0x03" : "0x01", + "0x04" : "0x01", + "0x05" : "0x01", + "0x06" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "100000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund600Filler.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund600Filler.json new file mode 100644 index 00000000000..20d734eed57 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund600Filler.json @@ -0,0 +1,120 @@ +{ + "refund600" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "ETC_Phoenix"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0b" : "0x0de0b6b3a7640000" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "371350" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9628650" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0b" : "0x0de0b6b3a7640000" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "377850" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9622150" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ ">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x0b" : "0x0de0b6b3a7640000" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "604560" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "9395440" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ @@1 @@2 [[ 10 ]] (EXP 2 0xffff) [[ 11 ]] (BALANCE (ADDRESS)) [[ 1 ]] 0 [[ 2 ]] 0 [[ 3 ]] 0 [[ 4 ]] 0 [[ 5 ]] 0 [[ 6 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01", + "0x02" : "0x01", + "0x03" : "0x01", + "0x04" : "0x01", + "0x05" : "0x01", + "0x06" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "100000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallAFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallAFiller.json new file mode 100644 index 00000000000..74dec05c586 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallAFiller.json @@ -0,0 +1,144 @@ +{ + "refund_CallA" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "ETC_Phoenix"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + "0x00" : "0x01", + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "317300" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "19682690", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "storage" : { + } + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + "0x00" : "0x01", + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "357300" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "19642690", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "storage" : { + } + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ ">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + "0x00" : "0x01", + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "459300" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "19540690", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "storage" : { + } + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 0 ]] (CALL 5500 0xaaae7baea6a6c7c4c2dfeb977efac326af552aaa 0 0 0 0 0 )}", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "20000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 1 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "200000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "10" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallA_OOGFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallA_OOGFiller.json new file mode 100644 index 00000000000..c704b416f4d --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallA_OOGFiller.json @@ -0,0 +1,116 @@ +{ + "refund_CallA_OOG" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix", "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "storage" : { + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "310690" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "2689310", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "storage" : { + "0x01" : "0x01" + } + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "storage" : { + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "310690" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "2689310", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "storage" : { + "0x01" : "0x01" + } + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "nonce" : "1", + "code" : "", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 0 ]] (CALL 6000 0xaaae7baea6a6c7c4c2dfeb977efac326af552aaa 0 0 0 0 0 )}", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "3000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 1 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "31069" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "10" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallA_notEnoughGasInCallFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallA_notEnoughGasInCallFiller.json new file mode 100644 index 00000000000..3d80e05036c --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_CallA_notEnoughGasInCallFiller.json @@ -0,0 +1,144 @@ +{ + "refund_CallA_notEnoughGasInCall" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "ETC_Phoenix"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "275290" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "724700", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "storage" : { + "0x01" : "0x01" + } + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "308290" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "691700", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "storage" : { + "0x01" : "0x01" + } + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ ">=ETC_Mystique" ], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "308290" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "691700", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "storage" : { + "0x01" : "0x01" + } + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 0 ]] (CALL 5005 0xaaae7baea6a6c7c4c2dfeb977efac326af552aaa 0 0 0 0 0 )}", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 1 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "85000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "10" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_NoOOG_1Filler.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_NoOOG_1Filler.json new file mode 100644 index 00000000000..a1b542147ea --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_NoOOG_1Filler.json @@ -0,0 +1,94 @@ +{ + "refund_NoOOG_1" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix", "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "130030" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10371970", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "212060" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10289940", + "nonce" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 1 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10502000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "26006" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "0" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_OOGFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_OOGFiller.json new file mode 100644 index 00000000000..e79e6dd369f --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_OOGFiller.json @@ -0,0 +1,98 @@ +{ + "refund_OOG" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix", "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "storage" : { + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "260050" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "239950", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "storage" : { + "0x01" : "0x01" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "260050" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "239950", + "nonce" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 1 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "500000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "26005" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "10" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_TxToSuicideFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_TxToSuicideFiller.json new file mode 100644 index 00000000000..99aea476cd2 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_TxToSuicideFiller.json @@ -0,0 +1,128 @@ +{ + "refund_TxToSuicide" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "ETC_Phoenix"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "270030" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "99729960", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "shouldnotexist" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "296030" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "99703960", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "shouldnotexist" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [ ">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "536030" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "99463960", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "shouldnotexist" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "100000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "balance" : "1000000000000000000", + "code" : "{ (SELFDESTRUCT 0x095e7baea6a6c7c4c2dfeb977efac326af552d87) }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "61003" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "aaae7baea6a6c7c4c2dfeb977efac326af552aaa", + "value" : [ + "10" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_TxToSuicideOOGFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_TxToSuicideOOGFiller.json new file mode 100644 index 00000000000..a6a9d8a0c40 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_TxToSuicideOOGFiller.json @@ -0,0 +1,99 @@ +{ + "refund_TxToSuicideOOG" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "10000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix", "ETC_Magneto"], + "result" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "210020" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "99789980", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "balance" : "1000000000000000000", + "storage" : { + "0x01" : "0x01" + } + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "210020" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "99789980", + "nonce" : "1" + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "balance" : "1000000000000000000", + "storage" : { + "0x01" : "0x01" + } + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "code" : "", + "nonce" : "1", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "100000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : { + "balance" : "1000000000000000000", + "code" : "{ (SELFDESTRUCT 0x095e7baea6a6c7c4c2dfeb977efac326af552d87) }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "21002" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "aaae7baea6a6c7c4c2dfeb977efac326af552aaa", + "value" : [ + "10" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_changeNonZeroStorageFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_changeNonZeroStorageFiller.json new file mode 100644 index 00000000000..8e9f86464ca --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_changeNonZeroStorageFiller.json @@ -0,0 +1,98 @@ +{ + "refund_changeNonZeroStorage" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix", "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + "0x01" : "0x17" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "260060" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1009739930", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + "0x01" : "0x17" + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "260060" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1009739930", + "nonce" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "nonce" : "1", + "code" : "", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 1 ]] 23 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1010000000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "228500" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "10" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_getEtherBackFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_getEtherBackFiller.json new file mode 100644 index 00000000000..007301fb419 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_getEtherBackFiller.json @@ -0,0 +1,96 @@ +{ + "refund_getEtherBack" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "228500", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix", "ETC_Magneto"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "130030" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1022719960", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000010", + "storage" : { + } + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "212060" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1022637930", + "nonce" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "nonce" : "1", + "code" : "", + "storage" : {} + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ [[ 1 ]] 0 }", + "nonce" : "0", + "storage" : { + "0x01" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1022850000", + "code" : "", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : [ + "" + ], + "gasLimit" : [ + "228500" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : [ + "10" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_multimpleSuicideFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_multimpleSuicideFiller.json new file mode 100644 index 00000000000..54692cb8532 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_multimpleSuicideFiller.json @@ -0,0 +1,127 @@ +{ + "refund_multimpleSuicide" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix"], + "result" : { + "1000000000000000000000000000000000000001" : { + "shouldnotexist" : "1" + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "166200" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "102833800", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Magneto"], + "result" : { + "1000000000000000000000000000000000000001" : { + "shouldnotexist" : "1" + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "160200" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "102839800", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "1000000000000000000000000000000000000001" : { + "shouldnotexist" : "1" + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "320390" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "102679610", + "nonce" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "nonce" : "1", + "code" : "", + "storage" : {} + }, + "1000000000000000000000000000000000000001" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "//comment1" : "contract Killer {", + "//comment2" : " function homicide() {", + "//comment3" : " suicide(msg.sender);", + "//comment4" : " }", + "//comment5" : "", + "//comment6" : " function multipleHomocide() {", + "//comment7" : " Killer k = this;", + "//comment8" : " k.homicide();", + "//comment9" : " k.homicide();", + "//comment10" : " }", + "//comment11" : "", + "//comment12" : " function run() returns (bool)", + "//comment13" : " {", + "//comment14" : " multipleHomocide();", + "//comment15" : " return true;", + "//comment16" : " }", + "//comment17" : "}", + "code" : ":raw 0x606060405260e060020a600035046309e587a58114610031578063c04062261461004d578063dd4f1f2a1461005a575b005b61002f3373ffffffffffffffffffffffffffffffffffffffff16ff5b6100f5600061010961005e565b61002f5b60003090508073ffffffffffffffffffffffffffffffffffffffff166309e587a56040518160e060020a0281526004018090506000604051808303816000876161da5a03f1156100025750604080517f09e587a500000000000000000000000000000000000000000000000000000000815290516004828101926000929190829003018183876161da5a03f1156100025750505050565b604080519115158252519081900360200190f35b5060019056", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "103000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "data" : [ + ":raw 0xc0406226" + ], + "gasLimit" : [ + "300000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "1000000000000000000000000000000000000001", + "value" : [ + "0" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stRefundTest/refund_singleSuicideFiller.json b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_singleSuicideFiller.json new file mode 100644 index 00000000000..5ea47aa34a6 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stRefundTest/refund_singleSuicideFiller.json @@ -0,0 +1,126 @@ +{ + "refund_singleSuicide" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x20000", + "currentGasLimit" : "1000000", + "currentNumber" : "1", + "currentTimestamp" : "1000", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect" : [ + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Phoenix"], + "result" : { + "1000000000000000000000000000000000000001" : { + "shouldnotexist" : "1" + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "136670" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "29863330", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : ["ETC_Magneto"], + "result" : { + "1000000000000000000000000000000000000001" : { + "shouldnotexist" : "1" + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "133670" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "29866330", + "nonce" : "1" + } + } + }, + { + "indexes" : { + "data" : -1, + "gas" : -1, + "value" : -1 + }, + "network" : [">=ETC_Mystique"], + "result" : { + "1000000000000000000000000000000000000001" : { + "shouldnotexist" : "1" + }, + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "267340" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "29732660", + "nonce" : "1" + } + } + } + ], + "pre" : { + "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : { + "balance" : "0", + "nonce" : "1", + "code" : "", + "storage" : {} + }, + "1000000000000000000000000000000000000001" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "//comment1" : "contract Killer {", + "//comment2" : " function homicide() {", + "//comment3" : " suicide(msg.sender);", + "//comment4" : " }", + "//comment5" : "", + "//comment6" : " function multipleHomocide() {", + "//comment7" : " Killer k = this;", + "//comment8" : " k.homicide();", + "//comment9" : " }", + "//comment10" : "", + "//comment11" : " function run() returns (bool)", + "//comment12" : " {", + "//comment13" : " multipleHomocide();", + "//comment14" : " return true;", + "//comment15" : " }", + "//comment16" : "}", + "code" : ":raw 0x606060405260e060020a600035046309e587a58114602e5780632e4699ed146049578063c040622614609b575b005b602c3373ffffffffffffffffffffffffffffffffffffffff16ff5b602c5b60003090508073ffffffffffffffffffffffffffffffffffffffff166309e587a56040518160e060020a0281526004018090506000604051808303816000876161da5a03f11560025750505050565b60a5600060b9604c565b604080519115158252519081900360200190f35b5060019056", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "30000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "data" : [ + ":raw 0xc0406226" + ], + "gasLimit" : [ + "300000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "1000000000000000000000000000000000000001", + "value" : [ + "0" + ] + } + } +} From 8d5fc1042b7f742e9bbc5ff82eff8281516fee67 Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Sat, 19 Nov 2022 00:47:53 +0100 Subject: [PATCH 2/7] patch remaining tests --- makeetc.sh | 201 +-- .../stBadOpcode/badOpcodesFiller.json | 211 +++ .../undefinedOpcodeFirstByteFiller.yml | 1475 +++++++++++++++++ .../stChainId/chainIdFiller.json | 58 + .../stEIP1559/typeTwoBerlinFiller.yml | 57 + .../stEIP2930/coinbaseT2Filler.yml | 113 ++ .../stExample/basefeeExampleFiller.yml | 62 + .../stExample/eip1559Filler.yml | 66 + .../stExample/mergeTestFiller.yml | 62 + .../stSStoreTest/sstoreGasFiller.yml | 191 +++ 10 files changed, 2385 insertions(+), 111 deletions(-) create mode 100644 src-etc/GeneralStateTestsFiller/stBadOpcode/badOpcodesFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stBadOpcode/undefinedOpcodeFirstByteFiller.yml create mode 100644 src-etc/GeneralStateTestsFiller/stChainId/chainIdFiller.json create mode 100644 src-etc/GeneralStateTestsFiller/stEIP1559/typeTwoBerlinFiller.yml create mode 100644 src-etc/GeneralStateTestsFiller/stEIP2930/coinbaseT2Filler.yml create mode 100644 src-etc/GeneralStateTestsFiller/stExample/basefeeExampleFiller.yml create mode 100644 src-etc/GeneralStateTestsFiller/stExample/eip1559Filler.yml create mode 100644 src-etc/GeneralStateTestsFiller/stExample/mergeTestFiller.yml create mode 100644 src-etc/GeneralStateTestsFiller/stSStoreTest/sstoreGasFiller.yml diff --git a/makeetc.sh b/makeetc.sh index 95fa16f9005..583471f5520 100755 --- a/makeetc.sh +++ b/makeetc.sh @@ -3,132 +3,111 @@ echo "Translate all known forks to ETC style forks..." sleep 2 -replaceForks() { - sources=`find ./src | grep ".json\|.yml"` - for eachfile in $sources - do +function translateFile() { + if [[ "$1" == *".yml"* ]]; then + sed -i -e 's/- Byzantium/- ETC_Atlantis/g' $1 + sed -i -e 's/\x27Byzantium/\x27ETC_Atlantis/g' $1 + sed -i -e 's/ Byzantium:/ ETC_Atlantis:/g' $1 - if [[ "$eachfile" == *".yml"* ]]; then - sed -i -e 's/- Byzantium/- ETC_Atlantis/g' $eachfile - sed -i -e 's/\x27Byzantium/\x27ETC_Atlantis/g' $eachfile - sed -i -e 's/ Byzantium:/ ETC_Atlantis:/g' $eachfile + sed -i -e 's/- Istanbul/- ETC_Phoenix/g' $1 + sed -i -e 's/\x27Istanbul/\x27ETC_Phoenix/g' $1 + sed -i -e 's/ Istanbul:/ ETC_Phoenix:/g' $1 - sed -i -e 's/- Istanbul/- ETC_Phoenix/g' $eachfile - sed -i -e 's/\x27Istanbul/\x27ETC_Phoenix/g' $eachfile - sed -i -e 's/ Istanbul:/ ETC_Phoenix:/g' $eachfile + sed -i -e 's/- ConstantinopleFix/- ETC_Agharta/g' $1 + sed -i -e 's/\x27ConstantinopleFix/\x27ETC_Agharta/g' $1 + sed -i -e 's/ ConstantinopleFix:/ ETC_Agharta:/g' $1 - sed -i -e 's/- ConstantinopleFix/- ETC_Agharta/g' $eachfile - sed -i -e 's/\x27ConstantinopleFix/\x27ETC_Agharta/g' $eachfile - sed -i -e 's/ ConstantinopleFix:/ ETC_Agharta:/g' $eachfile + sed -i -e 's/- Constantinople/- ETC_Agharta/g' $1 + sed -i -e 's/\x27Constantinople/\x27ETC_Agharta/g' $1 + sed -i -e 's/ Constantinople:/ ETC_Agharta:/g' $1 - sed -i -e 's/- Constantinople/- ETC_Agharta/g' $eachfile - sed -i -e 's/\x27Constantinople/\x27ETC_Agharta/g' $eachfile - sed -i -e 's/ Constantinople:/ ETC_Agharta:/g' $eachfile + sed -i -e 's/- Berlin/- ETC_Magneto/g' $1 + sed -i -e 's/\x27Berlin/\x27ETC_Magneto/g' $1 + sed -i -e 's/ Berlin:/ ETC_Magneto:/g' $1 - sed -i -e 's/- Berlin/- ETC_Magneto/g' $eachfile - sed -i -e 's/\x27Berlin/\x27ETC_Magneto/g' $eachfile - sed -i -e 's/ Berlin:/ ETC_Magneto:/g' $eachfile + sed -i -e 's/- London/- ETC_Mystique/g' $1 + sed -i -e 's/\x27London/\x27ETC_Mystique/g' $1 + sed -i -e 's/ London:/ ETC_Mystique:/g' $1 - sed -i -e 's/- London/- ETC_Mystique/g' $eachfile - sed -i -e 's/\x27London/\x27ETC_Mystique/g' $eachfile - sed -i -e 's/ London:/ ETC_Mystique:/g' $eachfile - - sed -i -e 's/- Merge/- ETC_Mystique/g' $eachfile - sed -i -e 's/\x27Merge/\x27ETC_Mystique/g' $eachfile - sed -i -e 's/ Merge:/ ETC_Mystique:/g' $eachfile + sed -i -e 's/- Merge/- ETC_Mystique/g' $1 + sed -i -e 's/\x27Merge/\x27ETC_Mystique/g' $1 + sed -i -e 's/ Merge:/ ETC_Mystique:/g' $1 fi - sed -i -e 's/\"Byzantium/\"ETC_Atlantis/g' $eachfile - sed -i -e 's/=Byzantium/=ETC_Atlantis/g' $eachfile - sed -i -e 's/>Byzantium/>ETC_Atlantis/g' $eachfile - sed -i -e 's/Istanbul/>ETC_Phoenix/g' $eachfile - sed -i -e 's/ConstantinopleFix/>ETC_Agharta/g' $eachfile - sed -i -e 's/Constantinople/>ETC_Agharta/g' $eachfile - sed -i -e 's/Berlin/>ETC_Magneto/g' $eachfile - sed -i -e 's/London/>ETC_Mystique/g' $eachfile - sed -i -e 's/Merge/>ETC_Mystique/g' $eachfile - sed -i -e 's/Byzantium/>ETC_Atlantis/g' $1 + sed -i -e 's/Istanbul/>ETC_Phoenix/g' $1 + sed -i -e 's/ConstantinopleFix/>ETC_Agharta/g' $1 + sed -i -e 's/Constantinople/>ETC_Agharta/g' $1 + sed -i -e 's/Berlin/>ETC_Magneto/g' $1 + sed -i -e 's/London/>ETC_Mystique/g' $1 + sed -i -e 's/Merge/>ETC_Mystique/g' $1 + sed -i -e 's/=ETC_Phoenix"], + "result" : { + "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { + "shouldnotexist": "1" + } + } + }, + { + "indexes" : { + "data" : [23], + "gas" : 0, + "value" : 0 + }, + "network" : [ "ETC_Phoenix"], + "result" : { + "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { + "shouldnotexist": "1" + } + } + }, + { + "indexes" : { + "//comment" : "basefee", + "data" : [23], + "gas" : 0, + "value" : 0 + }, + "network" : [ ">=ETC_Mystique"], + "result" : { + "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { + "shouldnotexist": "1" + } + } + }, + { + "indexes" : { + "//comment" : "create2, selfbalance, chainid", + "data" : [110, 21, 22], + "gas" : 0, + "value" : 0 + }, + "network" : [">=ETC_Phoenix"], + "result" : { + "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { + "code" : "0x" + } + } + } + ], + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code": "0x", + "nonce": "0", + "storage": { + } + } + }, + "transaction" : { + "data" : [ + ":raw 0x600160016001600160016001600160010c60006000f3", + ":raw 0x600160016001600160016001600160010d60006000f3", + ":raw 0x600160016001600160016001600160010e60006000f3", + ":raw 0x600160016001600160016001600160010f60006000f3", + ":raw 0x600160016001600160016001600160011e60006000f3", + ":raw 0x600160016001600160016001600160011f60006000f3", + ":raw 0x600160016001600160016001600160012160006000f3", + ":raw 0x600160016001600160016001600160012260006000f3", + ":raw 0x600160016001600160016001600160012360006000f3", + ":raw 0x600160016001600160016001600160012460006000f3", + ":raw 0x600160016001600160016001600160012560006000f3", + ":raw 0x600160016001600160016001600160012660006000f3", + ":raw 0x600160016001600160016001600160012760006000f3", + ":raw 0x600160016001600160016001600160012860006000f3", + ":raw 0x600160016001600160016001600160012960006000f3", + ":raw 0x600160016001600160016001600160012a60006000f3", + ":raw 0x600160016001600160016001600160012b60006000f3", + ":raw 0x600160016001600160016001600160012c60006000f3", + ":raw 0x600160016001600160016001600160012d60006000f3", + ":raw 0x600160016001600160016001600160012e60006000f3", + ":raw 0x600160016001600160016001600160012f60006000f3", + ":raw 0x600160016001600160016001600160014660006000f3", + ":raw 0x600160016001600160016001600160014760006000f3", + ":raw 0x600160016001600160016001600160014860006000f3", + ":raw 0x600160016001600160016001600160014960006000f3", + ":raw 0x600160016001600160016001600160014a60006000f3", + ":raw 0x600160016001600160016001600160014b60006000f3", + ":raw 0x600160016001600160016001600160014c60006000f3", + ":raw 0x600160016001600160016001600160014d60006000f3", + ":raw 0x600160016001600160016001600160014e60006000f3", + ":raw 0x600160016001600160016001600160014f60006000f3", + ":raw 0x600160016001600160016001600160015c60006000f3", + ":raw 0x600160016001600160016001600160015d60006000f3", + ":raw 0x600160016001600160016001600160015e60006000f3", + ":raw 0x600160016001600160016001600160015f60006000f3", + ":raw 0x60016001600160016001600160016001a560006000f3", + ":raw 0x60016001600160016001600160016001a660006000f3", + ":raw 0x60016001600160016001600160016001a760006000f3", + ":raw 0x60016001600160016001600160016001a860006000f3", + ":raw 0x60016001600160016001600160016001a960006000f3", + ":raw 0x60016001600160016001600160016001aa60006000f3", + ":raw 0x60016001600160016001600160016001ab60006000f3", + ":raw 0x60016001600160016001600160016001ac60006000f3", + ":raw 0x60016001600160016001600160016001ad60006000f3", + ":raw 0x60016001600160016001600160016001ae60006000f3", + ":raw 0x60016001600160016001600160016001af60006000f3", + ":raw 0x60016001600160016001600160016001b060006000f3", + ":raw 0x60016001600160016001600160016001b160006000f3", + ":raw 0x60016001600160016001600160016001b260006000f3", + ":raw 0x60016001600160016001600160016001b360006000f3", + ":raw 0x60016001600160016001600160016001b460006000f3", + ":raw 0x60016001600160016001600160016001b560006000f3", + ":raw 0x60016001600160016001600160016001b660006000f3", + ":raw 0x60016001600160016001600160016001b760006000f3", + ":raw 0x60016001600160016001600160016001b860006000f3", + ":raw 0x60016001600160016001600160016001b960006000f3", + ":raw 0x60016001600160016001600160016001ba60006000f3", + ":raw 0x60016001600160016001600160016001bb60006000f3", + ":raw 0x60016001600160016001600160016001bc60006000f3", + ":raw 0x60016001600160016001600160016001bd60006000f3", + ":raw 0x60016001600160016001600160016001be60006000f3", + ":raw 0x60016001600160016001600160016001bf60006000f3", + ":raw 0x60016001600160016001600160016001c060006000f3", + ":raw 0x60016001600160016001600160016001c160006000f3", + ":raw 0x60016001600160016001600160016001c260006000f3", + ":raw 0x60016001600160016001600160016001c360006000f3", + ":raw 0x60016001600160016001600160016001c460006000f3", + ":raw 0x60016001600160016001600160016001c560006000f3", + ":raw 0x60016001600160016001600160016001c660006000f3", + ":raw 0x60016001600160016001600160016001c760006000f3", + ":raw 0x60016001600160016001600160016001c860006000f3", + ":raw 0x60016001600160016001600160016001c960006000f3", + ":raw 0x60016001600160016001600160016001ca60006000f3", + ":raw 0x60016001600160016001600160016001cb60006000f3", + ":raw 0x60016001600160016001600160016001cc60006000f3", + ":raw 0x60016001600160016001600160016001cd60006000f3", + ":raw 0x60016001600160016001600160016001ce60006000f3", + ":raw 0x60016001600160016001600160016001cf60006000f3", + ":raw 0x60016001600160016001600160016001d060006000f3", + ":raw 0x60016001600160016001600160016001d160006000f3", + ":raw 0x60016001600160016001600160016001d260006000f3", + ":raw 0x60016001600160016001600160016001d360006000f3", + ":raw 0x60016001600160016001600160016001d460006000f3", + ":raw 0x60016001600160016001600160016001d560006000f3", + ":raw 0x60016001600160016001600160016001d660006000f3", + ":raw 0x60016001600160016001600160016001d760006000f3", + ":raw 0x60016001600160016001600160016001d860006000f3", + ":raw 0x60016001600160016001600160016001d960006000f3", + ":raw 0x60016001600160016001600160016001da60006000f3", + ":raw 0x60016001600160016001600160016001db60006000f3", + ":raw 0x60016001600160016001600160016001dc60006000f3", + ":raw 0x60016001600160016001600160016001dd60006000f3", + ":raw 0x60016001600160016001600160016001de60006000f3", + ":raw 0x60016001600160016001600160016001df60006000f3", + ":raw 0x60016001600160016001600160016001e060006000f3", + ":raw 0x60016001600160016001600160016001e160006000f3", + ":raw 0x60016001600160016001600160016001e260006000f3", + ":raw 0x60016001600160016001600160016001e360006000f3", + ":raw 0x60016001600160016001600160016001e460006000f3", + ":raw 0x60016001600160016001600160016001e560006000f3", + ":raw 0x60016001600160016001600160016001e660006000f3", + ":raw 0x60016001600160016001600160016001e760006000f3", + ":raw 0x60016001600160016001600160016001e860006000f3", + ":raw 0x60016001600160016001600160016001e960006000f3", + ":raw 0x60016001600160016001600160016001ea60006000f3", + ":raw 0x60016001600160016001600160016001eb60006000f3", + ":raw 0x60016001600160016001600160016001ec60006000f3", + ":raw 0x60016001600160016001600160016001ed60006000f3", + ":raw 0x60016001600160016001600160016001ee60006000f3", + ":raw 0x60016001600160016001600160016001ef60006000f3", + ":raw 0x60016001600160016001600160016001f560006000f3", + ":raw 0x60016001600160016001600160016001f660006000f3", + ":raw 0x60016001600160016001600160016001f760006000f3", + ":raw 0x60016001600160016001600160016001f860006000f3", + ":raw 0x60016001600160016001600160016001f960006000f3", + ":raw 0x60016001600160016001600160016001fc60006000f3", + ":raw 0x60016001600160016001600160016001fe60006000f3" + ], + "gasLimit" : [ + "400000" + ], + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "", + "value" : [ + "100000" + ] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stBadOpcode/undefinedOpcodeFirstByteFiller.yml b/src-etc/GeneralStateTestsFiller/stBadOpcode/undefinedOpcodeFirstByteFiller.yml new file mode 100644 index 00000000000..7542e55ac12 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stBadOpcode/undefinedOpcodeFirstByteFiller.yml @@ -0,0 +1,1475 @@ +# Checks that behaviour of already deployed code, having invalid opcodes as the first byte. +# Execution is expected to end with an exception. +undefinedOpcodeFirstByte: + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: '0x020000' + currentGasLimit: '89128960' + currentNumber: '1' + currentTimestamp: '1000' + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + + pre: + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: 1000000000 + code: '' + nonce: 0 + storage: {} + b94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: 0 + code: | + :yul + { + for { let opcode := 0 } lt(opcode, 256) { opcode := add(opcode, 1) } + { + let addr := shl(152, opcode) + if call(10000, addr, 0, 0, 0, 0, 0) { sstore(opcode, 1) } + } + sstore(256, 1) + } + nonce: 0 + storage: {} + 0000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x00' + nonce: 0 + storage: {} + 0100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x01' + nonce: 0 + storage: {} + 0200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x02' + nonce: 0 + storage: {} + 0300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x03' + nonce: 0 + storage: {} + 0400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x04' + nonce: 0 + storage: {} + 0500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x05' + nonce: 0 + storage: {} + 0600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x06' + nonce: 0 + storage: {} + 0700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x07' + nonce: 0 + storage: {} + 0800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x08' + nonce: 0 + storage: {} + 0900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x09' + nonce: 0 + storage: {} + 0a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x0a' + nonce: 0 + storage: {} + 0b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x0b' + nonce: 0 + storage: {} + 0c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x0c' + nonce: 0 + storage: {} + 0d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x0d' + nonce: 0 + storage: {} + 0e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x0e' + nonce: 0 + storage: {} + 0f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x0f' + nonce: 0 + storage: {} + + 1000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x10' + nonce: 0 + storage: {} + 1100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x11' + nonce: 0 + storage: {} + 1200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x12' + nonce: 0 + storage: {} + 1300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x13' + nonce: 0 + storage: {} + 1400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x14' + nonce: 0 + storage: {} + 1500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x15' + nonce: 0 + storage: {} + 1600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x16' + nonce: 0 + storage: {} + 1700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x17' + nonce: 0 + storage: {} + 1800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x18' + nonce: 0 + storage: {} + 1900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x19' + nonce: 0 + storage: {} + 1a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x1a' + nonce: 0 + storage: {} + 1b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x1b' + nonce: 0 + storage: {} + 1c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x1c' + nonce: 0 + storage: {} + 1d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x1d' + nonce: 0 + storage: {} + 1e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x1e' + nonce: 0 + storage: {} + 1f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x1f' + nonce: 0 + storage: {} + + 2000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x20' + nonce: 0 + storage: {} + 2100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x21' + nonce: 0 + storage: {} + 2200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x22' + nonce: 0 + storage: {} + 2300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x23' + nonce: 0 + storage: {} + 2400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x24' + nonce: 0 + storage: {} + 2500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x25' + nonce: 0 + storage: {} + 2600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x26' + nonce: 0 + storage: {} + 2700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x27' + nonce: 0 + storage: {} + 2800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x28' + nonce: 0 + storage: {} + 2900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x29' + nonce: 0 + storage: {} + 2a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x2a' + nonce: 0 + storage: {} + 2b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x2b' + nonce: 0 + storage: {} + 2c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x2c' + nonce: 0 + storage: {} + 2d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x2d' + nonce: 0 + storage: {} + 2e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x2e' + nonce: 0 + storage: {} + 2f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x2f' + nonce: 0 + storage: {} + + 3000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x30' + nonce: 0 + storage: {} + 3100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x31' + nonce: 0 + storage: {} + 3200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x32' + nonce: 0 + storage: {} + 3300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x33' + nonce: 0 + storage: {} + 3400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x34' + nonce: 0 + storage: {} + 3500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x35' + nonce: 0 + storage: {} + 3600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x36' + nonce: 0 + storage: {} + 3700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x37' + nonce: 0 + storage: {} + 3800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x38' + nonce: 0 + storage: {} + 3900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x39' + nonce: 0 + storage: {} + 3a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x3a' + nonce: 0 + storage: {} + 3b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x3b' + nonce: 0 + storage: {} + 3c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x3c' + nonce: 0 + storage: {} + 3d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x3d' + nonce: 0 + storage: {} + 3e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x3e' + nonce: 0 + storage: {} + 3f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x3f' + nonce: 0 + storage: {} + + 4000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x40' + nonce: 0 + storage: {} + 4100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x41' + nonce: 0 + storage: {} + 4200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x42' + nonce: 0 + storage: {} + 4300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x43' + nonce: 0 + storage: {} + 4400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x44' + nonce: 0 + storage: {} + 4500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x45' + nonce: 0 + storage: {} + 4600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x46' + nonce: 0 + storage: {} + 4700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x47' + nonce: 0 + storage: {} + 4800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x48' + nonce: 0 + storage: {} + 4900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x49' + nonce: 0 + storage: {} + 4a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x4a' + nonce: 0 + storage: {} + 4b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x4b' + nonce: 0 + storage: {} + 4c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x4c' + nonce: 0 + storage: {} + 4d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x4d' + nonce: 0 + storage: {} + 4e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x4e' + nonce: 0 + storage: {} + 4f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x4f' + nonce: 0 + storage: {} + + 5000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x50' + nonce: 0 + storage: {} + 5100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x51' + nonce: 0 + storage: {} + 5200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x52' + nonce: 0 + storage: {} + 5300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x53' + nonce: 0 + storage: {} + 5400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x54' + nonce: 0 + storage: {} + 5500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x55' + nonce: 0 + storage: {} + 5600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x56' + nonce: 0 + storage: {} + 5700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x57' + nonce: 0 + storage: {} + 5800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x58' + nonce: 0 + storage: {} + 5900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x59' + nonce: 0 + storage: {} + 5a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x5a' + nonce: 0 + storage: {} + 5b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x5b' + nonce: 0 + storage: {} + 5c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x5c' + nonce: 0 + storage: {} + 5d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x5d' + nonce: 0 + storage: {} + 5e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x5e' + nonce: 0 + storage: {} + 5f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x5f' + nonce: 0 + storage: {} + + 6000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x60' + nonce: 0 + storage: {} + 6100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x61' + nonce: 0 + storage: {} + 6200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x62' + nonce: 0 + storage: {} + 6300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x63' + nonce: 0 + storage: {} + 6400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x64' + nonce: 0 + storage: {} + 6500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x65' + nonce: 0 + storage: {} + 6600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x66' + nonce: 0 + storage: {} + 6700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x67' + nonce: 0 + storage: {} + 6800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x68' + nonce: 0 + storage: {} + 6900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x69' + nonce: 0 + storage: {} + 6a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x6a' + nonce: 0 + storage: {} + 6b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x6b' + nonce: 0 + storage: {} + 6c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x6c' + nonce: 0 + storage: {} + 6d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x6d' + nonce: 0 + storage: {} + 6e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x6e' + nonce: 0 + storage: {} + 6f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x6f' + nonce: 0 + storage: {} + + 7000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x70' + nonce: 0 + storage: {} + 7100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x71' + nonce: 0 + storage: {} + 7200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x72' + nonce: 0 + storage: {} + 7300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x73' + nonce: 0 + storage: {} + 7400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x74' + nonce: 0 + storage: {} + 7500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x75' + nonce: 0 + storage: {} + 7600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x76' + nonce: 0 + storage: {} + 7700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x77' + nonce: 0 + storage: {} + 7800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x78' + nonce: 0 + storage: {} + 7900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x79' + nonce: 0 + storage: {} + 7a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x7a' + nonce: 0 + storage: {} + 7b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x7b' + nonce: 0 + storage: {} + 7c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x7c' + nonce: 0 + storage: {} + 7d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x7d' + nonce: 0 + storage: {} + 7e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x7e' + nonce: 0 + storage: {} + 7f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x7f' + nonce: 0 + storage: {} + + 8000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x80' + nonce: 0 + storage: {} + 8100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x81' + nonce: 0 + storage: {} + 8200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x82' + nonce: 0 + storage: {} + 8300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x83' + nonce: 0 + storage: {} + 8400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x84' + nonce: 0 + storage: {} + 8500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x85' + nonce: 0 + storage: {} + 8600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x86' + nonce: 0 + storage: {} + 8700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x87' + nonce: 0 + storage: {} + 8800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x88' + nonce: 0 + storage: {} + 8900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x89' + nonce: 0 + storage: {} + 8a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x8a' + nonce: 0 + storage: {} + 8b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x8b' + nonce: 0 + storage: {} + 8c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x8c' + nonce: 0 + storage: {} + 8d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x8d' + nonce: 0 + storage: {} + 8e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x8e' + nonce: 0 + storage: {} + 8f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x8f' + nonce: 0 + storage: {} + + 9000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x90' + nonce: 0 + storage: {} + 9100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x91' + nonce: 0 + storage: {} + 9200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x92' + nonce: 0 + storage: {} + 9300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x93' + nonce: 0 + storage: {} + 9400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x94' + nonce: 0 + storage: {} + 9500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x95' + nonce: 0 + storage: {} + 9600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x96' + nonce: 0 + storage: {} + 9700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x97' + nonce: 0 + storage: {} + 9800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x98' + nonce: 0 + storage: {} + 9900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x99' + nonce: 0 + storage: {} + 9a00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x9a' + nonce: 0 + storage: {} + 9b00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x9b' + nonce: 0 + storage: {} + 9c00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x9c' + nonce: 0 + storage: {} + 9d00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x9d' + nonce: 0 + storage: {} + 9e00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x9e' + nonce: 0 + storage: {} + 9f00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0x9f' + nonce: 0 + storage: {} + + + a000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa0' + nonce: 0 + storage: {} + a100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa1' + nonce: 0 + storage: {} + a200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa2' + nonce: 0 + storage: {} + a300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa3' + nonce: 0 + storage: {} + a400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa4' + nonce: 0 + storage: {} + a500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa5' + nonce: 0 + storage: {} + a600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa6' + nonce: 0 + storage: {} + a700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa7' + nonce: 0 + storage: {} + a800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa8' + nonce: 0 + storage: {} + a900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xa9' + nonce: 0 + storage: {} + aa00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xaa' + nonce: 0 + storage: {} + ab00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xab' + nonce: 0 + storage: {} + ac00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xac' + nonce: 0 + storage: {} + ad00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xad' + nonce: 0 + storage: {} + ae00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xae' + nonce: 0 + storage: {} + af00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xaf' + nonce: 0 + storage: {} + + b000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb0' + nonce: 0 + storage: {} + b100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb1' + nonce: 0 + storage: {} + b200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb2' + nonce: 0 + storage: {} + b300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb3' + nonce: 0 + storage: {} + b400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb4' + nonce: 0 + storage: {} + b500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb5' + nonce: 0 + storage: {} + b600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb6' + nonce: 0 + storage: {} + b700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb7' + nonce: 0 + storage: {} + b800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb8' + nonce: 0 + storage: {} + b900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xb9' + nonce: 0 + storage: {} + ba00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xba' + nonce: 0 + storage: {} + bb00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xbb' + nonce: 0 + storage: {} + bc00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xbc' + nonce: 0 + storage: {} + bd00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xbd' + nonce: 0 + storage: {} + be00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xbe' + nonce: 0 + storage: {} + bf00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xbf' + nonce: 0 + storage: {} + + c000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc0' + nonce: 0 + storage: {} + c100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc1' + nonce: 0 + storage: {} + c200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc2' + nonce: 0 + storage: {} + c300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc3' + nonce: 0 + storage: {} + c400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc4' + nonce: 0 + storage: {} + c500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc5' + nonce: 0 + storage: {} + c600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc6' + nonce: 0 + storage: {} + c700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc7' + nonce: 0 + storage: {} + c800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc8' + nonce: 0 + storage: {} + c900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xc9' + nonce: 0 + storage: {} + ca00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xca' + nonce: 0 + storage: {} + cb00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xcb' + nonce: 0 + storage: {} + cc00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xcc' + nonce: 0 + storage: {} + cd00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xcd' + nonce: 0 + storage: {} + ce00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xce' + nonce: 0 + storage: {} + cf00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xcf' + nonce: 0 + storage: {} + + d000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd0' + nonce: 0 + storage: {} + d100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd1' + nonce: 0 + storage: {} + d200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd2' + nonce: 0 + storage: {} + d300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd3' + nonce: 0 + storage: {} + d400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd4' + nonce: 0 + storage: {} + d500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd5' + nonce: 0 + storage: {} + d600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd6' + nonce: 0 + storage: {} + d700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd7' + nonce: 0 + storage: {} + d800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd8' + nonce: 0 + storage: {} + d900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xd9' + nonce: 0 + storage: {} + da00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xda' + nonce: 0 + storage: {} + db00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xdb' + nonce: 0 + storage: {} + dc00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xdc' + nonce: 0 + storage: {} + dd00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xdd' + nonce: 0 + storage: {} + de00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xde' + nonce: 0 + storage: {} + df00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xdf' + nonce: 0 + storage: {} + + e000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe0' + nonce: 0 + storage: {} + e100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe1' + nonce: 0 + storage: {} + e200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe2' + nonce: 0 + storage: {} + e300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe3' + nonce: 0 + storage: {} + e400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe4' + nonce: 0 + storage: {} + e500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe5' + nonce: 0 + storage: {} + e600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe6' + nonce: 0 + storage: {} + e700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe7' + nonce: 0 + storage: {} + e800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe8' + nonce: 0 + storage: {} + e900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xe9' + nonce: 0 + storage: {} + ea00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xea' + nonce: 0 + storage: {} + eb00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xeb' + nonce: 0 + storage: {} + ec00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xec' + nonce: 0 + storage: {} + ed00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xed' + nonce: 0 + storage: {} + ee00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xee' + nonce: 0 + storage: {} + ef00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xef' + nonce: 0 + storage: {} + + f000000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf0' + nonce: 0 + storage: {} + f100000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf1' + nonce: 0 + storage: {} + f200000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf2' + nonce: 0 + storage: {} + f300000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf3' + nonce: 0 + storage: {} + f400000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf4' + nonce: 0 + storage: {} + f500000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf5' + nonce: 0 + storage: {} + f600000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf6' + nonce: 0 + storage: {} + f700000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf7' + nonce: 0 + storage: {} + f800000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf8' + nonce: 0 + storage: {} + f900000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xf9' + nonce: 0 + storage: {} + fa00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xfa' + nonce: 0 + storage: {} + fb00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xfb' + nonce: 0 + storage: {} + fc00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xfc' + nonce: 0 + storage: {} + fd00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xfd' + nonce: 0 + storage: {} + fe00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xfe' + nonce: 0 + storage: {} + ff00000000000000000000000000000000000000: + balance: 0 + code: ':raw 0xff' + nonce: 0 + storage: {} + + + transaction: + data: + - '' + gasLimit: + - 70000000 + gasPrice: 10 + nonce: 0 + secretKey: 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 + to: 'b94f5374fce5edbc8e2a8697c15331677e6ebf0b' + value: + - 0 + + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + network: + - 'ETC_Magneto' + result: + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + nonce: 1 + b94f5374fce5edbc8e2a8697c15331677e6ebf0b: + storage: + '0x00': 1 # STOP + '0x30': 1 # ADDRESS + '0x32': 1 # ORIGIN + '0x33': 1 # CALLER + '0x34': 1 # CALLVALUE + '0x36': 1 # CALLDATASIZE + '0x38': 1 # CODESIZE + '0x3a': 1 # GASPRICE + '0x3d': 1 # RETURNDATASIZE + '0x41': 1 # COINBASE + '0x42': 1 # TIMESTAMP + '0x43': 1 # NUMBER + '0x44': 1 # DIFFICULTY + '0x45': 1 # GASLIMIT + '0x46': 1 # CHAINID + '0x47': 1 # SELFBALANCE + '0x58': 1 # PC + '0x59': 1 # MSIZE + '0x5A': 1 # GAS + '0x5B': 1 # JUMPDEST + + '0x60': 1 # PUSHx ... + '0x61': 1 + '0x62': 1 + '0x63': 1 + '0x64': 1 + '0x65': 1 + '0x66': 1 + '0x67': 1 + '0x68': 1 + '0x69': 1 + '0x6a': 1 + '0x6b': 1 + '0x6c': 1 + '0x6d': 1 + '0x6e': 1 + '0x6f': 1 + '0x70': 1 + '0x71': 1 + '0x72': 1 + '0x73': 1 + '0x74': 1 + '0x75': 1 + '0x76': 1 + '0x77': 1 + '0x78': 1 + '0x79': 1 + '0x7a': 1 + '0x7b': 1 + '0x7c': 1 + '0x7d': 1 + '0x7e': 1 + '0x7f': 1 + + '0x100': 1 + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + network: + - '>=ETC_Mystique' + result: + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + nonce: 1 + b94f5374fce5edbc8e2a8697c15331677e6ebf0b: + storage: + '0x00': 1 # STOP + '0x30': 1 # ADDRESS + '0x32': 1 # ORIGIN + '0x33': 1 # CALLER + '0x34': 1 # CALLVALUE + '0x36': 1 # CALLDATASIZE + '0x38': 1 # CODESIZE + '0x3a': 1 # GASPRICE + '0x3d': 1 # RETURNDATASIZE + '0x41': 1 # COINBASE + '0x42': 1 # TIMESTAMP + '0x43': 1 # NUMBER + '0x44': 1 # DIFFICULTY + '0x45': 1 # GASLIMIT + '0x46': 1 # CHAINID + '0x47': 1 # SELFBALANCE + '0x48': 0 # BASEFEE + '0x58': 1 # PC + '0x59': 1 # MSIZE + '0x5A': 1 # GAS + '0x5B': 1 # JUMPDEST + + '0x60': 1 # PUSHx ... + '0x61': 1 + '0x62': 1 + '0x63': 1 + '0x64': 1 + '0x65': 1 + '0x66': 1 + '0x67': 1 + '0x68': 1 + '0x69': 1 + '0x6a': 1 + '0x6b': 1 + '0x6c': 1 + '0x6d': 1 + '0x6e': 1 + '0x6f': 1 + '0x70': 1 + '0x71': 1 + '0x72': 1 + '0x73': 1 + '0x74': 1 + '0x75': 1 + '0x76': 1 + '0x77': 1 + '0x78': 1 + '0x79': 1 + '0x7a': 1 + '0x7b': 1 + '0x7c': 1 + '0x7d': 1 + '0x7e': 1 + '0x7f': 1 + + '0x100': 1 diff --git a/src-etc/GeneralStateTestsFiller/stChainId/chainIdFiller.json b/src-etc/GeneralStateTestsFiller/stChainId/chainIdFiller.json new file mode 100644 index 00000000000..1de95d34ce8 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stChainId/chainIdFiller.json @@ -0,0 +1,58 @@ +{ + "chainId": { + "env": { + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty": "0x20000", + "currentGasLimit": "10000000000", + "currentNumber": "1", + "currentTimestamp": "1000", + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "expect": [ + { + "network": [">ETC_Agharta"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "0x01": "0x3d" + } + } + } + }, + { + "network": ["<=ETC_Agharta"], + "result": { + "1000000000000000000000000000000000000000": { + "storage": { + "//comment" : "ChainID opcode is not defined", + "0x01": "0x00" + } + } + } + } + ], + "pre": { + "1000000000000000000000000000000000000000": { + "balance": "", + "code": "{ [[ 1 ]] (CHAINID) }", + "nonce": "0", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000000", + "code": "", + "nonce": "0", + "storage": {} + } + }, + "transaction": { + "data": ["0x"], + "gasLimit": ["100000000"], + "gasPrice": "10", + "nonce": "0", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to": "1000000000000000000000000000000000000000", + "value": ["0"] + } + } +} diff --git a/src-etc/GeneralStateTestsFiller/stEIP1559/typeTwoBerlinFiller.yml b/src-etc/GeneralStateTestsFiller/stEIP1559/typeTwoBerlinFiller.yml new file mode 100644 index 00000000000..260932f889d --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stEIP1559/typeTwoBerlinFiller.yml @@ -0,0 +1,57 @@ +typeTwoBerlin: + _info: + comment: Ori Pomerantz qbzzt1@gmail.com + + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: 0x20000 + currentGasLimit: 0xFF112233445566 + currentNumber: 1 + currentTimestamp: 1000 + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + currentBaseFee: 1000 + + + pre: + cccccccccccccccccccccccccccccccccccccccc: + balance: '1000000000000000000' + code: | + :yul { + sstore(0, add(1,1)) + } + nonce: '0' + storage: {} + + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '0x' + nonce: 1 + storage: {} + + + transaction: + data: + - data: :label declaredKeyWrite :raw 0x00 + accessList: [] + maxFeePerGas: 1000 + maxPriorityFeePerGas: 1000 + gasLimit: + - '400000' + nonce: 1 + to: cccccccccccccccccccccccccccccccccccccccc + value: + - '100000' + secretKey: "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8" + + + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + + network: + - '>=Frontier' + expectException: + '>=Frontier': TR_TypeNotSupported + result: {} diff --git a/src-etc/GeneralStateTestsFiller/stEIP2930/coinbaseT2Filler.yml b/src-etc/GeneralStateTestsFiller/stEIP2930/coinbaseT2Filler.yml new file mode 100644 index 00000000000..76bcd676887 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stEIP2930/coinbaseT2Filler.yml @@ -0,0 +1,113 @@ +# Check the costs of transferring gas to coinbase and how it interacts with the +# access list in transaction type 2 + +coinbaseT2: + env: + currentCoinbase: 000000000000000000000000000000000000BA5E + currentDifficulty: '0x20000' + currentGasLimit: '0xFF112233445566' + currentNumber: '1' + currentTimestamp: '1000' + currentBaseFee: 100 + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + + + + _info: + comment: Ori Pomerantz qbzzt1@gmail.com + + + pre: + # Send wei to coinbase and see how much gas that costs. + 000000000000000000000000000000000000C0DE: + balance: '1000000000000000000' + code: | + :yul { + mstore(0, gas()) + pop(call(gas(), 0xBA5E, 1000000, 0, 0, 0, 0)) + mstore(0x20, gas()) + + // The 24 is the cost of twi gas(), seven pushes(), a pop(), and an mstore() + sstore(0, sub(sub(mload(0), mload(0x20)),33)) + } + nonce: 1 + storage: {} + + + # Signer + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: 0x + nonce: 1 + storage: {} + + + # Coinbase + 000000000000000000000000000000000000BA5E: + balance: 0 + code: 0x + nonce: 1 + storage: {} + + + + transaction: + data: + # Type 2 transaction, base in list + - data: :label T2baseInList :abi f(uint) 0 + accessList: + - address: 0x000000000000000000000000000000000000BA5E + storageKeys: [] + + + # Type 2 transaction, base NOT in list + - data: :label T2baseNotInList :abi f(uint) 0 + accessList: + - address: 0x000000000000000000000000000000000000BA5A + storageKeys: [] + + gasLimit: + - 40000000 + maxFeePerGas: 10000 + maxPriorityFeePerGas: 100 + nonce: 1 + secretKey: 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 + to: 000000000000000000000000000000000000C0DE + value: + - 0 + + + + + + + + + expect: + + - indexes: + data: :label T2baseInList + gas: !!int -1 + value: !!int -1 + network: + - ">=ETC_Mystique" + expectException: + ">=ETC_Mystique" : "TR_TypeNotSupported" + result: + 000000000000000000000000000000000000C0DE: + storage: + 0x00: 0 + + + - indexes: + data: :label T2baseNotInList + gas: !!int -1 + value: !!int -1 + network: + - ">=ETC_Mystique" + expectException: + ">=ETC_Mystique" : "TR_TypeNotSupported" + result: + 000000000000000000000000000000000000C0DE: + storage: + 0x00: 0 diff --git a/src-etc/GeneralStateTestsFiller/stExample/basefeeExampleFiller.yml b/src-etc/GeneralStateTestsFiller/stExample/basefeeExampleFiller.yml new file mode 100644 index 00000000000..4623f9371f7 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stExample/basefeeExampleFiller.yml @@ -0,0 +1,62 @@ +basefeeExample: + _info: + comment: A test shows basefee transaction example + + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: 0x20000 + currentNumber: 1 + currentTimestamp: 1000 + currentGasLimit: 0x1000000000 + currentBaseFee: 70000000 + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + + network: + - '>=Frontier' + result: {} + expectException: + '>=Frontier': TR_TypeNotSupported + + pre: + 095e7baea6a6c7c4c2dfeb977efac326af552d87: + balance: '1000000000000000000' + code: | + { + ; Can also add lll style comments here + [[0]] (ADD 1 1) + } + nonce: '0' + storage: {} + + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '0x' + nonce: '0' + storage: {} + + + transaction: + data: + - data: :label declaredKeyWrite :raw 0x00 + accessList: + - address: 0x095e7baea6a6c7c4c2dfeb977efac326af552d87 + storageKeys: + - 0x00 + - 0x01 + + maxFeePerGas: '0x12A05F200' + maxPriorityFeePerGas: '2' + gasLimit: + - '4000000' + nonce: '0' + to: 095e7baea6a6c7c4c2dfeb977efac326af552d87 + value: + - '100000' + secretKey: "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8" + diff --git a/src-etc/GeneralStateTestsFiller/stExample/eip1559Filler.yml b/src-etc/GeneralStateTestsFiller/stExample/eip1559Filler.yml new file mode 100644 index 00000000000..f9edfbae236 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stExample/eip1559Filler.yml @@ -0,0 +1,66 @@ +eip1559: + _info: + comment: Ori Pomerantz qbzzt1@gmail.com + + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: 0x20000 + currentNumber: 1 + currentTimestamp: 1000 + currentGasLimit: 0x1000000 + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + + # New in London because of EIP1559 + currentBaseFee: 1000 + + pre: + cccccccccccccccccccccccccccccccccccccccc: + balance: '1000000000000000000' + code: | + { + (sstore 0 (gasprice)) + (sstore 1 (basefee)) + } + nonce: 1 + storage: {} + + + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '0x' + nonce: 1 + storage: {} + + + transaction: + data: + - data: :raw 0x00 + accessList: + - address: 0xcccccccccccccccccccccccccccccccccccccccc + storageKeys: + - 0x00 + - 0x01 + gasLimit: + - 4000000 + nonce: 1 + to: cccccccccccccccccccccccccccccccccccccccc + value: + - 0 + secretKey: "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8" + + # New in London because of EIP 1559 + maxPriorityFeePerGas: 10 + maxFeePerGas: 2000 + + + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + + network: + - '>=Frontier' + result: {} + expectException: + '>=Frontier': TR_TypeNotSupported diff --git a/src-etc/GeneralStateTestsFiller/stExample/mergeTestFiller.yml b/src-etc/GeneralStateTestsFiller/stExample/mergeTestFiller.yml new file mode 100644 index 00000000000..67468d32f26 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stExample/mergeTestFiller.yml @@ -0,0 +1,62 @@ +mergeTest: + _info: + comment: Example of PoS merge state test + + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentNumber: 1 + currentTimestamp: 1000 + currentGasLimit: 0x1000000 + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + currentBaseFee: 1000 + currentRandom: 0x1500000000000000000000000000000000000000000000000000000000000000 + + pre: + cccccccccccccccccccccccccccccccccccccccc: + balance: '1000000000000000000' + code: | + { + (sstore 0 (gasprice)) + (sstore 1 (basefee)) + (sstore 2 (difficulty)) + } + nonce: 1 + storage: {} + + + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '1000000000000000000' + code: '0x' + nonce: 1 + storage: {} + + + transaction: + data: + - data: :raw 0x00 + accessList: + - address: 0xcccccccccccccccccccccccccccccccccccccccc + storageKeys: + - 0x00 + - 0x01 + gasLimit: + - 4000000 + nonce: 1 + to: cccccccccccccccccccccccccccccccccccccccc + value: + - 0 + secretKey: "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8" + + # New in London because of EIP 1559 + maxPriorityFeePerGas: 10 + maxFeePerGas: 2000 + + + expect: + - network: + - '>=ETC_Mystique' + expectException: + '>=ETC_Mystique': TR_TypeNotSupported + result: + cccccccccccccccccccccccccccccccccccccccc: + nonce: 1 diff --git a/src-etc/GeneralStateTestsFiller/stSStoreTest/sstoreGasFiller.yml b/src-etc/GeneralStateTestsFiller/stSStoreTest/sstoreGasFiller.yml new file mode 100644 index 00000000000..eebd7e63790 --- /dev/null +++ b/src-etc/GeneralStateTestsFiller/stSStoreTest/sstoreGasFiller.yml @@ -0,0 +1,191 @@ +# Check the gas cost of sstore in different circumstances + +sstoreGas: + _info: + comment: Ori Pomerantz qbzzt1@gmail.com + + env: + currentCoinbase: 2adc25665018aa1fe0e6bc666dac8fc2697ff9ba + currentDifficulty: '0x20000' + currentGasLimit: "100000000" + currentNumber: "1" + currentTimestamp: "1000" + previousHash: 5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6 + + + pre: + + + cccccccccccccccccccccccccccccccccccccccc: + balance: '0x0ba1a9ce0ba1a9ce' + code: | + :yul + { + // Use storage of 0x1000 and above for gas figures + let storageLoc := 0x1000 + + // Gas spent on the measurement (two PUSHs, GAS, and SWAPs as + // needed for the variables) + let measureGas := 13 + + let gas0, gas1 + + // Cold storage, non-zero to non-zero + gas0 := gas() + sstore(0, 0xBEEF) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Warm storage, non-zero to non-zero + gas0 := gas() + sstore(0, 0xDEADBEEF) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Warm storage, non-zero to zero + gas0 := gas() + sstore(0, 0) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Warm storage, zero to zero + gas0 := gas() + sstore(0, 0) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Warm storage, zero to non-zero + gas0 := gas() + sstore(0, 0x1234) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Cold storage, non-zero to zero + gas0 := gas() + sstore(1, 0) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Cold storage, zero to non-zero + gas0 := gas() + sstore(2, 0x60A7) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Cold storage, zero to zero + gas0 := gas() + sstore(3, 0) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Warm storage, zero to non-zero (cell started as zero) + gas0 := gas() + sstore(3, 0x60A7) + gas1 := gas() + sstore(storageLoc, sub(sub(gas0, gas1), measureGas)) + storageLoc := add(storageLoc, 1) + + // Cleanup + sstore(0, 0) + sstore(1, 0) + sstore(2, 0) + sstore(3, 0) + } + nonce: 1 + storage: + 0: 0x60A7 + 1: 0x60A7 + + a94f5374fce5edbc8e2a8697c15331677e6ebf0b: + balance: '0x0ba1a9ce0ba1a9ce' + code: '0x' + nonce: 1 + storage: {} + + + transaction: + data: + - 0x + gasLimit: + - 80000000 + gasPrice: 10 + nonce: 1 + to: cccccccccccccccccccccccccccccccccccccccc + value: + - 0 + secretKey: '45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8' + + + + expect: + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + + network: + - '>=ETC_Magneto' + result: + cccccccccccccccccccccccccccccccccccccccc: + storage: + 0x1000: 5000 # Non zero to non zero, cold storage + 0x1001: 100 # Non zero to non zero, warm storage + 0x1002: 100 # Non zero to zero, warm storage + 0x1003: 100 # Zero to zero, warm storage + 0x1004: 100 # Zero to non zero, warm storage + 0x1005: 5000 # Non zero to zero, cold storage + 0x1006: 22100 # Zero to non zero, cold storage + 0x1007: 2200 # Zero to zero, cold storage + 0x1008: 20000 # Zero to non-zero, warm storage that started as zero + + + + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + + network: + - ETC_Phoenix + result: + cccccccccccccccccccccccccccccccccccccccc: + storage: + 0x1000: 5000 # Non zero to non zero, cold storage + 0x1001: 800 # Non zero to non zero, warm storage + 0x1002: 800 # Non zero to zero, warm storage + 0x1003: 800 # Zero to zero, warm storage + 0x1004: 800 # Zero to non zero, warm storage + 0x1005: 5000 # Non zero to zero, cold storage + 0x1006: 20000 # Zero to non zero, cold storage + 0x1007: 800 # Zero to zero, cold storage + 0x1008: 20000 # Zero to non-zero, warm storage that started as zero + + + + - indexes: + data: !!int -1 + gas: !!int -1 + value: !!int -1 + + network: + - ETC_Agharta + result: + cccccccccccccccccccccccccccccccccccccccc: + storage: + 0x1000: 5000 # Non zero to non zero, cold storage + 0x1001: 5000 # Non zero to non zero, warm storage + 0x1002: 5000 # Non zero to zero, warm storage + 0x1003: 5000 # Zero to zero, warm storage + 0x1004: 20000 # Zero to non zero, warm storage + 0x1005: 5000 # Non zero to zero, cold storage + 0x1006: 20000 # Zero to non zero, cold storage + 0x1007: 5000 # Zero to zero, cold storage + 0x1008: 20000 # Zero to non-zero, warm storage that started as zero From c33e1e7fe5e4ef078025547fb9775ba718fa3279 Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Mon, 21 Nov 2022 15:24:17 +0100 Subject: [PATCH 3/7] optimize makeetc script --- makeetc.sh | 95 +++++++++++++++++------------------------------------- 1 file changed, 29 insertions(+), 66 deletions(-) diff --git a/makeetc.sh b/makeetc.sh index 583471f5520..12a6db57aef 100755 --- a/makeetc.sh +++ b/makeetc.sh @@ -1,74 +1,37 @@ #!/bin/bash echo "Translate all known forks to ETC style forks..." -sleep 2 +declare -A forkMap=( ["Byzantium"]="ETC_Atlantis" + ["Istanbul"]="ETC_Phoenix" + ["ConstantinopleFix"]="ETC_Agharta" + ["Berlin"]="ETC_Magneto" + ["London"]="ETC_Mystique" + ["Merge"]="ETC_Mystique") + +function replaceFork() { + infile=$1 + ethfork=$2 + etcfork=$3 + if [[ "$infile" == *".yml"* ]]; then + sed -i -e 's/- '$ethfork'/- '$etcfork'/g' $infile + sed -i -e 's/\x27'$ethfork'/\x27'$etcfork'/g' $infile + sed -i -e 's/ '$ethfork':/ '$etcfork':/g' $infile + fi + + sed -i -e 's/\"'$ethfork'/\"'$etcfork'/g' $infile + sed -i -e 's/='$ethfork'/='$etcfork'/g' $infile + sed -i -e 's/>'$ethfork'/>'$etcfork'/g' $infile + sed -i -e 's/<'$ethfork'/<'$etcfork'/g' $infile +} function translateFile() { - if [[ "$1" == *".yml"* ]]; then - sed -i -e 's/- Byzantium/- ETC_Atlantis/g' $1 - sed -i -e 's/\x27Byzantium/\x27ETC_Atlantis/g' $1 - sed -i -e 's/ Byzantium:/ ETC_Atlantis:/g' $1 - - sed -i -e 's/- Istanbul/- ETC_Phoenix/g' $1 - sed -i -e 's/\x27Istanbul/\x27ETC_Phoenix/g' $1 - sed -i -e 's/ Istanbul:/ ETC_Phoenix:/g' $1 - - sed -i -e 's/- ConstantinopleFix/- ETC_Agharta/g' $1 - sed -i -e 's/\x27ConstantinopleFix/\x27ETC_Agharta/g' $1 - sed -i -e 's/ ConstantinopleFix:/ ETC_Agharta:/g' $1 - - sed -i -e 's/- Constantinople/- ETC_Agharta/g' $1 - sed -i -e 's/\x27Constantinople/\x27ETC_Agharta/g' $1 - sed -i -e 's/ Constantinople:/ ETC_Agharta:/g' $1 - - sed -i -e 's/- Berlin/- ETC_Magneto/g' $1 - sed -i -e 's/\x27Berlin/\x27ETC_Magneto/g' $1 - sed -i -e 's/ Berlin:/ ETC_Magneto:/g' $1 - - sed -i -e 's/- London/- ETC_Mystique/g' $1 - sed -i -e 's/\x27London/\x27ETC_Mystique/g' $1 - sed -i -e 's/ London:/ ETC_Mystique:/g' $1 - - - sed -i -e 's/- Merge/- ETC_Mystique/g' $1 - sed -i -e 's/\x27Merge/\x27ETC_Mystique/g' $1 - sed -i -e 's/ Merge:/ ETC_Mystique:/g' $1 - fi - - sed -i -e 's/\"Byzantium/\"ETC_Atlantis/g' $1 - sed -i -e 's/=Byzantium/=ETC_Atlantis/g' $1 - sed -i -e 's/>Byzantium/>ETC_Atlantis/g' $1 - sed -i -e 's/Istanbul/>ETC_Phoenix/g' $1 - sed -i -e 's/ConstantinopleFix/>ETC_Agharta/g' $1 - sed -i -e 's/Constantinople/>ETC_Agharta/g' $1 - sed -i -e 's/Berlin/>ETC_Magneto/g' $1 - sed -i -e 's/London/>ETC_Mystique/g' $1 - sed -i -e 's/Merge/>ETC_Mystique/g' $1 - sed -i -e 's/ Date: Thu, 1 Dec 2022 12:08:07 +0100 Subject: [PATCH 4/7] clean stExpectSection (retesteth unittest, London/Merge header convertion) --- makeetc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/makeetc.sh b/makeetc.sh index 12a6db57aef..b4613ae7864 100755 --- a/makeetc.sh +++ b/makeetc.sh @@ -71,6 +71,7 @@ etcpatch "GeneralStateTestsFiller/stSStoreTest" etcpatch "GeneralStateTestsFiller/stExample" etcclean "src/GeneralStateTestsFiller/stEIP1559" +etcclean "src/GeneralStateTestsFiller/stExpectSection" etcclean "GeneralStateTests/stEIP1559" etcclean "BlockchainTests/GeneralStateTests/stEIP1559" etcpatch "GeneralStateTestsFiller/stEIP1559" From 99a785c30111a546fb301f37c2ba6d8fc388765c Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Fri, 10 Feb 2023 14:38:18 +0100 Subject: [PATCH 5/7] disable EIPTests --- makeetc.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/makeetc.sh b/makeetc.sh index b4613ae7864..1ee0c3656c6 100755 --- a/makeetc.sh +++ b/makeetc.sh @@ -70,8 +70,12 @@ etcpatch "GeneralStateTestsFiller/stEIP2930" etcpatch "GeneralStateTestsFiller/stSStoreTest" etcpatch "GeneralStateTestsFiller/stExample" -etcclean "src/GeneralStateTestsFiller/stEIP1559" -etcclean "src/GeneralStateTestsFiller/stExpectSection" etcclean "GeneralStateTests/stEIP1559" etcclean "BlockchainTests/GeneralStateTests/stEIP1559" +etcclean "src/GeneralStateTestsFiller/stEIP1559" +etcclean "src/GeneralStateTestsFiller/stExpectSection" +etcclean "src/GeneralStateTestsFiller/EIPTests" +etcclean "src/BlockchainTestsFiller/EIPTests" + etcpatch "GeneralStateTestsFiller/stEIP1559" + From 1f4e8c75fe9475ba59f991d7b9882b6672b2e434 Mon Sep 17 00:00:00 2001 From: Dimitry Kh Date: Wed, 24 May 2023 15:34:39 +0200 Subject: [PATCH 6/7] add Shanghai --- makeetc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makeetc.sh b/makeetc.sh index 1ee0c3656c6..fb2737b75a4 100755 --- a/makeetc.sh +++ b/makeetc.sh @@ -6,7 +6,8 @@ declare -A forkMap=( ["Byzantium"]="ETC_Atlantis" ["ConstantinopleFix"]="ETC_Agharta" ["Berlin"]="ETC_Magneto" ["London"]="ETC_Mystique" - ["Merge"]="ETC_Mystique") + ["Merge"]="ETC_Mystique" + ["Shanghai"]="ETC_Mystique") function replaceFork() { infile=$1 From c443812c645059d7986c8b394f58ad1109c1f4e8 Mon Sep 17 00:00:00 2001 From: winsvega Date: Fri, 26 May 2023 16:36:44 +0200 Subject: [PATCH 7/7] Update makeetc.sh unique forknames --- makeetc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makeetc.sh b/makeetc.sh index fb2737b75a4..b8a50640f70 100755 --- a/makeetc.sh +++ b/makeetc.sh @@ -6,8 +6,8 @@ declare -A forkMap=( ["Byzantium"]="ETC_Atlantis" ["ConstantinopleFix"]="ETC_Agharta" ["Berlin"]="ETC_Magneto" ["London"]="ETC_Mystique" - ["Merge"]="ETC_Mystique" - ["Shanghai"]="ETC_Mystique") + ["Merge"]="ETC_Mystique2" + ["Shanghai"]="ETC_Mystique3") function replaceFork() { infile=$1