@@ -19,7 +19,8 @@ use ln::functional_test_utils::*;
1919#[ test]
2020fn test_simple_monitor_permanent_update_fail ( ) {
2121 // 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) ;
2324 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
2425 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
2526 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -51,7 +52,8 @@ fn test_simple_monitor_permanent_update_fail() {
5152fn do_test_simple_monitor_temporary_update_fail ( disconnect : bool ) {
5253 // Test that we can recover from a simple temporary monitor update failure optionally with
5354 // 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) ;
5557 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
5658 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
5759 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) {
152154 // * We then walk through more message exchanges to get the original update_add_htlc
153155 // through, swapping message ordering based on disconnect_count & 8 and optionally
154156 // 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) ;
156159 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
157160 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
158161 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -480,7 +483,8 @@ fn test_monitor_temporary_update_fail_c() {
480483#[ test]
481484fn test_monitor_update_fail_cs ( ) {
482485 // 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) ;
484488 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
485489 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
486490 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -561,7 +565,8 @@ fn test_monitor_update_fail_no_rebroadcast() {
561565 // Tests handling of a monitor update failure when no message rebroadcasting on
562566 // test_restore_channel_monitor() is required. Backported from
563567 // 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) ;
565570 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
566571 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
567572 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -605,7 +610,8 @@ fn test_monitor_update_fail_no_rebroadcast() {
605610fn test_monitor_update_raa_while_paused ( ) {
606611 // Tests handling of an RAA while monitor updating has already been marked failed.
607612 // 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) ;
609615 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
610616 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
611617 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -674,7 +680,8 @@ fn test_monitor_update_raa_while_paused() {
674680
675681fn do_test_monitor_update_fail_raa ( test_ignore_second_cs : bool ) {
676682 // 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) ;
678685 let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
679686 let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
680687 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -929,7 +936,8 @@ fn test_monitor_update_fail_reestablish() {
929936 // Simple test for message retransmission after monitor update failure on
930937 // channel_reestablish generating a monitor update (which comes from freeing holding cell
931938 // 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) ;
933941 let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
934942 let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
935943 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1009,7 +1017,8 @@ fn raa_no_response_awaiting_raa_state() {
10091017 // due to a previous monitor update failure, we still set AwaitingRemoteRevoke on the channel
10101018 // in question (assuming it intends to respond with a CS after monitor updating is restored).
10111019 // 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) ;
10131022 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
10141023 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
10151024 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1124,7 +1133,8 @@ fn claim_while_disconnected_monitor_update_fail() {
11241133 // Backported from chanmon_fail_consistency fuzz tests as an unmerged version of the handling
11251134 // code introduced a regression in this test (specifically, this caught a removal of the
11261135 // 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) ;
11281138 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
11291139 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
11301140 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1241,7 +1251,8 @@ fn monitor_failed_no_reestablish_response() {
12411251 // response to a commitment_signed.
12421252 // Backported from chanmon_fail_consistency fuzz tests as it caught a long-standing
12431253 // 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) ;
12451256 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
12461257 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
12471258 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1309,7 +1320,8 @@ fn first_message_on_recv_ordering() {
13091320 // have no pending response but will want to send a RAA/CS (with the updates for the second
13101321 // payment applied).
13111322 // 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) ;
13131325 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
13141326 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
13151327 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1396,7 +1408,8 @@ fn test_monitor_update_fail_claim() {
13961408 // update to claim the payment. We then send a payment C->B->A, making the forward of this
13971409 // payment from B to A fail due to the paused channel. Finally, we restore the channel monitor
13981410 // 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) ;
14001413 let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
14011414 let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
14021415 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() {
14711484 // We do this with a simple 3-node network, sending a payment from A to C and one from C to A.
14721485 // The payment from A to C will be failed by C and pending a back-fail to A, while the payment
14731486 // 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) ;
14751489 let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
14761490 let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
14771491 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1538,7 +1552,8 @@ fn monitor_update_claim_fail_no_response() {
15381552 // to channel being AwaitingRAA).
15391553 // Backported from chanmon_fail_consistency fuzz tests as an unmerged version of the handling
15401554 // 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) ;
15421557 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
15431558 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
15441559 create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
@@ -1599,7 +1614,8 @@ fn monitor_update_claim_fail_no_response() {
15991614fn 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 ) {
16001615 // Test that if the monitor update generated by funding_transaction_generated fails we continue
16011616 // 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) ;
16031619 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
16041620 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
16051621
0 commit comments