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
#170 highlights that using the upper-bound on share_adjustment when generating a random state causes a set of tests to fail:
test lp::math::tests::fuzz_calculate_net_curve_trade_safe
test lp::math::tests::fuzz_calculate_present_value
test long::max::tests::fuzz_sol_calculate_max_long
test short::open::tests::test_defaults_calculate_spot_price_after_short
After an initial inspection, @jalextowle concluded that at least the fuzz_sol_calculate_max_long, fuzz_calculate_present_value, and fuzz_calculate_net_curve_trade_safe failures indicate a discrepancy between Rust and Solidity.
We need to dig into each test and correct it or the underlying code it is testing.
The text was updated successfully, but these errors were encountered:
# Description
- share adjustment (zeta) was using a non-inclusive range, but the
requirement (`<=`) implies inclusive should be valid.
- I tested this with the bounds (`share_adjustment = 0` and
`share_adjustment = share_reserves - min_share_reserves -
fixed!(10e18)`) and all tests passed with both extremes
- note that I had to reduce the upper-bound by `fixed!(10e18)` for the
tests to pass, which I guess means we were just getting lucky before. I
made an issue for this:
#171
- dynamic fuzz is supposed to do 10x fuzz runs on new tests, but was 1x
with `FAST_FUZZ_RUNS`
- fix a check in an `open.rs` test where the allowable max bond amount
was too low
# Resolved Issues
working towards #171 and
#21
# Description
- The code for calculating pool deltas & state after opening a long did
not correctly account for the gov fee's impact on the share reserves. I
fixed this and added a test to demonstrate the failure
- I added a similar test on the short side, which almost passes with
equality (seems there is a rounding error)
- I renamed some functions, cleaned up some comments, fixed some typos
#170 highlights that using the upper-bound on
share_adjustment
when generating a random state causes a set of tests to fail:After an initial inspection, @jalextowle concluded that at least the
fuzz_sol_calculate_max_long
,fuzz_calculate_present_value
, andfuzz_calculate_net_curve_trade_safe
failures indicate a discrepancy between Rust and Solidity.We need to dig into each test and correct it or the underlying code it is testing.
The text was updated successfully, but these errors were encountered: