-
Notifications
You must be signed in to change notification settings - Fork 413
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
ISSUE-87: Return early if now == rho #99
Conversation
@@ -138,7 +138,8 @@ contract Pot is LibNote { | |||
|
|||
// --- Savings Rate Accumulation --- | |||
function drip() external note returns (uint tmp) { | |||
require(now >= rho, "Pot/invalid-now"); | |||
if (now == rho) return chi; | |||
require(now > rho, "Pot/invalid-now"); |
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.
Unrelated to this PR, shouldn't this be invalid-rho
?
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.
time is relative... Sorry, been a long day.
Just to accurately represent the calculus behind this, using the following numbers (which others measured, I have not checked them): savings of optimization when one finds that the odds of calling Making this change represents a certain level of faith that the system will reach a scale where this condition holds so real gas savings accrue. Although my priors aren't terribly well-informed, I suspect that this will be a net loss at least for some period of time (I'm expecting << 1 Of course, EVM storage operations tend to get more expensive with each hard fork, so it is more likely that the threshold become more favorable over time than not. Note: above numbers were for |
It's sufficiently complex and the rewards so minimal as to be unlikely, but as MCD scales this mechanism could theoretically be utilized by miners to bundle these transactions (or unbundle them) to consume less (or capture additional) gas for each call. I don't think this side-effect is an argument for or against, but thought it was worth pointing out the observation. |
I think something that isn't being considered in this discussion is that if this change is not made, then anyone who calls Given that all callers must first do the check, I believe this change is a gas reduction in all cases except the theoretical (but likely never encountered) case where the caller knows they are at the top of the block or otherwise has some guarantee that no transactions before it have triggered a |
why do they risk a failed transaction? If equals the tx still passes without this change, just consumes more gas. |
Ah, sorry. Was thinking of something else. I shouldn't comment on GitHub late at night. |
It is possible that if the DSR is high enough, bots will |
Sorry to say, while we think the gains here are worthy, we are just taking too much risk to include this now. We have done multiple audits, a bug bounty, and formal verification of the system and after much deliberation we believe even a small change like this can invalidate those results and threaten our confidence in the system. Since the |
This is fixes #87
gas saving are
40,053
if called in the same block.