Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #538 from ajsutton/memory-write-tests
Tests where data is copied to a memory range longer than the data itself
- Loading branch information
Showing
16 changed files
with
4,033 additions
and
0 deletions.
There are no files selected for viewing
740 changes: 740 additions & 0 deletions
740
...ts/GeneralStateTests/stCodeCopyTest/ExtCodeCopyTargetRangeLongerThanCodeTests_d0g0v0.json
Large diffs are not rendered by default.
Oops, something went wrong.
677 changes: 677 additions & 0 deletions
677
...Tests/GeneralStateTests/stPreCompiledContracts2/CallEcrecoverInvalidSignature_d0g0v0.json
Large diffs are not rendered by default.
Oops, something went wrong.
677 changes: 677 additions & 0 deletions
677
...Tests/GeneralStateTests/stPreCompiledContracts2/CallEcrecoverUnrecoverableKey_d0g0v0.json
Large diffs are not rendered by default.
Oops, something went wrong.
677 changes: 677 additions & 0 deletions
677
...neralStateTests/stPreCompiledContracts2/CallIdentity_6_inputShorterThanOutput_d0g0v0.json
Large diffs are not rendered by default.
Oops, something went wrong.
125 changes: 125 additions & 0 deletions
125
GeneralStateTests/stCodeCopyTest/ExtCodeCopyTargetRangeLongerThanCodeTests.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"ExtCodeCopyTargetRangeLongerThanCodeTests" : { | ||
"_info" : { | ||
"comment" : "Uses EXTCODECOPY to copy 32 bytes of code into a 64 byte range of memory and ensures that the last 32 bytes of the memory range are zeroed out", | ||
"filledwith" : "testeth 1.5.0-alpha.5-3+commit.9c4db26c", | ||
"lllcversion" : "Version: 0.5.0-develop.2018.9.29+commit.c4b5101b.Darwin.appleclang", | ||
"source" : "src/GeneralStateTestsFiller/stCodeCopyTest/ExtCodeCopyTargetRangeLongerThanCodeTestsFiller.json", | ||
"sourceHash" : "f18e3887da90c5b18497a754982425e913c8cf0df1cfac2ec0256809d6339041" | ||
}, | ||
"env" : { | ||
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", | ||
"currentDifficulty" : "0x020000", | ||
"currentGasLimit" : "0x7fffffffffffffff", | ||
"currentNumber" : "0x28d138", | ||
"currentTimestamp" : "0x03e8", | ||
"previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" | ||
}, | ||
"post" : { | ||
"Byzantium" : [ | ||
{ | ||
"hash" : "0x30610221e70d7a02d1556b926275c2665354a648402d17156e82fbe7a856a785", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Constantinople" : [ | ||
{ | ||
"hash" : "0x8c59709f11546ec8208d20bc9b57d2b2942734c79f7465277d79c22bf9c81a17", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"EIP150" : [ | ||
{ | ||
"hash" : "0x30610221e70d7a02d1556b926275c2665354a648402d17156e82fbe7a856a785", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"EIP158" : [ | ||
{ | ||
"hash" : "0x30610221e70d7a02d1556b926275c2665354a648402d17156e82fbe7a856a785", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Frontier" : [ | ||
{ | ||
"hash" : "0x1a33bec32c521827b0efcb18d8a7e40eb525eef4c7d465ca093a77352559c11b", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Homestead" : [ | ||
{ | ||
"hash" : "0x1a33bec32c521827b0efcb18d8a7e40eb525eef4c7d465ca093a77352559c11b", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
] | ||
}, | ||
"pre" : { | ||
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { | ||
"balance" : "0xffffffffffffffffffffffffffffffff", | ||
"code" : "", | ||
"nonce" : "0x00", | ||
"storage" : { | ||
} | ||
}, | ||
"0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b" : { | ||
"balance" : "0x1b58", | ||
"code" : "0x61123460205260406000600073eeef5374fce5edbc8e2a8697c15331677e6ebf0b3c60005160005560205160015561567860605260406000604073a94f5374fce5edbc8e2a8697c15331677e6ebf0b3c604051600255606051600355", | ||
"nonce" : "0x00", | ||
"storage" : { | ||
} | ||
}, | ||
"0xeeef5374fce5edbc8e2a8697c15331677e6ebf0b" : { | ||
"balance" : "0x00", | ||
"code" : "0x1122334455667788991011121314151617181920212223242526272829303132", | ||
"nonce" : "0x01", | ||
"storage" : { | ||
} | ||
} | ||
}, | ||
"transaction" : { | ||
"data" : [ | ||
"0x" | ||
], | ||
"gasLimit" : [ | ||
"0x061a80" | ||
], | ||
"gasPrice" : "0x01", | ||
"nonce" : "0x00", | ||
"secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", | ||
"to" : "0xaaaf5374fce5edbc8e2a8697c15331677e6ebf0b", | ||
"value" : [ | ||
"0x00" | ||
] | ||
} | ||
} | ||
} |
118 changes: 118 additions & 0 deletions
118
GeneralStateTests/stPreCompiledContracts2/CallEcrecoverInvalidSignature.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"CallEcrecoverInvalidSignature" : { | ||
"_info" : { | ||
"comment" : "CALL to ECREC precompile with input which is a completely invalid signature and a 32 byte output range in memory. ECREC should return an empty response and the 32 byte output range should be left unchanged.", | ||
"filledwith" : "testeth 1.5.0-alpha.5-3+commit.9c4db26c", | ||
"lllcversion" : "Version: 0.5.0-develop.2018.9.29+commit.c4b5101b.Darwin.appleclang", | ||
"source" : "src/GeneralStateTestsFiller/stPreCompiledContracts2/CallEcrecoverInvalidSignatureFiller.json", | ||
"sourceHash" : "0c4766b334540da6fb7c3074b2f58916a5b372f569bd5ae39cea7a563f3415d4" | ||
}, | ||
"env" : { | ||
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", | ||
"currentDifficulty" : "0x20000", | ||
"currentGasLimit" : "0x989680", | ||
"currentNumber" : "0x01", | ||
"currentTimestamp" : "0x03e8", | ||
"previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" | ||
}, | ||
"post" : { | ||
"Byzantium" : [ | ||
{ | ||
"hash" : "0x9ee49fbe5b14e1e6cb43aa76ba9fc2d47990d17e99bb6b1d3c5492f49f1f2bb3", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Constantinople" : [ | ||
{ | ||
"hash" : "0x9ee49fbe5b14e1e6cb43aa76ba9fc2d47990d17e99bb6b1d3c5492f49f1f2bb3", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"EIP150" : [ | ||
{ | ||
"hash" : "0x9493e6f93663fac8862d4d41657b7b464bd6505ab0cc37560ea19fc835048cca", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"EIP158" : [ | ||
{ | ||
"hash" : "0x9ee49fbe5b14e1e6cb43aa76ba9fc2d47990d17e99bb6b1d3c5492f49f1f2bb3", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Frontier" : [ | ||
{ | ||
"hash" : "0xbf17d0546e6fc734455768b418c74d30885da7ac8c4d52097a23f3e9dbfc53de", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Homestead" : [ | ||
{ | ||
"hash" : "0xbf17d0546e6fc734455768b418c74d30885da7ac8c4d52097a23f3e9dbfc53de", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
] | ||
}, | ||
"pre" : { | ||
"0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { | ||
"balance" : "0x01312d00", | ||
"code" : "0x7f1122334455667788991011121314151617181920212223242526272829303132608052602060806080600060006001620493e0f150608051600055", | ||
"nonce" : "0x00", | ||
"storage" : { | ||
} | ||
}, | ||
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { | ||
"balance" : "0x0de0b6b3a7640000", | ||
"code" : "", | ||
"nonce" : "0x00", | ||
"storage" : { | ||
} | ||
} | ||
}, | ||
"transaction" : { | ||
"data" : [ | ||
"0x" | ||
], | ||
"gasLimit" : [ | ||
"0x37ba90" | ||
], | ||
"gasPrice" : "0x01", | ||
"nonce" : "0x00", | ||
"secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", | ||
"to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", | ||
"value" : [ | ||
"0x0186a0" | ||
] | ||
} | ||
} | ||
} |
118 changes: 118 additions & 0 deletions
118
GeneralStateTests/stPreCompiledContracts2/CallEcrecoverUnrecoverableKey.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"CallEcrecoverUnrecoverableKey" : { | ||
"_info" : { | ||
"comment" : "CALL to ECREC precompile with input that has a valid signature structure but that does not recover a valid key. Specifies a 32 byte output range in memory. ECREC should return an empty response and the 32 byte output range should be left unchanged.", | ||
"filledwith" : "testeth 1.5.0-alpha.5-3+commit.9c4db26c", | ||
"lllcversion" : "Version: 0.5.0-develop.2018.9.29+commit.c4b5101b.Darwin.appleclang", | ||
"source" : "src/GeneralStateTestsFiller/stPreCompiledContracts2/CallEcrecoverUnrecoverableKeyFiller.json", | ||
"sourceHash" : "8f7d5de0d10cd62354a083430d132f8dfe9b497013294f3b5b1442bc7b8cfb54" | ||
}, | ||
"env" : { | ||
"currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", | ||
"currentDifficulty" : "0x20000", | ||
"currentGasLimit" : "0x989680", | ||
"currentNumber" : "0x01", | ||
"currentTimestamp" : "0x03e8", | ||
"previousHash" : "0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" | ||
}, | ||
"post" : { | ||
"Byzantium" : [ | ||
{ | ||
"hash" : "0xb332e922800f4c7a600185a7c0f822f908eed115edd53fe95486c96afb0e30fd", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Constantinople" : [ | ||
{ | ||
"hash" : "0xb332e922800f4c7a600185a7c0f822f908eed115edd53fe95486c96afb0e30fd", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"EIP150" : [ | ||
{ | ||
"hash" : "0xafc696f31fc3b84b00711c870ae62269eb8e704eb73b33ddd62589d746783d29", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"EIP158" : [ | ||
{ | ||
"hash" : "0xb332e922800f4c7a600185a7c0f822f908eed115edd53fe95486c96afb0e30fd", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Frontier" : [ | ||
{ | ||
"hash" : "0x2434c2b8d780aa3c78868fac0f0561b638961f6f70da057af72c4150d2edb761", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
], | ||
"Homestead" : [ | ||
{ | ||
"hash" : "0x2434c2b8d780aa3c78868fac0f0561b638961f6f70da057af72c4150d2edb761", | ||
"indexes" : { | ||
"data" : 0, | ||
"gas" : 0, | ||
"value" : 0 | ||
}, | ||
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" | ||
} | ||
] | ||
}, | ||
"pre" : { | ||
"0x095e7baea6a6c7c4c2dfeb977efac326af552d87" : { | ||
"balance" : "0x01312d00", | ||
"code" : "0x7fa8b53bdf3306a35a7103ab5504a0c9b492295564b6202b1942a84ef300107281600052601b6020527f30783565316530336635336365313862373732636362303039336666373166336040527f66353366356337356237346463623331613835616138623838393262346538626060527f1122334455667788991011121314151617181920212223242526272829303132608052602060806080600060006001620493e0f150608051600055", | ||
"nonce" : "0x00", | ||
"storage" : { | ||
} | ||
}, | ||
"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { | ||
"balance" : "0x0de0b6b3a7640000", | ||
"code" : "", | ||
"nonce" : "0x00", | ||
"storage" : { | ||
} | ||
} | ||
}, | ||
"transaction" : { | ||
"data" : [ | ||
"0x" | ||
], | ||
"gasLimit" : [ | ||
"0x37ba90" | ||
], | ||
"gasPrice" : "0x01", | ||
"nonce" : "0x00", | ||
"secretKey" : "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", | ||
"to" : "0x095e7baea6a6c7c4c2dfeb977efac326af552d87", | ||
"value" : [ | ||
"0x0186a0" | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.