From 6e80effa947d9581e5ef8c4e02a45725f5af4346 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Fri, 13 Oct 2017 15:34:21 +0300 Subject: 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. --- .../modexpRandomInputFiller.json | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src/GeneralStateTestsFiller') 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" ] -- cgit v1.2.3