-
Notifications
You must be signed in to change notification settings - Fork 29
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
Interactive UDC withdraw #2635
Interactive UDC withdraw #2635
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2635 +/- ##
==========================================
- Coverage 89.84% 89.68% -0.17%
==========================================
Files 172 175 +3
Lines 7004 7089 +85
Branches 1177 1185 +8
==========================================
+ Hits 6293 6358 +65
- Misses 623 643 +20
Partials 88 88
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
290ab82
to
a4fae97
Compare
You modified |
...into pathfinding, monitor and udc epics, since the generic epic module was already too big.
Now named udcWithdraw, and the previous udcWithdraw is renamed to udcWithdrawPlan. Also, a small refactoring to check if totalDeposit is outdated late, right before calling deposit (after approveIfNeeded$).
a4fae97
to
4e81cd6
Compare
udcWithdraw phase (after plan) is now a request/success/failure epic. udcWithdraw.request is handled, dispatches the transaction, wait for it to be mined and output either success or failure. If config.autoUdcWithdraw is enabled (default), an epic will watch the blockchain for plans from us and dispatch the udcWithdraw.request
The former queries the UDC for currently planned withdraws, returning amount, block in which it becomes available and ready state; the later is to be called when config.autoUdcWithdraw is false and after plan is 'ready', and interactively performs the last UDC withdraw phase.
4e81cd6
to
63280a5
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.
Thanks for taking the time and implementing this feature. What sound to easy in the beginning actually became quite big.
I'm pretty happy with most of it. Just the epic to auto-trigger withdrawals is not so nice as I think. We should discuss it together. Especially the hard binding to the exact contract deployment constructor value is not so nice. I would like to get rid of it.
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.
Thanks for the long call! 🙏🏾
Here the awaited approval. Good work.
- Raiden.udcWithdraw -> Raiden.withdrawFromUDC - Raiden.planUdcWithdraw -> Raiden.planUDCWithdraw - config.autoUdcWithdraw -> config.autoUDCWithdraw - 100 -> constants.UDC_WITHDRAW_TIMEOUT
Fixes #2629
Short description
Refactor: split services/epics into separate modules for UDC handling, MS and PFS.
udcWithdraw
is split into 2 sets of independent async actions:udc/withdraw/plan
, which is responsible only for the planning transaction, per user request, and triggered fromRaiden.planUdcWithdraw
public method, andudc/withdraw
, which triggers the final step, after 100 blocks of the planned tx, which got exposed throughRaiden.udcWithdraw
method.Additionally, the current plan (if any) can be checked from the new
Raiden.getUdcWithdrawPlan
method, which will resolve toundefined
if there's none, or to an object containingamount
,block
(block at which it'll become ready) andready
(boolean to tell if it's already ready).A new
config.autoUdcWithdraw
, which defaults to true, enables an epic which will watch the blockchain and automaticallyudc/withdraw/request
when a plan is ready; it can be turned off, and only thenRaiden.udcWithdraw
is made available for the interactive 2nd step udcWithdraw.Definition of Done
Steps to manually test the change (dApp)