mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 18:27:43 +02:00
itest+lntest: fix flake in MPP-related tests
This commit is contained in:
@@ -378,6 +378,33 @@ func (c *mppTestScenario) setupSendPaymentCase() btcutil.Amount {
|
||||
// - 2nd attempt(75,000 sats): Alice->Dave->Bob: 155,000 sats.
|
||||
// - 3rd attempt(75,000 sats): Alice->Carol->Eve->Bob: 155,000 sats.
|
||||
//
|
||||
// There is a case where the payment will fail due to the channel
|
||||
// bandwidth not being updated in the graph, which has been seen many
|
||||
// times:
|
||||
// 1. the 1st attempt (150,000 sats) is sent via
|
||||
// Alice->Carol->Eve->Bob, after which the capacity in Carol->Eve
|
||||
// should decrease.
|
||||
// 2. the 2nd attempt (75,000 sats) is sent via Alice->Carol->Eve->Bob,
|
||||
// which shouldn't happen because the capacity in Carol->Eve is
|
||||
// depleted. However, since the HTLCs are sent in parallel, the 2nd
|
||||
// attempt can be sent before the capacity is updated in the graph.
|
||||
// 3. if the 2nd attempt succeeds, the 1st attempt will fail and be
|
||||
// split into two attempts, each holding 75,000 sats. At this point,
|
||||
// we have three attempts to send, but only two routes are
|
||||
// available, causing the payment to be failed.
|
||||
// 4. In addition, with recent fee buffer addition, the attempts will
|
||||
// fail even earlier without being further split.
|
||||
//
|
||||
// To avoid this case, we now increase the channel capacity of the
|
||||
// route Carol->Eve->Bob and Carol->Bob such that even the above case
|
||||
// happened, we can still send the HTLCs.
|
||||
//
|
||||
// TODO(yy): we should properly fix this in the router. Atm we only
|
||||
// perform this hack to unblock the CI.
|
||||
req.amtCarolBob = 285_000
|
||||
req.amtEveBob = 285_000
|
||||
req.amtCarolEve = 285_000
|
||||
|
||||
// Open the channels as described above.
|
||||
c.openChannels(req)
|
||||
|
||||
|
Reference in New Issue
Block a user