fuzz: Update generate_files.sh for current targets
What changed, and why it matters
This commit is a routine maintenance update to the project's fuzz-testing infrastructure. It adds newly-created fuzz test targets to a script that auto-generates configuration files, and refreshes the generated files to match. There is no change to the actual Bitcoin library code that users rely on, and no security fix or vulnerability is present.
No security action required. This is a normal project hygiene commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit updates fuzz/generate-files.sh to include the consensus_encoding crate dependency and new Clippy lints, regenerates fuzz/Cargo.toml, and updates .github/workflows/cron-daily-fuzz.yml to list the new fuzz targets and bump the Rust toolchain from 1.65.0 to 1.74.0. It also adds a permissions: contents: read declaration to the CI job. These are build/CI-only changes; no runtime code is modified.
Changed components
fuzz/generate-files.shfuzz/Cargo.toml.github/workflows/cron-daily-fuzz.ymlInspect captured patch +29 / −17
diff --git a/.github/workflows/cron-daily-fuzz.yml b/.github/workflows/cron-daily-fuzz.yml
index b0427b44..50658c9f 100644
--- a/.github/workflows/cron-daily-fuzz.yml
+++ b/.github/workflows/cron-daily-fuzz.yml
@@ -34,6 +34,10 @@ jobs:
bitcoin_parse_address,
bitcoin_parse_outpoint,
bitcoin_script_bytes_to_asm_fmt,
+ consensus_encoding_decode_array,
+ consensus_encoding_decode_byte_vec,
+ consensus_encoding_decode_compact_size,
+ consensus_encoding_decode_decoder2,
hashes_json,
hashes_ripemd160,
hashes_sha1,
@@ -55,6 +59,7 @@ jobs:
with:
persist-credentials: false
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
+
id: cache-fuzz
with:
path: |
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 2b6c372b..4c6ee387 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -79,6 +79,22 @@ path = "fuzz_targets/bitcoin/parse_outpoint.rs"
name = "bitcoin_script_bytes_to_asm_fmt"
path = "fuzz_targets/bitcoin/script_bytes_to_asm_fmt.rs"
+[[bin]]
+name = "consensus_encoding_decode_array"
+path = "fuzz_targets/consensus_encoding/decode_array.rs"
+
+[[bin]]
+name = "consensus_encoding_decode_byte_vec"
+path = "fuzz_targets/consensus_encoding/decode_byte_vec.rs"
+
+[[bin]]
+name = "consensus_encoding_decode_compact_size"
+path = "fuzz_targets/consensus_encoding/decode_compact_size.rs"
+
+[[bin]]
+name = "consensus_encoding_decode_decoder2"
+path = "fuzz_targets/consensus_encoding/decode_decoder2.rs"
+
[[bin]]
name = "hashes_json"
path = "fuzz_targets/hashes/json.rs"
@@ -127,22 +143,6 @@ path = "fuzz_targets/units/parse_amount.rs"
name = "units_parse_int"
path = "fuzz_targets/units/parse_int.rs"
-[[bin]]
-name = "consensus_encoding_decode_array"
-path = "fuzz_targets/consensus_encoding/decode_array.rs"
-
-[[bin]]
-name = "consensus_encoding_decode_compact_size"
-path = "fuzz_targets/consensus_encoding/decode_compact_size.rs"
-
-[[bin]]
-name = "consensus_encoding_decode_decoder2"
-path = "fuzz_targets/consensus_encoding/decode_decoder2.rs"
-
-[[bin]]
-name = "consensus_encoding_decode_byte_vec"
-path = "fuzz_targets/consensus_encoding/decode_byte_vec.rs"
-
[[bin]]
name = "units_standard_checks"
path = "fuzz_targets/units/standard_checks.rs"
diff --git a/fuzz/generate-files.sh b/fuzz/generate-files.sh
index c0c9cb5f..4d438237 100755
--- a/fuzz/generate-files.sh
+++ b/fuzz/generate-files.sh
@@ -25,6 +25,7 @@ cargo-fuzz = true
honggfuzz = { version = "0.5.58", default-features = false }
bitcoin = { path = "../bitcoin", features = [ "serde", "arbitrary" ] }
p2p = { path = "../p2p", package = "bitcoin-p2p-messages", features = ["arbitrary"] }
+bitcoin_consensus_encoding = { path = "../consensus_encoding", package = "bitcoin-consensus-encoding" }
arbitrary = { version = "1.4.1" }
serde = { version = "1.0.195", features = [ "derive" ] }
@@ -33,6 +34,10 @@ standard_test = "0.1.0"
[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(fuzzing)'] }
+
+[lints.clippy]
+redundant_clone = "warn"
+use_self = "warn"
EOF
for targetFile in $(listTargetFiles); do
@@ -89,7 +94,7 @@ $(for name in $(listTargetNames); do echo " $name,"; done)
key: cache-\${{ matrix.target }}-\${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
with:
- toolchain: '1.65.0'
+ toolchain: '1.74.0'
- name: fuzz
run: |
if [[ "\${{ matrix.fuzz_target }}" =~ ^bitcoin ]]; then
@@ -107,6 +112,8 @@ $(for name in $(listTargetNames); do echo " $name,"; done)
if: \${{ !github.event.act }}
needs: fuzz
runs-on: ubuntu-24.04
+ permissions:
+ contents: read
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
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.