@@ -19,7 +19,8 @@ use ln::functional_test_utils::*;
19
19
#[ test]
20
20
fn test_simple_monitor_permanent_update_fail ( ) {
21
21
// Test that we handle a simple permanent monitor update failure
22
- let node_cfgs = create_node_cfgs ( 2 ) ;
22
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
23
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
23
24
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
24
25
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
25
26
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -51,7 +52,8 @@ fn test_simple_monitor_permanent_update_fail() {
51
52
fn do_test_simple_monitor_temporary_update_fail ( disconnect : bool ) {
52
53
// Test that we can recover from a simple temporary monitor update failure optionally with
53
54
// a disconnect in between
54
- let node_cfgs = create_node_cfgs ( 2 ) ;
55
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
56
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
55
57
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
56
58
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
57
59
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -152,7 +154,8 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
152
154
// * We then walk through more message exchanges to get the original update_add_htlc
153
155
// through, swapping message ordering based on disconnect_count & 8 and optionally
154
156
// disconnect/reconnecting based on disconnect_count.
155
- let node_cfgs = create_node_cfgs ( 2 ) ;
157
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
158
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
156
159
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
157
160
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
158
161
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -480,7 +483,8 @@ fn test_monitor_temporary_update_fail_c() {
480
483
#[ test]
481
484
fn test_monitor_update_fail_cs ( ) {
482
485
// Tests handling of a monitor update failure when processing an incoming commitment_signed
483
- let node_cfgs = create_node_cfgs ( 2 ) ;
486
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
487
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
484
488
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
485
489
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
486
490
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -561,7 +565,8 @@ fn test_monitor_update_fail_no_rebroadcast() {
561
565
// Tests handling of a monitor update failure when no message rebroadcasting on
562
566
// test_restore_channel_monitor() is required. Backported from
563
567
// chanmon_fail_consistency fuzz tests.
564
- let node_cfgs = create_node_cfgs ( 2 ) ;
568
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
569
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
565
570
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
566
571
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
567
572
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -605,7 +610,8 @@ fn test_monitor_update_fail_no_rebroadcast() {
605
610
fn test_monitor_update_raa_while_paused ( ) {
606
611
// Tests handling of an RAA while monitor updating has already been marked failed.
607
612
// Backported from chanmon_fail_consistency fuzz tests as this used to be broken.
608
- let node_cfgs = create_node_cfgs ( 2 ) ;
613
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
614
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
609
615
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
610
616
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
611
617
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -674,7 +680,8 @@ fn test_monitor_update_raa_while_paused() {
674
680
675
681
fn do_test_monitor_update_fail_raa ( test_ignore_second_cs : bool ) {
676
682
// Tests handling of a monitor update failure when processing an incoming RAA
677
- let node_cfgs = create_node_cfgs ( 3 ) ;
683
+ let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
684
+ let node_cfgs = create_node_cfgs ( 3 , & chanmon_cfgs) ;
678
685
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
679
686
let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
680
687
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -929,7 +936,8 @@ fn test_monitor_update_fail_reestablish() {
929
936
// Simple test for message retransmission after monitor update failure on
930
937
// channel_reestablish generating a monitor update (which comes from freeing holding cell
931
938
// HTLCs).
932
- let node_cfgs = create_node_cfgs ( 3 ) ;
939
+ let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
940
+ let node_cfgs = create_node_cfgs ( 3 , & chanmon_cfgs) ;
933
941
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
934
942
let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
935
943
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1009,7 +1017,8 @@ fn raa_no_response_awaiting_raa_state() {
1009
1017
// due to a previous monitor update failure, we still set AwaitingRemoteRevoke on the channel
1010
1018
// in question (assuming it intends to respond with a CS after monitor updating is restored).
1011
1019
// Backported from chanmon_fail_consistency fuzz tests as this used to be broken.
1012
- let node_cfgs = create_node_cfgs ( 2 ) ;
1020
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
1021
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
1013
1022
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
1014
1023
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
1015
1024
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1124,7 +1133,8 @@ fn claim_while_disconnected_monitor_update_fail() {
1124
1133
// Backported from chanmon_fail_consistency fuzz tests as an unmerged version of the handling
1125
1134
// code introduced a regression in this test (specifically, this caught a removal of the
1126
1135
// channel_reestablish handling ensuring the order was sensical given the messages used).
1127
- let node_cfgs = create_node_cfgs ( 2 ) ;
1136
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
1137
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
1128
1138
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
1129
1139
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
1130
1140
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1241,7 +1251,8 @@ fn monitor_failed_no_reestablish_response() {
1241
1251
// response to a commitment_signed.
1242
1252
// Backported from chanmon_fail_consistency fuzz tests as it caught a long-standing
1243
1253
// debug_assert!() failure in channel_reestablish handling.
1244
- let node_cfgs = create_node_cfgs ( 2 ) ;
1254
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
1255
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
1245
1256
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
1246
1257
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
1247
1258
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1309,7 +1320,8 @@ fn first_message_on_recv_ordering() {
1309
1320
// have no pending response but will want to send a RAA/CS (with the updates for the second
1310
1321
// payment applied).
1311
1322
// Backported from chanmon_fail_consistency fuzz tests as it caught a bug here.
1312
- let node_cfgs = create_node_cfgs ( 2 ) ;
1323
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
1324
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
1313
1325
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
1314
1326
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
1315
1327
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1396,7 +1408,8 @@ fn test_monitor_update_fail_claim() {
1396
1408
// update to claim the payment. We then send a payment C->B->A, making the forward of this
1397
1409
// payment from B to A fail due to the paused channel. Finally, we restore the channel monitor
1398
1410
// updating and claim the payment on B.
1399
- let node_cfgs = create_node_cfgs ( 3 ) ;
1411
+ let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
1412
+ let node_cfgs = create_node_cfgs ( 3 , & chanmon_cfgs) ;
1400
1413
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
1401
1414
let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
1402
1415
let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1471,7 +1484,8 @@ fn test_monitor_update_on_pending_forwards() {
1471
1484
// We do this with a simple 3-node network, sending a payment from A to C and one from C to A.
1472
1485
// The payment from A to C will be failed by C and pending a back-fail to A, while the payment
1473
1486
// from C to A will be pending a forward to A.
1474
- let node_cfgs = create_node_cfgs ( 3 ) ;
1487
+ let chanmon_cfgs = create_chanmon_cfgs ( 3 ) ;
1488
+ let node_cfgs = create_node_cfgs ( 3 , & chanmon_cfgs) ;
1475
1489
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
1476
1490
let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
1477
1491
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1538,7 +1552,8 @@ fn monitor_update_claim_fail_no_response() {
1538
1552
// to channel being AwaitingRAA).
1539
1553
// Backported from chanmon_fail_consistency fuzz tests as an unmerged version of the handling
1540
1554
// code was broken.
1541
- let node_cfgs = create_node_cfgs ( 2 ) ;
1555
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
1556
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
1542
1557
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
1543
1558
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
1544
1559
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1599,7 +1614,8 @@ fn monitor_update_claim_fail_no_response() {
1599
1614
fn do_during_funding_monitor_fail ( fail_on_generate : bool , restore_between_fails : bool , fail_on_signed : bool , confirm_a_first : bool , restore_b_before_conf : bool ) {
1600
1615
// Test that if the monitor update generated by funding_transaction_generated fails we continue
1601
1616
// the channel setup happily after the update is restored.
1602
- let node_cfgs = create_node_cfgs ( 2 ) ;
1617
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
1618
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
1603
1619
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
1604
1620
let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
1605
1621
0 commit comments