You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A_MUL=10000*3**3MIN_A=int(0.01*A_MUL)
MAX_A=1000*A_MUL
...
# MIN_A and MAX_A have multiplied N**N * A_MUL.@given(A=strategy('uint256', min_value=MIN_A, max_value=MAX_A), ...)@settings(max_examples=MAX_SAMPLES)deftest_newton_y(crypto_math, A, D, xD, yD, zD, gamma, j):
...
try:
# A is already ANN now, shouldn't multiply N**N * A_MUL any more.result_contract=crypto_math.newton_y(A*3**3*10000, gamma, X, D, j)
exceptException:
...
Params given by strategy are always inappropriate to newton's method
For example, run test of newton_D(), strategy will give 50 sets of input data, may only a few of them fit. Most of them could not match the condition, causes the test cannot be performed effectively.
The main reason for improper test data is that yx or zx is too small, causes the xp in newton_D are very imbalanced. So the result of python simulation always fails to match the conditions.
@given(A=strategy('uint256', min_value=MIN_A, max_value=MAX_A),x=strategy('uint256', min_value=10**9, max_value=10**14*10**18), # 1e-9 USD to 100T USDyx=strategy('uint256', min_value=int(1.1e11), max_value=10**18), # <- ratio 1e18 * y/x, typically 1e18 * 1zx=strategy('uint256', min_value=int(1.1e11), max_value=10**18), # <- ratio 1e18 * z/x, typically 1e18 * 1perm=strategy('uint8', max_value=5), # Permutationgamma=strategy('uint256', min_value=MIN_GAMMA, max_value=MAX_GAMMA))@settings(max_examples=MAX_SAMPLES)deftest_newton_D(crypto_math, A, x, yx, zx, perm, gamma):
...
# Most of test data would not match the condition below.# Because the xps of the pool are very imbalanced.ifall(f>=1.1e16andf<=0.9e20forfin [_x*10**18/result_simfor_xinX]):
# Very few test data could reach hereresult_contract=crypto_math.newton_D(A, gamma, X)
newton_y() test case has the same problem.
The text was updated successfully, but these errors were encountered:
Wrong input params of
test_newton_y()
The parameters here need to be modified, from
A * 3**3 * 10000
toA
https://github.com/curvefi/curve-crypto-contract/blob/master/tests/tricrypto/test_math.py#L114
Params given by strategy are always inappropriate to newton's method
For example, run test of
newton_D()
, strategy will give 50 sets of input data, may only a few of them fit. Most of them could not match the condition, causes the test cannot be performed effectively.The main reason for improper test data is that
yx
orzx
is too small, causes the xp in newton_D are very imbalanced. So the result of python simulation always fails to match the conditions.newton_y()
test case has the same problem.The text was updated successfully, but these errors were encountered: