Skip Encode/Decode Mutations that hang
What changed, and why it matters
This change only updates the project's mutation-testing configuration file. It tells the cargo-mutants tool to skip generating certain test mutants for encoding/decoding methods because those artificial mutations would make the test suite hang. It does not change any production code, protocol behavior, or security-relevant logic.
No security action needed. This is a testing-tool configuration change with no effect on runtime code or dependencies.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds three exclude_re entries to .cargo/mutants.toml so cargo-mutants will not mutate WitnessesEncoder::advance, WitnessEncoder::advance, and WitnessDecoder::push_bytes. The comments explain that replacing return values or comparisons in these methods causes infinite loops during mutation testing. The actual source code of those methods is untouched.
Changed components
.cargo/mutants.tomlInspect captured patch +3 / −0
diff --git a/.cargo/mutants.toml b/.cargo/mutants.toml
index c3dbc2e3..ef425ab7 100644
--- a/.cargo/mutants.toml
+++ b/.cargo/mutants.toml
@@ -54,6 +54,9 @@ exclude_re = [
"primitives/.* <impl Decoder for WitnessDecoder>::push_bytes", # Replacing == with != causes an infinite loop
"primitives/.* WitnessDecoder::resize_if_needed", # Replacing *= with += still resizes the buffer making the mutant untestable.
"primitives/.* WitnessDecoder::reserve_batch", # Mutations cause an infinite loop
+ "primitives/.* <impl encoding::Encoder for WitnessesEncoder<'_>>::advance -> bool", # Replacing with `true` cause an infinite loop
+ "primitives/.* <impl encoding::Encoder for WitnessEncoder<'_>>::advance -> bool", # Replacing with `true` cause an infinite loop
+ "primitives/.* == with != in <impl encoding::Decoder for WitnessDecoder>::push_bytes", # Replacing == with != causes an infinite loop
"primitives/.* replace \\+ with \\* in MerkleNode::calculate_root", # Replacing + with * causes an infinite loop
"primitives/.* replace == with != in MerkleNode::calculate_root", # Replacing == with != isn't caught unless alloc is disabled.
# TODO: remove after x86 SIMD support lands (https://github.com/rust-bitcoin/rust-bitcoin/issues/5540)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.