Skip to content
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

Various bug fixes in rust sdk #5

Merged
merged 15 commits into from
Apr 30, 2024
Merged

Various bug fixes in rust sdk #5

merged 15 commits into from
Apr 30, 2024

Conversation

slundqui
Copy link
Contributor

@slundqui slundqui commented Apr 26, 2024

PR originally from delvtech/hyperdrive#1005

Resolved Issues

This solves various rust crashes resulting from python fuzz testing.
#41

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?

@slundqui slundqui force-pushed the slundquist/rust-bug-fixes branch 2 times, most recently from ab77595 to 49f6ed3 Compare April 29, 2024 21:43
@slundqui slundqui force-pushed the slundquist/rust-bug-fixes branch from 49f6ed3 to 0a5615a Compare April 30, 2024 17:27
@slundqui slundqui enabled auto-merge (squash) April 30, 2024 17:58
@slundqui slundqui merged commit 1919734 into main Apr 30, 2024
4 checks passed
@slundqui slundqui deleted the slundquist/rust-bug-fixes branch April 30, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants