-
Notifications
You must be signed in to change notification settings - Fork 45
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
Cooperative settlement (simple implementation and clear old code) #1383
Comments
I've done some measurements to compare the gas cost of different approaches: Classic ApproachesTwo WithdrawsDon't implement anything new and expect both parties to do a withdraw if they don't want to use the channel, anymore. Coop SettleActivate the cooperative settle function which is currently disabled in the contract. The code to handle coop settlement in Raiden is still missing, but would look similar to our current withdraw code. Hybrid ApproachesThese two approaches reuse our current withdraw signatures, but both nodes coordinate to only have a single on-chain transaction. That reduces the number of different proofs we have to handle compared to the original coop settle, but apart from that is about as complex. Two Withdraws in a Single TransactionAdd a small wrapper function to execute both withdraws in a single transaction. Coop Settle Based on WithdrawReuse the existing code to create and check withdraw proofs in a new coop settle function. The function would check both withdraw proofs, but instead of withdrawing, it settles the channel. |
@karlb Which of the hybrid approaches was the one that you and Augusto favored? |
I don't think there was a clear favorite, but I would suggest going with "Coop Settle Based on Withdraw". |
Also discussed in #1236 |
Fixed by #1474 |
#399 was commented out to be re-enabled in the future, but after a discussion with @karlb we realized that withdraw alone provides the same capabilities as coop settle. Instead of having two primitives it makes more sense to just have one.
The only drawback is that two withdraws would be more expensive then a single coop settle. This has to be measured and weighted to see if it is significant enough to keep coop settle around.
The text was updated successfully, but these errors were encountered: