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
Automatically disable from_future_htlc when abused (#2928)
When providing on-the-fly funding with the `from_future_htlc` payment
type, the liquidity provider is paying mining fees for the funding
transaction while trusting that the remote node will accept the HTLCs
afterwards and thus pay a liquidity fees. If the remote node fails the
HTLCs, the liquidity provider doesn't get paid. At that point it can
disable the channel and try to actively double-spend it. When we detect
such behavior, we immediately disable `from_future_htlc` to limit the
exposure to liquidity griefing: it can then be re-enabled by using the
`enableFromFutureHtlc` RPC, or will be automatically re-enabled if the
remote node fulfills the HTLCs after a retry.
Future.successful(EnableFromFutureHtlcResponse(enabled =false, Some("could not enable from_future_htlc: you must add it to eclair.liquidity-ads.payment-types in your eclair.conf file first")))
795
+
}
796
+
}
797
+
784
798
overridedefstop():Future[Unit] = {
785
799
// README: do not make this smarter or more complex !
786
800
// eclair can simply and cleanly be stopped by killing its process without fear of losing data, payments, ... and it should remain this way.
valRelayedPaymentDuration=Kamon.timer("payment.duration.relayed", "Duration of pending downstream HTLCs during a relay")
37
+
valSuspiciousFromFutureHtlcRelays=Kamon.gauge("payment.on-the-fly-funding.suspicious-htlc-relays", "Number of pending on-the-fly HTLCs that are being rejected by seemingly malicious peers")
37
38
38
39
// The goal of this metric is to measure whether retrying MPP payments on failing channels yields useful results.
39
40
// Once enough data has been collected, we will update the MultiPartPaymentLifecycle logic accordingly.
valcancelAmountTooLow=CancelOnTheFlyFunding(channelId, paymentHashes, s"requested amount is too low to relay HTLCs: ${requestFunding.requestedAmount} < $totalPaymentAmount")
161
194
valcancelFeesTooLow=CancelOnTheFlyFunding(channelId, paymentHashes, s"htlc amount is too low to pay liquidity fees: $availableAmountForFees < $feesOwed")
195
+
valcancelDisabled=CancelOnTheFlyFunding(channelId, paymentHashes, "payments paid with future HTLCs are currently disabled")
0 commit comments