-
Notifications
You must be signed in to change notification settings - Fork 3
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
test: add invariant_DebtGt0_RpsGt0_DebtIncrease
#129
Conversation
ebd3e52
to
9948351
Compare
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.
If rps > 0 and no additional deposits are made, then debt should never decrease. This invariant failing led me to #126 PR.
If rps > 0 and no withdraws are made, remaining amount + streamed amount should never decrease
aren't these pretty much the same?
let's keep only one - invariant_RpsGt0_RemainingPlusStreamedIncrease
I think no, they are not the same.
The test thats failing is |
amount owed to the recipient and the stream debt are correlated it is the same argument you said here you can't have one(invariant) without the other
same thing you can say for wdyt? |
May be, I can remove it for now since I don't have any good argument in its support. |
@andreivladbrg I have removed |
invariant_DebtGt0_RpsGt0_DebtIncrease
invariant_DebtGt0_RpsGt0_DebtIncrease
invariant_DebtGt0_RpsGt0_DebtIncrease
invariant_DebtGt0_RpsGt0_DebtIncrease
invariant_DebtGt0_RpsGt0_DebtIncrease
invariant_DebtGt0_RpsGt0_DebtIncrease
invariant_DebtGt0_RpsGt0_DebtIncrease
invariant_DebtGt0_RpsGt0_DebtIncrease
invariant_DebtGt0_RpsGt0_DebtIncrease
docs: update invariants in readme test(invariant): replace extractedAmounts with refundedAmounts and withdrawnAmounts test(invariant): add updateFlowStates modifier test(invariant): remove restartAndDeposit test(invariant): add natspecs over invariant tests
test: correct grammar in dev natspec test: order invariants alphabetically
c20a47f
to
72de62b
Compare
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.
looks good now
Changelog
One New Invariant
rps > 0
and no additional deposits are made, then debt should never decrease. This invariant failing led me to feat: persist amount owed beyond depletion timestamp #126 PR.Other changes
README.md
, I have used LaTeX to re-write invariant formulas. The order of invariants match the same order in which they are written inFlow.t.sol
.README
file.invariant_DepositAmountsSumGeExtractedAmountsSum
and also renamed them.FlowHandler
to track key data. These new variables are required by the above 2 new invariants.updateFlowStates
modifier it added to handler to update states prior to the function call.restartAndDeposit
from handler as its just a proxy forrestart
anddeposit
.extractedAmounts
withrefundedAmounts
andwithdrawnAmounts
PR dependencies
Note
The CI test would fail. It demonstrates the bug in the current implementation.