You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current design: when a channel is closed, we allow users to regain their unspent amount plus the late payment interest, but we only call claim() when the contract runs out of funds to pay. This means that the last callers will rely entirely on claim() to get their funds.
Consider this design: in every getRefund(), transfer the unspent amount (totalDeposited - spenderLeafAmount), and optionally pay out the additional late payment interest through calling claim()
The drawback is gas usage, so it must be measured.
This way, we guarantee that the unspent amount will always be paid, and if there's some issue with claim(), only the interest will be omitted
Some gas can be saved from not keeping track of remaining
There is a third option: call claim() only when the channel is closed and from that point onward, distribute *multiplier. The consideration there is that we need to know whether claim() was called (whether interest exists) on subsequent calls, and we need to ensure that we use the correct interest rate (whatever it was at time of calling), considering it's mutable.
The text was updated successfully, but these errors were encountered:
Current design: when a channel is closed, we allow users to regain their unspent amount plus the late payment interest, but we only call
claim()
when the contract runs out of funds to pay. This means that the last callers will rely entirely onclaim()
to get their funds.Consider this design: in every
getRefund()
, transfer the unspent amount (totalDeposited - spenderLeafAmount
), and optionally pay out the additional late payment interest through callingclaim()
The drawback is gas usage, so it must be measured.
This way, we guarantee that the unspent amount will always be paid, and if there's some issue with
claim()
, only the interest will be omittedSome gas can be saved from not keeping track of
remaining
There is a third option: call
claim()
only when the channel is closed and from that point onward, distribute*multiplier
. The consideration there is that we need to know whetherclaim()
was called (whether interest exists) on subsequent calls, and we need to ensure that we use the correct interest rate (whatever it was at time of calling), considering it's mutable.The text was updated successfully, but these errors were encountered: