snapshotTime
is dubious
#269
Replies: 6 comments 7 replies
-
also
i am strongly against the idea of changing core logic just for the reason: "the name itself can be confusing in practice" we could technically update more context: previously, this time variable was called |
Beta Was this translation helpful? Give feedback.
-
Given how tight the timeline is, I'd appreciate if we can take decision on this before the weekend. |
Beta Was this translation helpful? Give feedback.
-
Shub and I hopped on a call to discuss this proposal, and I think it makes sense. Let's implement it.
Naming is extremely important. By your logic @andreivladbrg, why not rename |
Beta Was this translation helpful? Give feedback.
-
After re-reading this discussion, I agree with the first point. However, I don’t agree that the reasoning should be "the name itself can be confusing in practice" but rather the "robust pattern" argument presented in #271 |
Beta Was this translation helpful? Give feedback.
-
I'm glad that this was solved. Some comments:
I'm glad to hear that you no longer think that code is self-explanatory. However, let me clarify that I did intend to bring something you said elsewhere in this discussion. I said that because I have considered it to be related to the discussion herein. |
Beta Was this translation helpful? Give feedback.
-
Context
One would assume that
snapshotTime
represents the time whensnapshotDebt
is updated, which is not quite true. For example,pause
andvoid
update thesnapshotDebt
but not thesnapshotTime
.This decision was made to make
_ongoingDebtOf
gas efficient for paused streams. But the same can also be achieved by checking for rps value.Problem
Even though we describe
snapshotTime
as "The Unix timestamp used for the ongoing debt calculation" without mentioning anything about snapshot debt, the name itself can be confusing in practice, for auditors, for code readers as well as for the users.Recommendation
I propose to redefine the
snapshotTime
as the "Unix timestamp when snapshot debt is updated by adding up the ongoing debt" and then:pause
andvoid
isPaused
check fromongoingDebt
and add rps check.Anybody can then empirically check that the following hold true regardless of the stream status:
Effects on the audit timeline
Given that it's a minor change, it won't delay the audit timeline for us.
Thoughts, cc @sablier-labs/engineers.
Beta Was this translation helpful? Give feedback.
All reactions