@@ -720,10 +720,11 @@ impl SignerProvider for KeyProvider {
720720
721721// Since this fuzzer is only concerned with live-channel operations, we don't need to worry about
722722// any signer operations that come after a force close.
723- const SUPPORTED_SIGNER_OPS : [ SignerOp ; 3 ] = [
723+ const SUPPORTED_SIGNER_OPS : [ SignerOp ; 4 ] = [
724724 SignerOp :: SignCounterpartyCommitment ,
725725 SignerOp :: GetPerCommitmentPoint ,
726726 SignerOp :: ReleaseCommitmentSecret ,
727+ SignerOp :: SignSpliceSharedInput ,
727728] ;
728729
729730impl KeyProvider {
@@ -769,19 +770,19 @@ type ChanMan<'a> = ChannelManager<
769770> ;
770771
771772#[ inline]
772- fn assert_action_timeout_awaiting_response ( action : & msgs:: ErrorAction ) {
773+ fn assert_disconnect_action ( action : & msgs:: ErrorAction ) -> ( & msgs :: WarningMessage , bool ) {
773774 // Since sending/receiving messages may be delayed, `timer_tick_occurred` may cause a node to
774775 // disconnect their counterparty if they're expecting a timely response.
775- assert ! (
776- matches! (
777- action ,
778- msgs :: ErrorAction :: DisconnectPeerWithWarning { msg }
779- if msg . data . contains ( "Disconnecting due to timeout awaiting response" )
780- || msg . data . contains ( "already sent splice_locked, cannot RBF" )
781- ) ,
782- "Expected timeout disconnect, got: {:?}" ,
783- action ,
784- ) ;
776+ if let msgs :: ErrorAction :: DisconnectPeerWithWarning { ref msg } = action {
777+ let is_quiescent_msg = msg . data . contains ( "already sent splice_locked, cannot RBF" ) ;
778+ if !msg . data . contains ( "Disconnecting due to timeout awaiting response" ) && !is_quiescent_msg
779+ {
780+ panic ! ( "Unexpected disconnect case: {}" , msg . data ) ;
781+ }
782+ ( msg , is_quiescent_msg )
783+ } else {
784+ panic ! ( "Expected disconnect, got: {:?}" , action ) ;
785+ }
785786}
786787
787788#[ derive( Clone , Copy , PartialEq ) ]
@@ -1286,7 +1287,7 @@ impl EventQueues {
12861287 * node_id == a_id
12871288 } ,
12881289 MessageSendEvent :: HandleError { ref action, ref node_id } => {
1289- assert_action_timeout_awaiting_response ( action) ;
1290+ assert_disconnect_action ( action) ;
12901291 if Some ( * node_id) == expect_drop_id {
12911292 panic ! (
12921293 "peer_disconnected should drop msgs bound for the disconnected peer"
@@ -1335,7 +1336,7 @@ impl EventQueues {
13351336 MessageSendEvent :: BroadcastChannelUpdate { .. } => { } ,
13361337 MessageSendEvent :: SendChannelUpdate { .. } => { } ,
13371338 MessageSendEvent :: HandleError { ref action, .. } => {
1338- assert_action_timeout_awaiting_response ( action) ;
1339+ assert_disconnect_action ( action) ;
13391340 } ,
13401341 _ => panic ! ( "Unhandled message event" ) ,
13411342 }
@@ -1354,7 +1355,7 @@ impl EventQueues {
13541355 MessageSendEvent :: BroadcastChannelUpdate { .. } => { } ,
13551356 MessageSendEvent :: SendChannelUpdate { .. } => { } ,
13561357 MessageSendEvent :: HandleError { ref action, .. } => {
1357- assert_action_timeout_awaiting_response ( action) ;
1358+ assert_disconnect_action ( action) ;
13581359 } ,
13591360 _ => panic ! ( "Unhandled message event" ) ,
13601361 }
@@ -2645,8 +2646,16 @@ impl<'a, Out: Output + MaybeSend + MaybeSync> Harness<'a, Out> {
26452646 nodes[ dest_idx] . handle_splice_locked ( source_node_id, msg) ;
26462647 None
26472648 } ,
2648- MessageSendEvent :: HandleError { ref action, .. } => {
2649- assert_action_timeout_awaiting_response ( action) ;
2649+ MessageSendEvent :: HandleError { ref action, ref node_id, .. } => {
2650+ let ( msg, is_quiescent) = assert_disconnect_action ( action) ;
2651+ let dest_idx = log_peer_message ( node_idx, node_id, nodes, out, "warning" ) ;
2652+ if is_quiescent {
2653+ nodes[ node_idx] . node . exit_quiescence ( node_id, & msg. channel_id ) . unwrap ( ) ;
2654+ nodes[ dest_idx]
2655+ . node
2656+ . exit_quiescence ( & source_node_id, & msg. channel_id )
2657+ . unwrap ( ) ;
2658+ }
26502659 None
26512660 } ,
26522661 MessageSendEvent :: SendChannelReady { .. }
@@ -3117,59 +3126,35 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
31173126 0x89 => harness. nodes [ 2 ] . reset_fee_estimate ( ) ,
31183127
31193128 0xa0 => {
3120- if !cfg ! ( splicing) {
3121- break ' fuzz_loop;
3122- }
31233129 let cp_node_id = harness. nodes [ 1 ] . get_our_node_id ( ) ;
31243130 harness. nodes [ 0 ] . splice_in ( & cp_node_id, & harness. chan_a_id ( ) ) ;
31253131 } ,
31263132 0xa1 => {
3127- if !cfg ! ( splicing) {
3128- break ' fuzz_loop;
3129- }
31303133 let cp_node_id = harness. nodes [ 0 ] . get_our_node_id ( ) ;
31313134 harness. nodes [ 1 ] . splice_in ( & cp_node_id, & harness. chan_a_id ( ) ) ;
31323135 } ,
31333136 0xa2 => {
3134- if !cfg ! ( splicing) {
3135- break ' fuzz_loop;
3136- }
31373137 let cp_node_id = harness. nodes [ 2 ] . get_our_node_id ( ) ;
31383138 harness. nodes [ 1 ] . splice_in ( & cp_node_id, & harness. chan_b_id ( ) ) ;
31393139 } ,
31403140 0xa3 => {
3141- if !cfg ! ( splicing) {
3142- break ' fuzz_loop;
3143- }
31443141 let cp_node_id = harness. nodes [ 1 ] . get_our_node_id ( ) ;
31453142 harness. nodes [ 2 ] . splice_in ( & cp_node_id, & harness. chan_b_id ( ) ) ;
31463143 } ,
31473144
31483145 0xa4 => {
3149- if !cfg ! ( splicing) {
3150- break ' fuzz_loop;
3151- }
31523146 let cp_node_id = harness. nodes [ 1 ] . get_our_node_id ( ) ;
31533147 harness. nodes [ 0 ] . splice_out ( & cp_node_id, & harness. chan_a_id ( ) ) ;
31543148 } ,
31553149 0xa5 => {
3156- if !cfg ! ( splicing) {
3157- break ' fuzz_loop;
3158- }
31593150 let cp_node_id = harness. nodes [ 0 ] . get_our_node_id ( ) ;
31603151 harness. nodes [ 1 ] . splice_out ( & cp_node_id, & harness. chan_a_id ( ) ) ;
31613152 } ,
31623153 0xa6 => {
3163- if !cfg ! ( splicing) {
3164- break ' fuzz_loop;
3165- }
31663154 let cp_node_id = harness. nodes [ 2 ] . get_our_node_id ( ) ;
31673155 harness. nodes [ 1 ] . splice_out ( & cp_node_id, & harness. chan_b_id ( ) ) ;
31683156 } ,
31693157 0xa7 => {
3170- if !cfg ! ( splicing) {
3171- break ' fuzz_loop;
3172- }
31733158 let cp_node_id = harness. nodes [ 1 ] . get_our_node_id ( ) ;
31743159 harness. nodes [ 2 ] . splice_out ( & cp_node_id, & harness. chan_b_id ( ) ) ;
31753160 } ,
@@ -3298,6 +3283,32 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
32983283 . enable_op_for_all_signers ( SignerOp :: ReleaseCommitmentSecret ) ;
32993284 harness. nodes [ 2 ] . signer_unblocked ( None ) ;
33003285 } ,
3286+ 0xcf => {
3287+ harness. nodes [ 0 ]
3288+ . keys_manager
3289+ . enable_op_for_all_signers ( SignerOp :: SignSpliceSharedInput ) ;
3290+ harness. nodes [ 0 ] . signer_unblocked ( None ) ;
3291+ } ,
3292+ 0xd0 => {
3293+ harness. nodes [ 1 ]
3294+ . keys_manager
3295+ . enable_op_for_all_signers ( SignerOp :: SignSpliceSharedInput ) ;
3296+ let filter = Some ( ( harness. nodes [ 0 ] . get_our_node_id ( ) , harness. chan_a_id ( ) ) ) ;
3297+ harness. nodes [ 1 ] . signer_unblocked ( filter) ;
3298+ } ,
3299+ 0xd1 => {
3300+ harness. nodes [ 1 ]
3301+ . keys_manager
3302+ . enable_op_for_all_signers ( SignerOp :: SignSpliceSharedInput ) ;
3303+ let filter = Some ( ( harness. nodes [ 2 ] . get_our_node_id ( ) , harness. chan_b_id ( ) ) ) ;
3304+ harness. nodes [ 1 ] . signer_unblocked ( filter) ;
3305+ } ,
3306+ 0xd2 => {
3307+ harness. nodes [ 2 ]
3308+ . keys_manager
3309+ . enable_op_for_all_signers ( SignerOp :: SignSpliceSharedInput ) ;
3310+ harness. nodes [ 2 ] . signer_unblocked ( None ) ;
3311+ } ,
33013312
33023313 0xf0 => harness. ab_link . complete_monitor_updates_for_node (
33033314 0 ,
0 commit comments