@@ -216,9 +216,9 @@ def test_closing_torture(node_factory, executor, bitcoind):
216
216
def test_closing_different_fees (node_factory , bitcoind , executor ):
217
217
l1 = node_factory .get_node ()
218
218
219
- # Default feerate = 15000/7500/1000
219
+ # Default feerate = 15000/11000/ 7500/1000
220
220
# It will start at the second number, accepting anything above the first.
221
- feerates = [[20000 , 15000 , 7400 ], [8000 , 1001 , 100 ]]
221
+ feerates = [[20000 , 11000 , 15000 , 7400 ], [8000 , 6000 , 1001 , 100 ]]
222
222
amounts = [0 , 545999 , 546000 ]
223
223
num_peers = len (feerates ) * len (amounts )
224
224
@@ -362,10 +362,10 @@ def test_closing_specified_destination(node_factory, bitcoind, chainparams):
362
362
363
363
def closing_fee (node_factory , bitcoind , chainparams , opts ):
364
364
rate = opts ['funder_feerate_per_kw' ]
365
- funder = node_factory .get_node (feerates = (rate , rate , rate ))
365
+ funder = node_factory .get_node (feerates = (rate , rate , rate , rate ))
366
366
367
367
rate = opts ['fundee_feerate_per_kw' ]
368
- fundee = node_factory .get_node (feerates = (rate , rate , rate ))
368
+ fundee = node_factory .get_node (feerates = (rate , rate , rate , rate ))
369
369
370
370
funder_id = funder .info ['id' ]
371
371
fundee_id = fundee .info ['id' ]
@@ -446,7 +446,9 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams):
446
446
"""Test penalty transaction with an incoming HTLC"""
447
447
# We suppress each one after first commit; HTLC gets added not fulfilled.
448
448
# Feerates identical so we don't get gratuitous commit to update them
449
- l1 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED-nocommit' ], may_fail = True , feerates = (7500 , 7500 , 7500 ), allow_broken_log = True )
449
+ l1 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED-nocommit' ],
450
+ may_fail = True , feerates = (7500 , 7500 , 7500 , 7500 ),
451
+ allow_broken_log = True )
450
452
l2 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED-nocommit' ])
451
453
452
454
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -487,6 +489,7 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams):
487
489
bitcoind .generate_block (1 )
488
490
489
491
l2 .daemon .wait_for_log (' to ONCHAIN' )
492
+
490
493
# FIXME: l1 should try to stumble along!
491
494
wait_for (lambda : len (l2 .getactivechannels ()) == 0 )
492
495
@@ -509,7 +512,7 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams):
509
512
outputs = l2 .rpc .listfunds ()['outputs' ]
510
513
assert [o ['status' ] for o in outputs ] == ['confirmed' ] * 2
511
514
# Allow some lossage for fees.
512
- slack = 27000 if chainparams ['elements' ] else 15000
515
+ slack = 30000 if chainparams ['elements' ] else 20000
513
516
assert sum (o ['value' ] for o in outputs ) < 10 ** 6
514
517
assert sum (o ['value' ] for o in outputs ) > 10 ** 6 - slack
515
518
@@ -519,7 +522,9 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams):
519
522
"""Test penalty transaction with an outgoing HTLC"""
520
523
# First we need to get funds to l2, so suppress after second.
521
524
# Feerates identical so we don't get gratuitous commit to update them
522
- l1 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED*3-nocommit' ], may_fail = True , feerates = (7500 , 7500 , 7500 ), allow_broken_log = True )
525
+ l1 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED*3-nocommit' ],
526
+ may_fail = True , feerates = (7500 , 7500 , 7500 , 7500 ),
527
+ allow_broken_log = True )
523
528
l2 = node_factory .get_node (disconnect = ['=WIRE_COMMITMENT_SIGNED*3-nocommit' ])
524
529
525
530
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -589,7 +594,7 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams):
589
594
outputs = l2 .rpc .listfunds ()['outputs' ]
590
595
assert [o ['status' ] for o in outputs ] == ['confirmed' ] * 3
591
596
# Allow some lossage for fees.
592
- slack = 27000 if chainparams ['elements' ] else 15000
597
+ slack = 30000 if chainparams ['elements' ] else 20000
593
598
assert sum (o ['value' ] for o in outputs ) < 10 ** 6
594
599
assert sum (o ['value' ] for o in outputs ) > 10 ** 6 - slack
595
600
@@ -687,7 +692,8 @@ def test_onchaind_replay(node_factory, bitcoind):
687
692
disconnects = ['+WIRE_REVOKE_AND_ACK' , 'permfail' ]
688
693
options = {'watchtime-blocks' : 201 , 'cltv-delta' : 101 }
689
694
# Feerates identical so we don't get gratuitous commit to update them
690
- l1 = node_factory .get_node (options = options , disconnect = disconnects , feerates = (7500 , 7500 , 7500 ))
695
+ l1 = node_factory .get_node (options = options , disconnect = disconnects ,
696
+ feerates = (7500 , 7500 , 7500 , 7500 ))
691
697
l2 = node_factory .get_node (options = options )
692
698
693
699
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -740,7 +746,8 @@ def test_onchain_dust_out(node_factory, bitcoind, executor):
740
746
# HTLC 1->2, 1 fails after it's irrevocably committed
741
747
disconnects = ['@WIRE_REVOKE_AND_ACK' , 'permfail' ]
742
748
# Feerates identical so we don't get gratuitous commit to update them
743
- l1 = node_factory .get_node (disconnect = disconnects , feerates = (7500 , 7500 , 7500 ))
749
+ l1 = node_factory .get_node (disconnect = disconnects ,
750
+ feerates = (7500 , 7500 , 7500 , 7500 ))
744
751
l2 = node_factory .get_node ()
745
752
746
753
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -803,7 +810,8 @@ def test_onchain_timeout(node_factory, bitcoind, executor):
803
810
# HTLC 1->2, 1 fails just after it's irrevocably committed
804
811
disconnects = ['+WIRE_REVOKE_AND_ACK*3' , 'permfail' ]
805
812
# Feerates identical so we don't get gratuitous commit to update them
806
- l1 = node_factory .get_node (disconnect = disconnects , feerates = (7500 , 7500 , 7500 ))
813
+ l1 = node_factory .get_node (disconnect = disconnects ,
814
+ feerates = (7500 , 7500 , 7500 , 7500 ))
807
815
l2 = node_factory .get_node ()
808
816
809
817
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -1038,7 +1046,8 @@ def test_onchain_all_dust(node_factory, bitcoind, executor):
1038
1046
# is generated on-the-fly, and is thus feerate sensitive.
1039
1047
disconnects = ['-WIRE_UPDATE_FAIL_HTLC' , 'permfail' ]
1040
1048
# Feerates identical so we don't get gratuitous commit to update them
1041
- l1 = node_factory .get_node (options = {'dev-no-reconnect' : None }, feerates = (7500 , 7500 , 7500 ))
1049
+ l1 = node_factory .get_node (options = {'dev-no-reconnect' : None },
1050
+ feerates = (7500 , 7500 , 7500 , 7500 ))
1042
1051
l2 = node_factory .get_node (disconnect = disconnects )
1043
1052
1044
1053
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -1060,7 +1069,7 @@ def test_onchain_all_dust(node_factory, bitcoind, executor):
1060
1069
l2 .wait_for_channel_onchain (l1 .info ['id' ])
1061
1070
1062
1071
# Make l1's fees really high (and wait for it to exceed 50000)
1063
- l1 .set_feerates ((100000 , 100000 , 100000 ))
1072
+ l1 .set_feerates ((100000 , 100000 , 100000 , 100000 ))
1064
1073
l1 .daemon .wait_for_log ('Feerate estimate for unilateral_close set to [56789][0-9]{4}' )
1065
1074
1066
1075
bitcoind .generate_block (1 )
@@ -1097,12 +1106,12 @@ def test_onchain_different_fees(node_factory, bitcoind, executor):
1097
1106
p1 = executor .submit (l1 .pay , l2 , 1000000000 )
1098
1107
l1 .daemon .wait_for_log ('htlc 0: RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION' )
1099
1108
1100
- l1 .set_feerates ((16000 , 7500 , 3750 ))
1109
+ l1 .set_feerates ((16000 , 11000 , 7500 , 3750 ))
1101
1110
p2 = executor .submit (l1 .pay , l2 , 900000000 )
1102
1111
l1 .daemon .wait_for_log ('htlc 1: RCVD_ADD_ACK_COMMIT->SENT_ADD_ACK_REVOCATION' )
1103
1112
1104
1113
# Restart with different feerate for second HTLC.
1105
- l1 .set_feerates ((5000 , 5000 , 3750 ))
1114
+ l1 .set_feerates ((5000 , 5000 , 5000 , 3750 ))
1106
1115
l1 .restart ()
1107
1116
l1 .daemon .wait_for_log ('peer_out WIRE_UPDATE_FEE' )
1108
1117
@@ -1156,7 +1165,8 @@ def test_permfail_new_commit(node_factory, bitcoind, executor):
1156
1165
# Test case where we have two possible commits: it will use new one.
1157
1166
disconnects = ['-WIRE_REVOKE_AND_ACK' , 'permfail' ]
1158
1167
# Feerates identical so we don't get gratuitous commit to update them
1159
- l1 = node_factory .get_node (options = {'dev-no-reconnect' : None }, feerates = (7500 , 7500 , 7500 ))
1168
+ l1 = node_factory .get_node (options = {'dev-no-reconnect' : None },
1169
+ feerates = (7500 , 7500 , 7500 , 7500 ))
1160
1170
l2 = node_factory .get_node (disconnect = disconnects )
1161
1171
1162
1172
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -1457,7 +1467,8 @@ def test_permfail_htlc_in(node_factory, bitcoind, executor):
1457
1467
# Test case where we fail with unsettled incoming HTLC.
1458
1468
disconnects = ['-WIRE_UPDATE_FULFILL_HTLC' , 'permfail' ]
1459
1469
# Feerates identical so we don't get gratuitous commit to update them
1460
- l1 = node_factory .get_node (options = {'dev-no-reconnect' : None }, feerates = (7500 , 7500 , 7500 ))
1470
+ l1 = node_factory .get_node (options = {'dev-no-reconnect' : None },
1471
+ feerates = (7500 , 7500 , 7500 , 7500 ))
1461
1472
l2 = node_factory .get_node (disconnect = disconnects )
1462
1473
1463
1474
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
@@ -1503,7 +1514,8 @@ def test_permfail_htlc_out(node_factory, bitcoind, executor):
1503
1514
disconnects = ['+WIRE_REVOKE_AND_ACK' , 'permfail' ]
1504
1515
l1 = node_factory .get_node (options = {'dev-no-reconnect' : None })
1505
1516
# Feerates identical so we don't get gratuitous commit to update them
1506
- l2 = node_factory .get_node (disconnect = disconnects , feerates = (7500 , 7500 , 7500 ))
1517
+ l2 = node_factory .get_node (disconnect = disconnects ,
1518
+ feerates = (7500 , 7500 , 7500 , 7500 ))
1507
1519
1508
1520
l1 .rpc .connect (l2 .info ['id' ], 'localhost' , l2 .port )
1509
1521
l2 .daemon .wait_for_log ('openingd-chan#1: Handed peer, entering loop' .format (l1 .info ['id' ]))
0 commit comments