fix shr and shl gasCost

This commit is contained in:
andri lim 2019-05-07 11:13:09 +07:00 committed by zah
parent 956a51c2ed
commit 51edbe6390
3 changed files with 26 additions and 52 deletions

View File

@ -1777,30 +1777,30 @@ OK: 5/29 Fail: 0/29 Skip: 24/29
+ sar_2^256-1_255.json OK
+ sar_2^256-1_256.json OK
shiftCombinations.json Skip
shl01-0100.json Skip
shl01-0101.json Skip
shl01-ff.json Skip
shl01.json Skip
shl10.json Skip
shl11.json Skip
shl_-1_0.json Skip
shl_-1_1.json Skip
shl_-1_255.json Skip
shl_-1_256.json Skip
shl_2^255-1_1.json Skip
shr01.json Skip
shr10.json Skip
shr11.json Skip
shr_-1_0.json Skip
shr_-1_1.json Skip
shr_-1_255.json Skip
shr_-1_256.json Skip
shr_2^255_1.json Skip
shr_2^255_255.json Skip
shr_2^255_256.json Skip
shr_2^255_257.json Skip
+ shl01-0100.json OK
+ shl01-0101.json OK
+ shl01-ff.json OK
+ shl01.json OK
+ shl10.json OK
+ shl11.json OK
+ shl_-1_0.json OK
+ shl_-1_1.json OK
+ shl_-1_255.json OK
+ shl_-1_256.json OK
+ shl_2^255-1_1.json OK
+ shr01.json OK
+ shr10.json OK
+ shr11.json OK
+ shr_-1_0.json OK
+ shr_-1_1.json OK
+ shr_-1_255.json OK
+ shr_-1_256.json OK
+ shr_2^255_1.json OK
+ shr_2^255_255.json OK
+ shr_2^255_256.json OK
+ shr_2^255_257.json OK
```
OK: 18/41 Fail: 0/41 Skip: 23/41
OK: 40/41 Fail: 0/41 Skip: 1/41
## stSolidityTest
```diff
+ AmbiguousMethod.json OK
@ -2645,4 +2645,4 @@ OK: 133/133 Fail: 0/133 Skip: 0/133
OK: 130/130 Fail: 0/130 Skip: 0/130
---TOTAL---
OK: 2240/2447 Fail: 0/2447 Skip: 207/2447
OK: 2262/2447 Fail: 0/2447 Skip: 185/2447

View File

@ -49,7 +49,6 @@ type
GasSha3Word, # Paid for each word (rounded up) for input data to a SHA3 operation.
GasCopy, # Partial payment for COPY operations, multiplied by words copied, rounded up.
GasBlockhash, # Payment for BLOCKHASH operation.
GasArithmetic, # Payment for bitwise Shl and Shr operators
GasExtCodeHash # Payment for contract's code hashing
GasFeeSchedule = array[GasFeeKind, GasInt]
@ -406,8 +405,8 @@ template gasCosts(fork: Fork, prefix, ResultGasCostsName: untyped) =
Xor: fixed GasVeryLow,
Not: fixed GasVeryLow,
Byte: fixed GasVeryLow,
Shl: fixed GasArithmetic,
Shr: fixed GasArithmetic,
Shl: fixed GasVeryLow,
Shr: fixed GasVeryLow,
Sar: fixed GasVeryLow,
# 20s: SHA3
@ -582,7 +581,6 @@ const
GasSha3Word: 6,
GasCopy: 3,
GasBlockhash: 20,
GasArithmetic: 35,
GasExtCodeHash: 400
]

View File

@ -96,30 +96,6 @@ func allowedFailingGeneralStateTest*(folder, name: string): bool =
"returndatacopy_0_0_following_successful_create.json",
"returndatasize_following_successful_create.json",
"shl10.json",
"shl01.json",
"shl01-0101.json",
"shl01-0100.json",
"shl11.json",
"shl_-1_256.json",
"shl01-ff.json",
"shl_-1_1.json",
"shl_2^255-1_1.json",
"shl_-1_0.json",
"shl_-1_255.json",
"shr_-1_1.json",
"shr_2^255_255.json",
"shr10.json",
"shr_2^255_1.json",
"shr01.json",
"shr_2^255_256.json",
"shr_2^255_257.json",
"shr_-1_255.json",
"shr_-1_256.json",
"shr_-1_0.json",
"shr11.json",
# all these tests below actually pass
# but they are very slow
# byzantium slow