-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix absolute_max_long
in rust sdk
#41
Labels
bug
Something isn't working
Comments
This was referenced Apr 25, 2024
slundqui
referenced
this issue
Apr 30, 2024
PR originally from delvtech/hyperdrive#1005 # Resolved Issues This solves various rust crashes resulting from python fuzz testing. https://github.com/delvtech/hyperdrive/issues/1004 # Description Fixes the following issues: - Max long guesses is below the minimum transaction amount, so `calc_open_long` throws a minimum transaction amount error. We clamp the guess to be minimum transaction amount. and do a final check at the end to ensure the max amount is greater than the minimum transaction amount. - We catch a case in `absolute_max_long` where the `target_share_reserves < effective_share_reserves`. In this case, we throw a better descriptive panic. - We short circuit `calc_max_long` and return 0 if the spot price after a minimum long exceeds the max spot price. - Fixing bug with wheel build script. - Building and uploading to pypi on tag instead of push to main. # Review Checklists Please check each item **before approving** the pull request. While going through the checklist, it is recommended to leave comments on items that are referenced in the checklist to make sure that they are reviewed. If there are multiple reviewers, copy the checklists into sections titled `## [Reviewer Name]`. If the PR doesn't touch Solidity and/or Rust, the corresponding checklist can be removed. ## [[Reviewer Name]] ### Rust - [ ] **Testing** - [ ] Are there new or updated unit or integration tests? - [ ] Do the tests cover the happy paths? - [ ] Do the tests cover the unhappy paths? - [ ] Are there an adequate number of fuzz tests to ensure that we are covering the full input space? - [ ] If matching Solidity behavior, are there differential fuzz tests that ensure that Rust matches Solidity?
dpaiton
changed the title
Fix
fix May 3, 2024
absolute_max_long
in rust sdkabsolute_max_long
in rust sdk
closed in favor of #45 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
absolute_max_long
is failing due totarget_share_reserves < effective_share_reserves
witharithmetic operation overflow
here:https://github.com/delvtech/hyperdrive/blob/1576e4c4368dd9c21b2df60274f223271e793d46/crates/hyperdrive-math/src/long/max.rs#L214
This is the pool state that caused this issue:
The text was updated successfully, but these errors were encountered: