Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

FAILED tests/markets/collateral/ovl/test_build.py::test_build_oi_adjusted_min #133

Open
mesozoic-technology opened this issue Jan 7, 2022 · 3 comments

Comments

@mesozoic-technology
Copy link
Contributor

I do not quite recall the exact manifestation right now but this can happen in highly edge case scenarios.

It occurs with something in the impact calculations where the resulting power is infinitesimally small, or the impact is infinitesimally small.

Cataloguing here for future inquiry and debugging.


  Transaction: 0x4688678c4d9db75bf6d0ee7135cadf3c730e38ec3b944fbd824db1ab534af0ae
  Gas usage: 290592
  Block Number: 65
  Block Time: Tue Oct 05 2021 23:24:54 GMT-0400 (Eastern Daylight Time)
  Runtime Error: revert
  Revert reason: BAL#008

@mesozoic-technology
Copy link
Contributor Author

mesozoic-technology commented Jan 7, 2022

-- Docs: https://docs.pytest.org/en/stable/warnings.html
====================================== short test summary info =======================================
FAILED tests/markets/collateral/ovl/test_build.py::test_build_oi_adjusted_min[IOverlayV1OVLCollateral-IOverlayV1Market-create_mothership0]

Test specific failure parameters:

oi = 4.294342e+22
leverage = 1
is_long = False
lmbda = 0.5

@mesozoic-technology
Copy link
Contributor Author

Further explication of failing parameters:

start_time = 1633490693
oi = 5.14e+18
leverage = 2
is_long = False
lmbda = 0.5

Take note that these values of those parameters appear to be the results after they are treated once passed into the test from the fuzzing.

Originally, they are passed in like this:

    oi=514,
    leverage=2,
    is_long=False,
    lmbda=Decimal('0.5000000000'),

And then oi hits the line a few lines down from the start where it is raised by a factor of 1e16.

@mesozoic-technology
Copy link
Contributor Author

Entire error output for this second failed case here:

E       AssertionError: assert 5072686172975547856 ± 5.1e+12 == 5072693936401716224
E        +  where 5072686172975547856 ± 5.1e+12 = approx(5072686172975547856)
E        +    where 5072686172975547856 = <ContractCall 'balanceOf(address account, uint256 id)'>(<Account '0x8e8b3e19717A5DDCfccce9Bf3b225E61efDD7937'>, 1)
E        +      where <ContractCall 'balanceOf(address account, uint256 id)'> = <IOverlayV1OVLCollateral Contract '0x04c44dAB0a3D6D915C9F5a56bE625196AACf7765'>.balanceOf
E        +  and   5072693936401716224 = int(5.072693936401716e+18)

For context, this failure has been generated a couple times both on branches (maybe branch) that was scarcely diverged from main, so I am not sure where this particular error has entered. It is possible, unfortunately I did not record it, that the error message from the prior failure was different - as I recall an influx of BAL#008 errors which were not so excessive this time around.

It doesn't always fail, so I'm wondering what's going on here? Is this the same test observed recently that was also periodically fickle, or was that one of the impact window tests?

@mesozoic-technology mesozoic-technology changed the title Bounding issue with FixedPoint power function FAILED tests/markets/collateral/ovl/test_build.py::test_build_oi_adjusted_min Jan 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant