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

optimize _calcSurplusAndCap() in LiquidationLibrary #687

Merged
merged 5 commits into from
Oct 13, 2023

Conversation

rayeaster
Copy link
Contributor

address #683

@GalloDaSballo
Copy link
Collaborator

@dapp-whisperer Very delicate change

I added an assert so we can invariant test if that gets broken

We assume partial can never close a CDP, the assert ensures that
Due to the assert we can remove some of the unnecessary logic

Same idea for full liquidation, do the math only when needed

@GalloDaSballo
Copy link
Collaborator

On error: SL-05: The CDPs should be sorted in descending order of new ICR (accrued)

This is the issue we've already discussed plenty of times

@GalloDaSballo
Copy link
Collaborator

On broken Foundry Tests:
The new math formula causes overflow, I believe this happens due to the crazy values echidna uses

Copy link
Collaborator

@GalloDaSballo GalloDaSballo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sent tweak with Assert so we can let echidna cook

@GalloDaSballo
Copy link
Collaborator

Waiting on @dapp-whisperer review before merging, we can differential fuzz if need be

@rayeaster rayeaster merged commit be25aba into feat/release-0.5 Oct 13, 2023
3 checks passed
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.

3 participants