-
Notifications
You must be signed in to change notification settings - Fork 268
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
Improve NodeRelayer errors #1261
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1261 +/- ##
==========================================
+ Coverage 77.08% 77.14% +0.06%
==========================================
Files 142 142
Lines 9892 9925 +33
Branches 394 396 +2
==========================================
+ Hits 7625 7657 +32
- Misses 2267 2268 +1
|
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/NodeRelayer.scala
Show resolved
Hide resolved
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.
I think we should immediately merge 2b4b916 and take more time on the NodeRelayer
errors.
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/NodeRelayer.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/NodeRelayer.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/NodeRelayer.scala
Show resolved
Hide resolved
We add new errors that let senders know they need to raise the trampoline fee/ctlv. When the error is downstream, we select the best error to forward.
When receiving a fee/cltv error, we should retry with a different fee/cltv. This process is currently quite manual: the sender decides upfront on each attempt's fee/cltv.
2b4b916
to
dc8459e
Compare
I added the sender-side in |
@@ -72,7 +72,7 @@ class PaymentLifecycle(nodeParams: NodeParams, cfg: SendPaymentConfig, router: A | |||
router ! FinalizeRoute(c.hops) | |||
if (cfg.storeInDb) { | |||
val targetNodeId = cfg.trampolineData.map(_.paymentRequest.nodeId).getOrElse(cfg.targetNodeId) | |||
val finalAmount = c.finalPayload.amount - cfg.trampolineData.map(_.trampolineFees).getOrElse(0 msat) | |||
val finalAmount = c.finalPayload.amount - cfg.trampolineData.map(_.trampolineAttempts.headOption.map(_._1).getOrElse(0 msat)).getOrElse(0 msat) |
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.
Please ignore this hack. This is because we haven't update the DB schema yet and we needed to take trampoline fees into account in a hackish way. This will be fixed in the next trampoline PR which update the DB schema to clean things up.
We add new errors that let senders know they need to raise the trampoline fee/ctlv.
When the error is downstream, we select the best error to forward.