-
Notifications
You must be signed in to change notification settings - Fork 60
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
Skip interest accrual if already accrued in the same block #182
Conversation
makcandrov
commented
Jul 26, 2023
- Fixes Skip interest accrual if already accrued in the same block? #179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide a gas diff (with your assumptions etc) please
@makcandrov can you run the IMO, having this PR + expecting integrators to accrue interests by exposing the function |
Is there an easy way to make a gas diff with hadhat? |
we could do it though, it does not seem to hard and there are great software devs in this room |
Can we make sure that with a heavier IRM we have the results that we expect please ? |
I did notice a notable difference with Foundry tests (I also used a custom one without fuzzing) (see here). Can't it be a Hardhat quirk? I don't know much about Hardhat, but is it possible that it skips a block between each call by default? |
I conducted some debugging, and indeed, by default, a block is mined after each transaction. It can be disabled by specifying it in the config (thanks StackOverflow):
However, with these settings, the liquidation tests fail (even on the main branch), so I'm still investigating... |
I tried to compare using hardhat, but not mining a block after each transaction produces all kinds of bugs from hardhat. I guess we'll have to settle for Foundry gas diff for now... |
I tried it and here's how I made it work: #198 Because blocks are still mined sometimes, only the minimum gas cost is relevant to look at: |
Very nice, thanks! |
ae177bf
This reverts commit 1e28a92.
f5f40d2