Skip to content

Fuzz

Fuzz #7

# Automatically generated by fuzz/generate-files.sh
name: Fuzz
on:
schedule:
# 5am every day UTC, this correlates to:
# - 10pm PDT
# - 6am CET
# - 4pm AEDT
- cron: '00 05 * * *'
permissions: {}
jobs:
fuzz:
if: ${{ !github.event.act }}
runs-on: ubuntu-24.04
permissions:
contents: read
strategy:
fail-fast: false
matrix:
# We only get 20 jobs at a time, we probably don't want to go
# over that limit with fuzzing because of the hour run time.
fuzz_target: [
bitcoin_arbitrary_block,
bitcoin_arbitrary_script,
bitcoin_arbitrary_transaction,
bitcoin_arbitrary_witness,
bitcoin_deserialize_block,
bitcoin_deserialize_prefilled_transaction,
bitcoin_deserialize_psbt,
bitcoin_deserialize_script,
bitcoin_deserialize_transaction,
bitcoin_deserialize_witness,
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,
hashes_sha256,
hashes_sha512,
hashes_sha512_256,
p2p_arbitrary_addrv2,
p2p_deserialize_addrv2,
p2p_deserialize_raw_net_msg,
units_arbitrary_weight,
units_parse_amount,
units_parse_int,
units_standard_checks,
]
steps:
- name: Install test dependencies
run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: cache-fuzz
with:
path: |
~/.cargo/bin
fuzz/target
target
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
with:
toolchain: '1.74.0'
- name: fuzz
run: |
if [[ "${{ matrix.fuzz_target }}" =~ ^bitcoin ]]; then
export RUSTFLAGS='--cfg=hashes_fuzz --cfg=secp256k1_fuzz'
fi
echo "Using RUSTFLAGS $RUSTFLAGS"
cd fuzz && ./fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: executed_${{ matrix.fuzz_target }}
path: executed_${{ matrix.fuzz_target }}
verify-execution:
if: ${{ !github.event.act }}
needs: fuzz
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
- name: Display structure of downloaded files
run: ls -R
- run: find executed_* -type f -exec cat {} + | sort > executed
- run: source ./fuzz/fuzz-util.sh && listTargetNames | sort | diff - executed