Add mediation fees for internal routing and maximum fee limit#4760
Conversation
48cb80d to
099725e
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4760 +/- ##
===========================================
- Coverage 80.75% 80.63% -0.12%
===========================================
Files 119 119
Lines 14373 14384 +11
Branches 2217 2219 +2
===========================================
- Hits 11607 11599 -8
- Misses 2111 2122 +11
- Partials 655 663 +8
Continue to review full report at Codecov.
|
f56e400 to
a4bf9b9
Compare
|
Rebased on latest develop and solved conflicts |
390130a to
410b6cd
Compare
|
Does the maximum fee limit also count for routes being provided by the pfs? |
Yes the code for the check is after the routes have been acquired (by whatever means, pfs or internal routing) |
410b6cd to
33df00b
Compare
|
Hey @karlb Rebasing on #4786 broke this PR unfortunately on the test_mediated_transfer_with_fees. So had to spend some time figuring it out. Turns out that since you were patching the fees and setting them to a standard 20% for each mediator, quite a lot of combinations of amount + fees would not work and end up not completing the transfer (due to less than the final amount reaching the target). So what I added is:
|
|
|
||
| # https://github.com/raiden-network/raiden/issues/4751 | ||
| # Internal routing doesn't know about fee so it should set a percentage per hop | ||
| estimated_fee = FeeAmount(round(INTERNAL_ROUTING_DEFAULT_FEE_PERC * amount)) |
There was a problem hiding this comment.
We're adding fees here even in case of a direct transfer.
There was a problem hiding this comment.
Sorry for not being thorough, yesterday. It also looks like we only apply INTERNAL_ROUTING_DEFAULT_FEE_PERC once. Wasn't the intention of the ticket to do that once per hop?
There was a problem hiding this comment.
I'll write a PR that changes these two things. If any of these statements is wrong, let me know!
There was a problem hiding this comment.
We're adding fees here even in case of a direct transfer.
It's correct. I did not notice that.
It also looks like we only apply INTERNAL_ROUTING_DEFAULT_FEE_PERC once. Wasn't the intention of the ticket to do that once per hop?
No, since we are not sure of the hops anyway in internal routing the intention (and it's also written in the issue) was to add a big percentage.
Fixes: #4751
Description
Check the issue.
PR review check list
Quality check list that cannot be automatically verified.