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

Don't do unnecessary crank "simulations" #117

Merged
merged 1 commit into from
Dec 1, 2022
Merged

Don't do unnecessary crank "simulations" #117

merged 1 commit into from
Dec 1, 2022

Conversation

ams9198
Copy link
Contributor

@ams9198 ams9198 commented Dec 1, 2022

Since we lazily crank individual lenders, we don't need to call back into currentWithdrawState (which "simulates" cranking the lender, though in this case, doesn't do much since they're already up-to-date) in subsequent code. This updates the withdrawmanager to pass through the withdraw state after cranking so it doesn't need to be re-read from disk / re-simulated-cranked.

Modest gas improvement, from 290k to 260k on a redeem.

@ams9198 ams9198 merged commit 7da4b73 into circlefin:master Dec 1, 2022
@ams9198 ams9198 deleted the dontrecrank branch December 1, 2022 15:07
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