MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_mpp_interference_2

Function test_mpp_interference_2

tests/test_pay.py:4239–4351  ·  view source on GitHub ↗

We create a "public network" that looks like so. Each channel is perfectly balanced, with 7 * unit funds on each side. 4 -- 5 | /| | / | | / | |/ | 6 -- 7 l1 is the payee, who will later issue some invoices. It arranges unp

(node_factory, bitcoind, executor)

Source from the content-addressed store, hash-verified

4237@pytest.mark.openchannel('v2')
4238@unittest.skipIf(True, "Temporarily disabled while flake diagnosed: blame Rusty!")
4239def test_mpp_interference_2(node_factory, bitcoind, executor):
4240 '''
4241 We create a "public network" that looks like so.
4242 Each channel is perfectly balanced, with 7 * unit
4243 funds on each side.
4244
4245 4 -- 5
4246 | /|
4247 | / |
4248 | / |
4249 |/ |
4250 6 -- 7
4251
4252 l1 is the payee, who will later issue some invoices.
4253 It arranges unpublished channels from the above public
4254 network:
4255
4256 l5->l1: 7 * unit
4257 l6->l1: 5 * unit
4258 l4->l1: 3 * unit
4259 l7->l1: 2 * unit
4260
4261 l2 and l3 are payers.
4262 They create some unpublished channels to the public network:
4263
4264 l2->l4, l2->l6: 6 * unit each
4265 l3->l7, l3->l6: 6 * unit each
4266
4267 Finally, l1 issues 6 * unit invoices, simultaneously, to l2 and l3.
4268 Both of them perform `pay` simultaneously, in order to test if
4269 they interfere with each other.
4270
4271 This test then tries to check if both of them can pay, given
4272 that there is sufficient incoming capacity, and then some,
4273 to the payee, and the public network is perfectly balanced
4274 with more than sufficient capacity, as well.
4275 '''
4276 opts = {'feerates': (1000, 1000, 1000, 1000)}
4277
4278 l1, l2, l3, l4, l5, l6, l7 = node_factory.get_nodes(7, opts=opts)
4279
4280 # Unit
4281 unit = Millisatoshi(11000 * 1000)
4282
4283 # Build the public network.
4284 public_network = [l4.fundbalancedchannel(l5, unit * 14),
4285 l4.fundbalancedchannel(l6, unit * 14),
4286 l5.fundbalancedchannel(l6, unit * 14),
4287 l5.fundbalancedchannel(l7, unit * 14),
4288 l6.fundbalancedchannel(l7, unit * 14)]
4289
4290 # Build unpublished channels to the merchant l1.
4291 l4.rpc.connect(l1.info['id'], 'localhost', l1.port)
4292 l5.rpc.connect(l1.info['id'], 'localhost', l1.port)
4293 l6.rpc.connect(l1.info['id'], 'localhost', l1.port)
4294 l7.rpc.connect(l1.info['id'], 'localhost', l1.port)
4295
4296 # If we're 'dual-funding', turn off the reciprocal funding

Callers

nothing calls this directly

Calls 13

MillisatoshiClass · 0.90
mine_funding_to_announceFunction · 0.90
wait_forFunction · 0.90
get_nodesMethod · 0.80
fundbalancedchannelMethod · 0.80
to_satoshiMethod · 0.80
joinMethod · 0.80
connectMethod · 0.45
callMethod · 0.45
fundchannelMethod · 0.45
listchannelsMethod · 0.45
invoiceMethod · 0.45

Tested by

no test coverage detected