aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitry <dimitry@ethereum.org>2017-10-13 20:34:21 +0800
committerDimitry <dimitry@ethereum.org>2017-10-13 20:34:21 +0800
commit6e80effa947d9581e5ef8c4e02a45725f5af4346 (patch)
treeffd5b0bde30e78cf0957a40889980a3adbd0c5b6 /src
parentba6a35c1f3f2b992279f3072e5f983522a64a5c9 (diff)
downloaddexon-tests-6e80effa947d9581e5ef8c4e02a45725f5af4346.tar
dexon-tests-6e80effa947d9581e5ef8c4e02a45725f5af4346.tar.gz
dexon-tests-6e80effa947d9581e5ef8c4e02a45725f5af4346.tar.bz2
dexon-tests-6e80effa947d9581e5ef8c4e02a45725f5af4346.tar.lz
dexon-tests-6e80effa947d9581e5ef8c4e02a45725f5af4346.tar.xz
dexon-tests-6e80effa947d9581e5ef8c4e02a45725f5af4346.tar.zst
dexon-tests-6e80effa947d9581e5ef8c4e02a45725f5af4346.zip
modexp input test
Consensus big in Parity: gas calculation of modexp is subject to overflow for certain inputs. Found via manual review. A case was found where consensus issue could be achieved in ~500K gas.
Diffstat (limited to 'src')
-rw-r--r--src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g0v0Filler.json6
-rw-r--r--src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g1v0Filler.json6
-rw-r--r--src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g0v0Filler.json8
-rw-r--r--src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g1v0Filler.json6
-rw-r--r--src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d2g0v0Filler.json55
-rw-r--r--src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d2g1v0Filler.json55
-rw-r--r--src/GeneralStateTestsFiller/stPreCompiledContracts2/modexpRandomInputFiller.json24
7 files changed, 142 insertions, 18 deletions
diff --git a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g0v0Filler.json b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g0v0Filler.json
index c4c88cb72..7676c7b61 100644
--- a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g0v0Filler.json
+++ b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g0v0Filler.json
@@ -11,11 +11,11 @@
"transactions" : [
{
"data" : "0x00000000000000000000000000000000000000000000000000000000000000e300000000000000000000000000000000000000000000000000",
- "gasLimit" : "0x01adb0",
+ "gasLimit" : "0x0ad570",
"gasPrice" : "0x01",
"nonce" : "0x00",
- "r" : "0xf9207991cd3c80532e96a7d42ec3c587119e0b7d1a2efa9520e1a0a7679d24fe",
- "s" : "0x6878ac7c44e52d45931dba9f46af422795290550f3ce2b3c3699fc38bf5d01e3",
+ "r" : "0x41fd5511dbb403047bc5498f30d75f2dd2fdeac98a103807c31900eb17bc10ef",
+ "s" : "0x0bb0349ba6a48b040494133fba7cdcf86ab4ab130f0a570fea91569622e9612f",
"to" : "0x0000000000000000000000000000000000000005",
"v" : "0x1b",
"value" : "0x00"
diff --git a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g1v0Filler.json b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g1v0Filler.json
index 341d07329..99576447a 100644
--- a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g1v0Filler.json
+++ b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d0g1v0Filler.json
@@ -11,11 +11,11 @@
"transactions" : [
{
"data" : "0x00000000000000000000000000000000000000000000000000000000000000e300000000000000000000000000000000000000000000000000",
- "gasLimit" : "0x030d40",
+ "gasLimit" : "0x6acfc0",
"gasPrice" : "0x01",
"nonce" : "0x00",
- "r" : "0x9d6574ed8338a7a502721de6f4ea15756c0b4ceedc035d2d27123f2ebafbd3ad",
- "s" : "0x16fe50db6ffae05cf22d7253da75020d212a942ca3257c8de6981b5eb1fed118",
+ "r" : "0xb0f96af4a341d9a1346fdd37f633eb5017ff95d6312b4cbd7533a21dfecb3302",
+ "s" : "0x1b4b565910d9767b232e0d39d3bd997fa95a02093269bb15d22239d4135fefeb",
"to" : "0x0000000000000000000000000000000000000005",
"v" : "0x1c",
"value" : "0x00"
diff --git a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g0v0Filler.json b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g0v0Filler.json
index f60774e40..053cc4474 100644
--- a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g0v0Filler.json
+++ b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g0v0Filler.json
@@ -11,13 +11,13 @@
"transactions" : [
{
"data" : "0x00000000008000000000000000000000000000000000000000000000000000000000000400000000000000000000000a",
- "gasLimit" : "0x01adb0",
+ "gasLimit" : "0x0ad570",
"gasPrice" : "0x01",
"nonce" : "0x00",
- "r" : "0xae2d1d1f18f64abcf824eefb326271c7ebb264cc937d8113bb70f57131f00e32",
- "s" : "0x357aa48004b6fcd243d26f98e58da74e1066519306d464b01934089ca293b9be",
+ "r" : "0x7f92f6c87aa5aae5de02f4fef7b8625a4705dcc83101f5064e85d0451d6f7061",
+ "s" : "0x17646ae6179dc3564553aa73ff108c14e72d191c147bfa38b4885b7b88548c23",
"to" : "0x0000000000000000000000000000000000000005",
- "v" : "0x1c",
+ "v" : "0x1b",
"value" : "0x00"
}
],
diff --git a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g1v0Filler.json b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g1v0Filler.json
index 1782501ca..ad835e9a0 100644
--- a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g1v0Filler.json
+++ b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d1g1v0Filler.json
@@ -11,11 +11,11 @@
"transactions" : [
{
"data" : "0x00000000008000000000000000000000000000000000000000000000000000000000000400000000000000000000000a",
- "gasLimit" : "0x030d40",
+ "gasLimit" : "0x6acfc0",
"gasPrice" : "0x01",
"nonce" : "0x00",
- "r" : "0x49c4572c88fb154ace62e09d8ceebfd7df34d4a7642fbb418d4a1ef275960577",
- "s" : "0x21a786ac84b27576174ec3e3370e49d6b95ae5efad187ff5e78bad37b0161396",
+ "r" : "0x1146ab4d2425f6d4771a02c80223b8ba38e236b06b08062041b6d173137dac48",
+ "s" : "0x60be39d14b2fd099aaca849e4785dbc283612fb335239c3d37056afc9edfe998",
"to" : "0x0000000000000000000000000000000000000005",
"v" : "0x1b",
"value" : "0x00"
diff --git a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d2g0v0Filler.json b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d2g0v0Filler.json
new file mode 100644
index 000000000..3bf706dd8
--- /dev/null
+++ b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d2g0v0Filler.json
@@ -0,0 +1,55 @@
+{
+ "modexpRandomInput_d2g0v0" : {
+ "blocks" : [
+ {
+ "blockHeaderPremine" : {
+ "difficulty" : "0x020000",
+ "gasLimit" : "0x05f5e100",
+ "timestamp" : "0x03e8",
+ "updatePoW" : "1"
+ },
+ "transactions" : [
+ {
+ "data" : "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001147000000000000000000000000000000000000000000000000000000000061660350000000000000000000000000000000000000000000000000000000000000008",
+ "gasLimit" : "0x0ad570",
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "r" : "0xa61dd9f5a65cd90ee4caf2b2660743384f5777328b536d21851d94fc8bc17b7e",
+ "s" : "0x135b6e1801f3a2b34b301dd8667e859b58a4b876c7d506b242957a3b33e9f77d",
+ "to" : "0x0000000000000000000000000000000000000005",
+ "v" : "0x1c",
+ "value" : "0x00"
+ }
+ ],
+ "uncleHeaders" : [
+ ]
+ }
+ ],
+ "genesisBlockHeader" : {
+ "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "coinbase" : "3535353535353535353535353535353535353535",
+ "difficulty" : "131072",
+ "extraData" : "0x42",
+ "gasLimit" : "0x05f5e100",
+ "gasUsed" : "0",
+ "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "nonce" : "0x0102030405060708",
+ "number" : "0",
+ "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a",
+ "timestamp" : "0x03b6",
+ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+ },
+ "pre" : {
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0x3635c9adc5dea00000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d2g1v0Filler.json b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d2g1v0Filler.json
new file mode 100644
index 000000000..0c98bc0f4
--- /dev/null
+++ b/src/BlockchainTestsFiller/GeneralStateTests/stPreCompiledContracts2/modexpRandomInput_d2g1v0Filler.json
@@ -0,0 +1,55 @@
+{
+ "modexpRandomInput_d2g1v0" : {
+ "blocks" : [
+ {
+ "blockHeaderPremine" : {
+ "difficulty" : "0x020000",
+ "gasLimit" : "0x05f5e100",
+ "timestamp" : "0x03e8",
+ "updatePoW" : "1"
+ },
+ "transactions" : [
+ {
+ "data" : "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001147000000000000000000000000000000000000000000000000000000000061660350000000000000000000000000000000000000000000000000000000000000008",
+ "gasLimit" : "0x6acfc0",
+ "gasPrice" : "0x01",
+ "nonce" : "0x00",
+ "r" : "0xb37d77a66c3e92e5bc6ce02c5cf681dc209534afb388b763837cff9400b6a69b",
+ "s" : "0x08d5cbe47b56954f8a061cfe20c4144f5331587210444a3d0d8b6cbc21869c",
+ "to" : "0x0000000000000000000000000000000000000005",
+ "v" : "0x1b",
+ "value" : "0x00"
+ }
+ ],
+ "uncleHeaders" : [
+ ]
+ }
+ ],
+ "genesisBlockHeader" : {
+ "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+ "coinbase" : "3535353535353535353535353535353535353535",
+ "difficulty" : "131072",
+ "extraData" : "0x42",
+ "gasLimit" : "0x05f5e100",
+ "gasUsed" : "0",
+ "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "nonce" : "0x0102030405060708",
+ "number" : "0",
+ "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a",
+ "timestamp" : "0x03b6",
+ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+ "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+ },
+ "pre" : {
+ "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "0x3635c9adc5dea00000",
+ "code" : "",
+ "nonce" : "0x00",
+ "storage" : {
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/GeneralStateTestsFiller/stPreCompiledContracts2/modexpRandomInputFiller.json b/src/GeneralStateTestsFiller/stPreCompiledContracts2/modexpRandomInputFiller.json
index d520f3635..bc6f3057a 100644
--- a/src/GeneralStateTestsFiller/stPreCompiledContracts2/modexpRandomInputFiller.json
+++ b/src/GeneralStateTestsFiller/stPreCompiledContracts2/modexpRandomInputFiller.json
@@ -25,7 +25,7 @@
}
}
},
- {
+ {
"indexes" : {
"data" : 1,
"gas" : 0,
@@ -34,7 +34,20 @@
"network" : ["Byzantium"],
"result" : {
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
- "balance" : "999999999999999890000"
+ "balance" : "999999999999999290000"
+ }
+ }
+ },
+ {
+ "indexes" : {
+ "data" : 2,
+ "gas" : 1,
+ "value" : -1
+ },
+ "network" : ["Byzantium"],
+ "result" : {
+ "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+ "balance" : "999999999999993000000"
}
}
}
@@ -51,15 +64,16 @@
"transaction": {
"data": [
"0x00000000000000000000000000000000000000000000000000000000000000e300000000000000000000000000000000000000000000000000",
-"0x00000000008000000000000000000000000000000000000000000000000000000000000400000000000000000000000a"
+"0x00000000008000000000000000000000000000000000000000000000000000000000000400000000000000000000000a",
+"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001147000000000000000000000000000000000000000000000000000000000061660350000000000000000000000000000000000000000000000000000000000000008"
],
"gasLimit": [
- "110000", "200000"
+ "710000", "7000000"
],
"gasPrice": "1",
"nonce": "0",
"secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
- "to": "0x0000000000000000000000000000000000000005",
+ "to": "0x0000000000000000000000000000000000000005",
"value": [
"0x"
]