Skip to content

Commit a2dc179

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 467cd0b commit a2dc179

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
@@ -3200,35 +3200,59 @@ pub fn do_test<Out: Output + MaybeSend + MaybeSync>(data: &[u8], out: Out) {
32003200
},
32013201

32023202
0xa0 => {
3203+
if !cfg!(splicing) {
3204+
break 'fuzz_loop;
3205+
}
32033206
let cp_node_id = harness.nodes[1].get_our_node_id();
32043207
harness.nodes[0].splice_in(&cp_node_id, &harness.chan_a_id());
32053208
},
32063209
0xa1 => {
3210+
if !cfg!(splicing) {
3211+
break 'fuzz_loop;
3212+
}
32073213
let cp_node_id = harness.nodes[0].get_our_node_id();
32083214
harness.nodes[1].splice_in(&cp_node_id, &harness.chan_a_id());
32093215
},
32103216
0xa2 => {
3217+
if !cfg!(splicing) {
3218+
break 'fuzz_loop;
3219+
}
32113220
let cp_node_id = harness.nodes[2].get_our_node_id();
32123221
harness.nodes[1].splice_in(&cp_node_id, &harness.chan_b_id());
32133222
},
32143223
0xa3 => {
3224+
if !cfg!(splicing) {
3225+
break 'fuzz_loop;
3226+
}
32153227
let cp_node_id = harness.nodes[1].get_our_node_id();
32163228
harness.nodes[2].splice_in(&cp_node_id, &harness.chan_b_id());
32173229
},
32183230

32193231
0xa4 => {
3232+
if !cfg!(splicing) {
3233+
break 'fuzz_loop;
3234+
}
32203235
let cp_node_id = harness.nodes[1].get_our_node_id();
32213236
harness.nodes[0].splice_out(&cp_node_id, &harness.chan_a_id());
32223237
},
32233238
0xa5 => {
3239+
if !cfg!(splicing) {
3240+
break 'fuzz_loop;
3241+
}
32243242
let cp_node_id = harness.nodes[0].get_our_node_id();
32253243
harness.nodes[1].splice_out(&cp_node_id, &harness.chan_a_id());
32263244
},
32273245
0xa6 => {
3246+
if !cfg!(splicing) {
3247+
break 'fuzz_loop;
3248+
}
32283249
let cp_node_id = harness.nodes[2].get_our_node_id();
32293250
harness.nodes[1].splice_out(&cp_node_id, &harness.chan_b_id());
32303251
},
32313252
0xa7 => {
3253+
if !cfg!(splicing) {
3254+
break 'fuzz_loop;
3255+
}
32323256
let cp_node_id = harness.nodes[1].get_our_node_id();
32333257
harness.nodes[2].splice_out(&cp_node_id, &harness.chan_b_id());
32343258
},

0 commit comments

Comments
 (0)