Skip to content

Commit e575804

Browse files
committed
Gate chanmon splice fuzz ops on cfg
Restore cfg(splicing) to the fuzz check-cfg allow list and gate chanmon consistency splice opcodes on that cfg again. Without the cfg, those inputs stop before executing splice-specific operations.
1 parent ac2c6a8 commit e575804

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

fuzz/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,6 @@ check-cfg = [
4343
"cfg(fuzzing)",
4444
"cfg(secp256k1_fuzz)",
4545
"cfg(hashes_fuzz)",
46+
"cfg(splicing)",
4647
"cfg(chacha20_poly1305_fuzz)"
4748
]

fuzz/src/chanmon_consistency.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3610,35 +3610,59 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
36103610
},
36113611

36123612
0xa0 => {
3613+
if !cfg!(splicing) {
3614+
break 'fuzz_loop;
3615+
}
36133616
let cp_node_id = harness.nodes[1].get_our_node_id();
36143617
harness.nodes[0].splice_in(&cp_node_id, &harness.chan_a_id());
36153618
},
36163619
0xa1 => {
3620+
if !cfg!(splicing) {
3621+
break 'fuzz_loop;
3622+
}
36173623
let cp_node_id = harness.nodes[0].get_our_node_id();
36183624
harness.nodes[1].splice_in(&cp_node_id, &harness.chan_a_id());
36193625
},
36203626
0xa2 => {
3627+
if !cfg!(splicing) {
3628+
break 'fuzz_loop;
3629+
}
36213630
let cp_node_id = harness.nodes[2].get_our_node_id();
36223631
harness.nodes[1].splice_in(&cp_node_id, &harness.chan_b_id());
36233632
},
36243633
0xa3 => {
3634+
if !cfg!(splicing) {
3635+
break 'fuzz_loop;
3636+
}
36253637
let cp_node_id = harness.nodes[1].get_our_node_id();
36263638
harness.nodes[2].splice_in(&cp_node_id, &harness.chan_b_id());
36273639
},
36283640

36293641
0xa4 => {
3642+
if !cfg!(splicing) {
3643+
break 'fuzz_loop;
3644+
}
36303645
let cp_node_id = harness.nodes[1].get_our_node_id();
36313646
harness.nodes[0].splice_out(&cp_node_id, &harness.chan_a_id());
36323647
},
36333648
0xa5 => {
3649+
if !cfg!(splicing) {
3650+
break 'fuzz_loop;
3651+
}
36343652
let cp_node_id = harness.nodes[0].get_our_node_id();
36353653
harness.nodes[1].splice_out(&cp_node_id, &harness.chan_a_id());
36363654
},
36373655
0xa6 => {
3656+
if !cfg!(splicing) {
3657+
break 'fuzz_loop;
3658+
}
36383659
let cp_node_id = harness.nodes[2].get_our_node_id();
36393660
harness.nodes[1].splice_out(&cp_node_id, &harness.chan_b_id());
36403661
},
36413662
0xa7 => {
3663+
if !cfg!(splicing) {
3664+
break 'fuzz_loop;
3665+
}
36423666
let cp_node_id = harness.nodes[1].get_our_node_id();
36433667
harness.nodes[2].splice_out(&cp_node_id, &harness.chan_b_id());
36443668
},

0 commit comments

Comments
 (0)