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

RecollateralizationLib gas optimization #890

Merged
merged 3 commits into from
Aug 11, 2023
Merged

RecollateralizationLib gas optimization #890

merged 3 commits into from
Aug 11, 2023

Conversation

tbrent
Copy link
Collaborator

@tbrent tbrent commented Aug 10, 2023

Couple things happening in this PR

  1. Fix Recollateralization gas tests to actually run successfully
  2. Update gas snapshots to show where 3.0.0-rc5 actually was
  3. Apply gas optimizations to RecollateralizationLibP1.sol to reduce the need for a mulDiv for every single asset, on the range.bottom side.
  4. Compute new gas snapshots

So the total diff shown in the PR is the result of (i) a large increase that was already present in 3.0.0-rc5 and (ii) a moderate decrease that I applied by gas optimizing the range.bottom computation. Attaching a screenshot of just that decrease so it can be easily seen, but you could also go here

Screenshot 2023-08-10 at 6 56 11 PM

@tbrent tbrent changed the title Recollat gas RecollateralizationLib gas optimization Aug 10, 2023
@tbrent tbrent requested a review from pmckelvy1 August 11, 2023 17:15
@pmckelvy1
Copy link
Collaborator

changes look sound, but looks like dutch trade costs went up a little bit?

@pmckelvy1
Copy link
Collaborator

changes look sound, but looks like dutch trade costs went up a little bit?

nvm i understand now that those don't reference the correct starting gas

Copy link
Collaborator

@pmckelvy1 pmckelvy1 left a comment

Choose a reason for hiding this comment

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

lgtm

@pmckelvy1 pmckelvy1 merged commit 08212ff into 3.0.0-rc5 Aug 11, 2023
8 checks passed
@pmckelvy1 pmckelvy1 deleted the recollat-gas branch August 11, 2023 19:57
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