]> git.bitcoin.ninja Git - rust-lightning/commitdiff
[fuzz] Allow SendAnnouncementSigs events in chanmon_consistency
authorMatt Corallo <git@bluematt.me>
Tue, 24 Nov 2020 00:12:31 +0000 (19:12 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 1 Mar 2021 02:03:18 +0000 (21:03 -0500)
Because of the merge between peer reconnection and channel monitor
updating channel restoration code, we now sometimes generate
(somewhat spurious) announcement signatures when restoring channel
monitor updating. This should not result in a fuzzing failure.

fuzz/src/chanmon_consistency.rs

index 52d2f59d5389b208df84ff5d835313b0af2e6cbf..43600bde221cf4fb77bab59823adccb31aa4ea09 100644 (file)
@@ -624,6 +624,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                                events::MessageSendEvent::SendFundingLocked { .. } => {
                                                        // Can be generated as a reestablish response
                                                },
+                                               events::MessageSendEvent::SendAnnouncementSignatures { .. } => {
+                                                       // Can be generated as a reestablish response
+                                               },
                                                events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => {
                                                        // Can be generated due to a payment forward being rejected due to a
                                                        // channel having previously failed a monitor update
@@ -644,6 +647,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                                        events::MessageSendEvent::SendRevokeAndACK { .. } => {},
                                                        events::MessageSendEvent::SendChannelReestablish { .. } => {},
                                                        events::MessageSendEvent::SendFundingLocked { .. } => {},
+                                                       events::MessageSendEvent::SendAnnouncementSignatures { .. } => {},
                                                        events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => {},
                                                        _ => panic!("Unhandled message event"),
                                                }
@@ -656,6 +660,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                                        events::MessageSendEvent::SendRevokeAndACK { .. } => {},
                                                        events::MessageSendEvent::SendChannelReestablish { .. } => {},
                                                        events::MessageSendEvent::SendFundingLocked { .. } => {},
+                                                       events::MessageSendEvent::SendAnnouncementSignatures { .. } => {},
                                                        events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => {},
                                                        _ => panic!("Unhandled message event"),
                                                }
@@ -677,6 +682,7 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
                                                        if *node_id != drop_node_id { true } else { false }
                                                },
                                                events::MessageSendEvent::SendFundingLocked { .. } => false,
+                                               events::MessageSendEvent::SendAnnouncementSignatures { .. } => false,
                                                events::MessageSendEvent::PaymentFailureNetworkUpdate { .. } => false,
                                                _ => panic!("Unhandled message event"),
                                        };