What changed, and why it matters
This commit simply renames a fuzz-testing helper script from `generate-files.sh` to `generate-bins.sh` and updates the comments and README that reference it. The script's behavior is unchanged. There is no effect on the actual Bitcoin library code or on security.
No action required; this is a non-functional rename.
Security signals we found
No strong security signals were identified.
Evidence from the diff
A pure refactor in the fuzz/ directory: generate-files.sh is renamed to generate-bins.sh, references in fuzz/Cargo.toml, fuzz/README.md, and fuzz/generate-encoding-roundtrip.sh are updated, and trailing whitespace is removed from one README line. The shell script still discovers fuzz targets and regenerates the [[bin]] sections of fuzz/Cargo.toml exactly as before. No library code, dependencies, or build logic are modified.
Changed components
fuzz/generate-bins.sh (renamed from fuzz/generate-files.sh)fuzz/Cargo.toml (comment only)fuzz/README.md (documentation only)fuzz/generate-encoding-roundtrip.sh (comment only)Inspect captured patch +44 / −47
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 5f3f5c7b..a2e80638 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -1,12 +1,12 @@
# The fuzz target [[bin]]s in this manifest are managed
-# by the ./generate-files.sh script.
+# by the ./generate-bins.sh script.
[package]
name = "bitcoin-fuzz"
edition = "2021"
rust-version = "1.74.0"
version = "0.0.1"
-authors = ["Generated by fuzz/generate-files.sh"]
+authors = ["Generated by fuzz/generate-bins.sh"]
publish = false
[package.metadata]
diff --git a/fuzz/README.md b/fuzz/README.md
index 001f1ef0..448bfc99 100644
--- a/fuzz/README.md
+++ b/fuzz/README.md
@@ -65,7 +65,7 @@ you will need to implement a custom harness.
To run a single fuzztest indefinitely, run
```bash
-cargo +nightly fuzz run "<target>"
+cargo +nightly fuzz run "<target>"
```
## Adding fuzz tests
@@ -77,14 +77,11 @@ function to do what you want.
If your test clearly belongs to a specific crate, please put it in that
crate's directory. Otherwise, you can put it directly in `fuzz_target/`.
-If you need to add dependencies, edit the file `generate-files.sh` to add
-it to the generated `Cargo.toml`.
-
-Once you've added a fuzztest, regenerate the `Cargo.toml` and CI job by
-running
+Once you've added a fuzztest, regenerate the `[[bins]]` section in the
+`Cargo.toml` manifest by running
```bash
-./generate-files.sh
+./generate-bins.sh
```
Then to test your fuzztest, run
diff --git a/fuzz/generate-bins.sh b/fuzz/generate-bins.sh
new file mode 100755
index 00000000..96210345
--- /dev/null
+++ b/fuzz/generate-bins.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+#
+# Discovers the [[bin]] fuzz targets for the fuzz/Cargo.toml,
+# while preserving the rest of the manifest.
+
+set -euo pipefail
+
+REPO_DIR=$(git rev-parse --show-toplevel)
+
+# can't find the file because of the ENV var
+# shellcheck source=/dev/null
+source "$REPO_DIR/fuzz/fuzz-util.sh"
+source "$REPO_DIR/fuzz/generate-encoding-roundtrip.sh"
+
+CARGO_TOML="$REPO_DIR/fuzz/Cargo.toml"
+CARGO_TOML_TMP=$(mktemp)
+# Ensure cleanup on exit.
+trap 'rm -f "$CARGO_TOML_TMP"' EXIT
+
+# Extract the unmanged part of the manifest (everything before the first [[bin]]).
+awk '/^\[\[bin\]\]/{exit} {print}' "$CARGO_TOML" > "$CARGO_TOML_TMP"
+
+# Generate the [[bin]] sections.
+for targetFile in $(listTargetFiles); do
+ targetName=$(targetFileToName "$targetFile")
+ cat >> "$CARGO_TOML_TMP" <<EOF
+[[bin]]
+name = "$targetName"
+path = "$targetFile"
+test = false
+doc = false
+bench = false
+
+EOF
+done
+
+mv "$CARGO_TOML_TMP" "$CARGO_TOML"
diff --git a/fuzz/generate-encoding-roundtrip.sh b/fuzz/generate-encoding-roundtrip.sh
index 8251aadb..08a2632d 100755
--- a/fuzz/generate-encoding-roundtrip.sh
+++ b/fuzz/generate-encoding-roundtrip.sh
@@ -3,7 +3,7 @@
# Generates one fuzz target file per Encodable/Decodable type under
# fuzz_targets/bitcoin/encoding_roundtrip/.
#
-# After running this script, re-run fuzz/generate-files.sh to update Cargo.toml
+# After running this script, re-run fuzz/generate-bins.sh to update Cargo.toml
# and the fuzz CI workflow.
set -euo pipefail
diff --git a/fuzz/generate-files.sh b/fuzz/generate-files.sh
deleted file mode 100755
index 96210345..00000000
--- a/fuzz/generate-files.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env bash
-#
-# Discovers the [[bin]] fuzz targets for the fuzz/Cargo.toml,
-# while preserving the rest of the manifest.
-
-set -euo pipefail
-
-REPO_DIR=$(git rev-parse --show-toplevel)
-
-# can't find the file because of the ENV var
-# shellcheck source=/dev/null
-source "$REPO_DIR/fuzz/fuzz-util.sh"
-source "$REPO_DIR/fuzz/generate-encoding-roundtrip.sh"
-
-CARGO_TOML="$REPO_DIR/fuzz/Cargo.toml"
-CARGO_TOML_TMP=$(mktemp)
-# Ensure cleanup on exit.
-trap 'rm -f "$CARGO_TOML_TMP"' EXIT
-
-# Extract the unmanged part of the manifest (everything before the first [[bin]]).
-awk '/^\[\[bin\]\]/{exit} {print}' "$CARGO_TOML" > "$CARGO_TOML_TMP"
-
-# Generate the [[bin]] sections.
-for targetFile in $(listTargetFiles); do
- targetName=$(targetFileToName "$targetFile")
- cat >> "$CARGO_TOML_TMP" <<EOF
-[[bin]]
-name = "$targetName"
-path = "$targetFile"
-test = false
-doc = false
-bench = false
-
-EOF
-done
-
-mv "$CARGO_TOML_TMP" "$CARGO_TOML"
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.