Adjust encodable fuzz target for known differences
What changed, and why it matters
This commit only changes a fuzz testing target so it ignores additional known differences between old and new Bitcoin data decoders. It is a test-configuration update, not a fix to production code, and does not change how real transactions are validated.
No action required for security. Treat as a normal test-maintenance commit. If reviewing the broader decoder rewrite, separately verify that the new TransactionDecoder's MAX_MONEY and no-outputs checks match intended consensus behavior.
Security signals we found
The commit text mentions that the new decoder rejects transactions whose outputs exceed MAX_MONEY and transactions with zero outputs, which are consensus-relevant validation rules.
The change is confined to a fuzz-test ignore list, not a security patch.
Evidence from the diff
The patch updates fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs to broaden is_known_decoder_divergence(). It now also ignores TransactionDecoderError messages starting with ‘sum of output values’ and ‘duplicate input’, alongside the existing ‘transaction has no outputs’ and LengthPrefixExceedsMaxError. The commit documents that the new TransactionDecoder rejects zero-output transactions and transactions whose outputs exceed MAX_MONEY, while the old decoder accepted both. No consensus or production decoding logic is modified.
Changed components
fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rsInspect captured patch +9 / −5
diff --git a/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs b/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs
index 0cfbf2dd..cfb43b44 100644
--- a/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs
+++ b/fuzz/fuzz_targets/bitcoin/compare_consensus_encoding.rs
@@ -27,8 +27,9 @@ fn main() {}
/// - `LengthPrefixExceedsMaxError`: The new decoders cap collection lengths at
/// `0x2_000_000`; the old decoders only rejected values above `u64::MAX`.
///
-/// - `TransactionDecoderError` with "no outputs": The new `TransactionDecoder` rejects
-/// transactions with zero outputs; the old decoder accepted them.
+/// - `TransactionDecoderError` with "no outputs" or "sum of output values": The new
+/// `TransactionDecoder` rejects zero-output transactions and transactions whose output
+/// values sum to more than `MAX_MONEY`; the old decoder accepted both.
fn is_known_decoder_divergence(err: &(dyn std::error::Error + 'static)) -> bool {
use bitcoin::blockdata::transaction::TransactionDecoderError;
use bitcoin_consensus_encoding::LengthPrefixExceedsMaxError;
@@ -48,9 +49,12 @@ fn is_known_decoder_divergence(err: &(dyn std::error::Error + 'static)) -> bool
if e.downcast_ref::<LengthPrefixExceedsMaxError>().is_some() {
return true;
}
- if e.downcast_ref::<TransactionDecoderError>()
- .is_some_and(|e| e.to_string() == "transaction has no outputs")
- {
+ if e.downcast_ref::<TransactionDecoderError>().is_some_and(|e| {
+ let s = e.to_string();
+ s == "transaction has no outputs"
+ || s.starts_with("sum of output values ")
+ || s.starts_with("duplicate input")
+ }) {
return true;
}
current = e.source();
Why this scored 11/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.