← Back to Pull requests

.github/workflows: nightly fuzzing that keeps its corpus #39

Open
AskAlexSharov opened this pull request with 129 lines diff across 1 files
View on GitHub
AskAlexSharov AskAlexSharov commented on Nov 26, 2026 09:06 UTC
Author

Problem

The fuzz steps in CI run 20 s per target and never grow the corpus: nothing saves it between runs, so the search never gets deeper than one short run.

Fix

A nightly job fuzzes each target for 30 min on each CPU implementation (amd64 BMI2, arm64 SHA3). Each run continues from the corpus the previous run saved as an artifact, and saves the grown corpus back. A crash uploads its reproducer, and a failed nightly run opens or updates a nightly-fuzz issue.

Cost

About 2 runner-hours a night on GitHub-hosted runners. The 20 s PR fuzz steps stay as they are.

Diff: 129 lines (+129 / -0) across 1 files Reviewer: AskAlexSharov Review duration: 14107m
All Vouch review confidence checks passed
Residual risk 0.07 = Change Risk (0.46) × (1 − Review Confidence (0.84)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 129 lines diff across 1 files
0.46
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.91 · 5 substantive comment(s)
0.91
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
83%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.291
Self Review self_review
0.140
Real PR Conversation Timeline
23 items
Copilot Copilot commented on code on Nov 26, 2026 09:10 UTC
Code Review
.github/workflows/fuzz.yml:1
@@ -0,0 +1,114 @@
+name: Fuzz
+
+# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
+# from the seeds on every run; this nightly job continues from the corpus the
+# previous run left, so the search goes deeper each night.
+
+on:
+  schedule:
+    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
+  workflow_dispatch:
+    inputs:
+      fuzztime:
+        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
+        required: false
+        default: '30m'
+
+defaults:
+  run:
+    shell: bash
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  fuzz:
+    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
+    permissions:
+      contents: read
+      actions: read
+    timeout-minutes: 70
+    strategy:
+      fail-fast: false
+      matrix:
+        # Each runner fuzzes a different implementation (see ci.yml).
+        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
+        fn: [FuzzSum256, FuzzWriteChunks]
+    runs-on: ${{ matrix.os }}
+    env:
+      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
+    steps:
+      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+        with:
+          persist-credentials: false
+      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
+        with:
+          go-version-file: go.mod
+          cache: false
+
+      # The Actions cache cannot update an entry once saved and evicts idle ones, so
+      # the corpus lives in artifacts: each run continues from the newest one of its
+      # branch (forks excluded). A failure here stops the leg, because fuzzing from an
+      # empty corpus would replace the kept one.
+      - name: Restore fuzz corpus
+        id: restore
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          corpus="$(go env GOCACHE)/fuzz"
+          mkdir -p "$corpus"
+          echo "CORPUS=$corpus" >> "$GITHUB_ENV"
+          run=$(gh api "repos/$GITHUB_REPOSITORY/actions/artifacts?name=$NAME&per_page=100" \
+            --jq '[.artifacts[] | select(.expired | not) | select(.workflow_run.head_branch == env.GITHUB_REF_NAME and .workflow_run.head_repository_id == .workflow_run.repository_id)] | sort_by(.created_at) | last | .workflow_run.id // empty')

The branch filter only sees the first 100 artifacts with this name. If other branches produce 100 newer artifacts, an unexpired corpus for the current branch is missed, so the job starts from seeds and saves a fresh corpus instead. Paginate the listing and select the newest matching artifact across all pages.

Copilot Copilot commented on code on Nov 26, 2026 09:10 UTC
Code Review
.github/workflows/fuzz.yml:1
@@ -0,0 +1,114 @@
+name: Fuzz
+
+# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
+# from the seeds on every run; this nightly job continues from the corpus the
+# previous run left, so the search goes deeper each night.
+
+on:
+  schedule:
+    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
+  workflow_dispatch:
+    inputs:
+      fuzztime:
+        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
+        required: false
+        default: '30m'
+
+defaults:
+  run:
+    shell: bash
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  fuzz:
+    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
+    permissions:
+      contents: read
+      actions: read
+    timeout-minutes: 70
+    strategy:
+      fail-fast: false
+      matrix:
+        # Each runner fuzzes a different implementation (see ci.yml).
+        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
+        fn: [FuzzSum256, FuzzWriteChunks]
+    runs-on: ${{ matrix.os }}
+    env:
+      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
+    steps:
+      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+        with:
+          persist-credentials: false
+      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
+        with:
+          go-version-file: go.mod
+          cache: false
+
+      # The Actions cache cannot update an entry once saved and evicts idle ones, so
+      # the corpus lives in artifacts: each run continues from the newest one of its
+      # branch (forks excluded). A failure here stops the leg, because fuzzing from an
+      # empty corpus would replace the kept one.
+      - name: Restore fuzz corpus
+        id: restore
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          corpus="$(go env GOCACHE)/fuzz"
+          mkdir -p "$corpus"
+          echo "CORPUS=$corpus" >> "$GITHUB_ENV"
+          run=$(gh api "repos/$GITHUB_REPOSITORY/actions/artifacts?name=$NAME&per_page=100" \
+            --jq '[.artifacts[] | select(.expired | not) | select(.workflow_run.head_branch == env.GITHUB_REF_NAME and .workflow_run.head_repository_id == .workflow_run.repository_id)] | sort_by(.created_at) | last | .workflow_run.id // empty')

gh api --jq uses an embedded jq evaluator that does not load the process environment, so env.GITHUB_REF_NAME is null rather than the current branch name. The branch filter therefore discards the saved artifacts, and every nightly run starts from seeds again. Pipe the API response to jq and pass the branch explicitly with --arg so the corpus can actually be restored.

copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 26, 2026 09:10 UTC
Reviewer

<!-- ccr-overview-v2 -->

🟡 Changes recommended

The corpus restore workflow filters on an unavailable branch environment value and searches only the first 100 artifacts, causing nightly runs to miss saved corpora and restart from seeds.

<details open>
<summary><strong>2 open issues</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Paginate artifact listings to find the newest matching corpus · New

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Pass the branch name into jq to restore the saved corpus · New

  • </details>

    <details>
    <summary><strong>What changed in this PR</strong></summary>

    Adds nightly fuzzing that preserves its corpus between runs, complementing the existing short CI fuzz checks.

    Changes:

  • Runs two fuzz targets for 30 minutes each across three CPU implementations.

  • Restores branch-specific corpus artifacts and saves accumulated inputs for subsequent runs.

  • Uploads crash reproducers and supports manually configured fuzz durations.
  • | File | Description |
    | ---- | ----------- |
    | .github/​workflows/​fuzz.yml | Adds scheduled and manual fuzzing with corpus persistence and crash artifact uploads. |
    </details>

    <sub>Review effort: Balanced</sub>

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 26, 2026 09:14 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🔵 Needs a closer look

    The artifact lookup checks only the first 100 results, potentially missing an unexpired branch corpus and replacing its accumulated fuzzing data with a seed-only restart.

    <details open>
    <summary><strong>2 open issues</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Pass the branch name into jq to restore the saved corpus

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Paginate artifact listings to find the newest matching corpus

  • </details>

    <sub>Review effort: Balanced</sub>

    AskAlexSharov AskAlexSharov commented on code on Nov 26, 2026 09:23 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,114 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
    +        fn: [FuzzSum256, FuzzWriteChunks]
    +    runs-on: ${{ matrix.os }}
    +    env:
    +      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
    +    steps:
    +      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
    +        with:
    +          persist-credentials: false
    +      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
    +        with:
    +          go-version-file: go.mod
    +          cache: false
    +
    +      # The Actions cache cannot update an entry once saved and evicts idle ones, so
    +      # the corpus lives in artifacts: each run continues from the newest one of its
    +      # branch (forks excluded). A failure here stops the leg, because fuzzing from an
    +      # empty corpus would replace the kept one.
    +      - name: Restore fuzz corpus
    +        id: restore
    +        env:
    +          GH_TOKEN: ${{ github.token }}
    +        run: |
    +          corpus="$(go env GOCACHE)/fuzz"
    +          mkdir -p "$corpus"
    +          echo "CORPUS=$corpus" >> "$GITHUB_ENV"
    +          run=$(gh api "repos/$GITHUB_REPOSITORY/actions/artifacts?name=$NAME&per_page=100" \
    +            --jq '[.artifacts[] | select(.expired | not) | select(.workflow_run.head_branch == env.GITHUB_REF_NAME and .workflow_run.head_repository_id == .workflow_run.repository_id)] | sort_by(.created_at) | last | .workflow_run.id // empty')

    Fixed in 36074bc1ea: the lookup now pages through every artifact with this name and takes the newest match. Checked against Erigon's nightly corpus artifacts with 2 per page: it picks the same run as a single page.

    AskAlexSharov AskAlexSharov commented on code on Nov 26, 2026 09:23 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,114 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
    +        fn: [FuzzSum256, FuzzWriteChunks]
    +    runs-on: ${{ matrix.os }}
    +    env:
    +      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
    +    steps:
    +      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
    +        with:
    +          persist-credentials: false
    +      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
    +        with:
    +          go-version-file: go.mod
    +          cache: false
    +
    +      # The Actions cache cannot update an entry once saved and evicts idle ones, so
    +      # the corpus lives in artifacts: each run continues from the newest one of its
    +      # branch (forks excluded). A failure here stops the leg, because fuzzing from an
    +      # empty corpus would replace the kept one.
    +      - name: Restore fuzz corpus
    +        id: restore
    +        env:
    +          GH_TOKEN: ${{ github.token }}
    +        run: |
    +          corpus="$(go env GOCACHE)/fuzz"
    +          mkdir -p "$corpus"
    +          echo "CORPUS=$corpus" >> "$GITHUB_ENV"
    +          run=$(gh api "repos/$GITHUB_REPOSITORY/actions/artifacts?name=$NAME&per_page=100" \
    +            --jq '[.artifacts[] | select(.expired | not) | select(.workflow_run.head_branch == env.GITHUB_REF_NAME and .workflow_run.head_repository_id == .workflow_run.repository_id)] | sort_by(.created_at) | last | .workflow_run.id // empty')

    gh's --jq does read the process environment: GITHUB_REF_NAME=main gh api repos/erigontech/erigon --jq 'env.GITHUB_REF_NAME' prints main, and this restore step, run locally against Erigon's nightly artifacts, restored a 350-file corpus. Erigon's fuzz workflow uses the same filter. Keeping it.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 26, 2026 09:29 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    There are no active review issues blocking the persistent nightly fuzzing changes.

    No open issues 🎉

    <details>
    <summary><strong>2 resolved since last review</strong></summary>

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Pass the branch name into jq to restore the saved corpus

  • <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/medium-v2-light.png" alt="Medium severity" width="62" height="18" align="texttop"></picture> Paginate artifact listings to find the newest matching corpus

  • </details>

    <sub>Review effort: Balanced</sub>

    chfast chfast commented on code on Nov 26, 2026 10:23 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.

    ci.yml does not quite start from the seeds: setup-go's default cache restores GOCACHE, which holds the fuzz cache. For example, FuzzSum256 on macOS logs gathering baseline coverage: 0/18 with 6 seeds. That cache entry is saved once per key, so its corpus never grows. "ci.yml never grows the corpus" would be accurate here and in the description, and it also explains why cache: false is right in this job.

    chfast chfast commented on code on Nov 26, 2026 10:23 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).

    ci.yml makes this claim checkable in its log with the "Report CPU features" step, and this job does not have it. If a runner image loses BMI2 or SHA3, useASM is false and Sum256 falls back to x/crypto. The leg then compares x/crypto with itself and passes. Copying that step makes it visible.

    chfast chfast commented on code on Nov 26, 2026 10:23 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]

    The two arm64 legs fuzz the same code. keccak_arm64.go differs between them only in the init line that sets useASM, and both runners have SHA3 (asimd sha3 in the ci.yml log of ubuntu-24.04-arm). So both run keccakF1600Sha3 and the same Go sponge. Unless the Linux leg is there for the hardware, dropping one arm64 leg saves about 1 runner-hour a night.

    chfast chfast commented on code on Nov 26, 2026 10:23 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
    +        fn: [FuzzSum256, FuzzWriteChunks]
    +    runs-on: ${{ matrix.os }}
    +    env:
    +      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
    +    steps:
    +      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
    +        with:
    +          persist-credentials: false
    +      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
    +        with:
    +          go-version-file: go.mod

    This installs exactly Go 1.24.0 (go.mod has no toolchain line), so the golang/go#75804 workaround below stays until go.mod's go directive reaches 1.27. For a library that takes a long time. This job does not test the minimum Go version, so it can pin a recent release like the checks job in ci.yml does; with 1.27.x, lines 86–94 can go.

    chfast chfast commented on code on Nov 26, 2026 10:23 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
    +        fn: [FuzzSum256, FuzzWriteChunks]
    +    runs-on: ${{ matrix.os }}
    +    env:
    +      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
    +    steps:
    +      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
    +        with:
    +          persist-credentials: false
    +      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
    +        with:
    +          go-version-file: go.mod
    +          cache: false
    +
    +      # The Actions cache cannot update an entry once saved and evicts idle ones, so
    +      # the corpus lives in artifacts: each run continues from the newest one of its
    +      # branch (forks excluded). A failure here stops the leg, because fuzzing from an
    +      # empty corpus would replace the kept one.
    +      - name: Restore fuzz corpus

    Does the kept corpus pay for this step and the upload? Coverage guidance sees only the Go code (the assembly is not instrumented), and in short local runs on amd64 (about 1.5 min per target) the corpus stopped growing at about 20–25 inputs per target. A plain nightly run without restore and upload might explore about the same. If you keep it, the corpus counts of the first few nights would show whether it grows.

    chfast chfast commented on code on Nov 26, 2026 10:23 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
    +        fn: [FuzzSum256, FuzzWriteChunks]
    +    runs-on: ${{ matrix.os }}
    +    env:
    +      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
    +    steps:
    +      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
    +        with:
    +          persist-credentials: false
    +      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
    +        with:
    +          go-version-file: go.mod
    +          cache: false
    +
    +      # The Actions cache cannot update an entry once saved and evicts idle ones, so
    +      # the corpus lives in artifacts: each run continues from the newest one of its
    +      # branch (forks excluded). A failure here stops the leg, because fuzzing from an
    +      # empty corpus would replace the kept one.
    +      - name: Restore fuzz corpus
    +        id: restore
    +        env:
    +          GH_TOKEN: ${{ github.token }}
    +        run: |

    "A failure here stops the leg" holds only because defaults.run.shell: bash runs the step with -eo pipefail. Under plain bash -e, a failing gh api inside the $(... | sort | tail | cut) pipeline leaves run empty: the step prints the warning, exits 0, and the seed-only corpus is uploaded as the newest one. set -euo pipefail at the top makes it independent of the defaults.

    chfast chfast commented on Nov 26, 2026 10:23 UTC
    Reviewer

    No blocking issues. I checked the restore lookup against Erigon's real corpus artifacts: it picks the newest one of the branch and restores the same $GOCACHE/fuzz/<module>/<FuzzName>/ layout that go test -fuzz reads. I also ran the fuzz step's exit paths with a fake go: the bare deadline output passes, while a reproducer or a real crash fails. The upload conditions also hold for a cancel and a timeout. Comments inline.

    The main gap: a nightly failure notifies almost nobody. GitHub sends the failure of a scheduled run only to the user who created the workflow or last changed its cron line. Erigon's test-fuzz.yml has a notify job that opens or updates a nightly-fuzz issue. Without something like it, a crash shows up only as a red run in the Actions tab and a fuzz-crash-* artifact that expires. So either port that job or drop "the same as Erigon's" from the description.

    Out of scope: ci.yml uploads its crash reproducers as fuzz-corpus-<os>, which now reads like one of these corpus artifacts. fuzz-crash-<os> would match this workflow.

    AskAlexSharov AskAlexSharov commented on code on Nov 28, 2026 05:12 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.

    Fixed in f52ef0f: the comment and the PR body now say ci.yml never grows the corpus.

    AskAlexSharov AskAlexSharov commented on code on Nov 28, 2026 05:12 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).

    Added the "Report CPU features" step in f52ef0f.

    AskAlexSharov AskAlexSharov commented on code on Nov 28, 2026 05:12 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]

    Dropped the macos-15 leg in f52ef0f; the job keeps amd64 BMI2 and arm64 SHA3 on ubuntu-24.04-arm.

    AskAlexSharov AskAlexSharov commented on code on Nov 28, 2026 05:12 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
    +        fn: [FuzzSum256, FuzzWriteChunks]
    +    runs-on: ${{ matrix.os }}
    +    env:
    +      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
    +    steps:
    +      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
    +        with:
    +          persist-credentials: false
    +      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
    +        with:
    +          go-version-file: go.mod

    Pinned Go 1.27.4 and removed the golang/go#75804 workaround in f52ef0f. Three 3 s FuzzSum256 runs on 1.27.4 exit 0.

    AskAlexSharov AskAlexSharov commented on code on Nov 28, 2026 05:13 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
    +        fn: [FuzzSum256, FuzzWriteChunks]
    +    runs-on: ${{ matrix.os }}
    +    env:
    +      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
    +    steps:
    +      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
    +        with:
    +          persist-credentials: false
    +      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
    +        with:
    +          go-version-file: go.mod
    +          cache: false
    +
    +      # The Actions cache cannot update an entry once saved and evicts idle ones, so
    +      # the corpus lives in artifacts: each run continues from the newest one of its
    +      # branch (forks excluded). A failure here stops the leg, because fuzzing from an
    +      # empty corpus would replace the kept one.
    +      - name: Restore fuzz corpus

    Keeping it: the restore step logs the restored file count, so the first nights show whether the corpus grows. If it stays flat, I will drop the restore and the upload.

    AskAlexSharov AskAlexSharov commented on code on Nov 28, 2026 05:13 UTC
    Code Review
    .github/workflows/fuzz.yml:1
    @@ -0,0 +1,115 @@
    +name: Fuzz
    +
    +# Mutation fuzzing that keeps its corpus. The 20 s fuzz steps in ci.yml start
    +# from the seeds on every run; this nightly job continues from the corpus the
    +# previous run left, so the search goes deeper each night.
    +
    +on:
    +  schedule:
    +    - cron: '0 3 * * *'   # nightly 03:00 UTC, on the default branch
    +  workflow_dispatch:
    +    inputs:
    +      fuzztime:
    +        description: 'Duration per fuzz target (Go duration, e.g. 10m, 1h)'
    +        required: false
    +        default: '30m'
    +
    +defaults:
    +  run:
    +    shell: bash
    +
    +concurrency:
    +  group: ${{ github.workflow }}-${{ github.ref }}
    +  cancel-in-progress: true
    +
    +permissions:
    +  contents: read
    +
    +jobs:
    +  fuzz:
    +    if: github.repository == 'erigontech/fastkeccak' || github.event_name != 'schedule'
    +    permissions:
    +      contents: read
    +      actions: read
    +    timeout-minutes: 70
    +    strategy:
    +      fail-fast: false
    +      matrix:
    +        # Each runner fuzzes a different implementation (see ci.yml).
    +        os: [ubuntu-latest, ubuntu-24.04-arm, macos-15]
    +        fn: [FuzzSum256, FuzzWriteChunks]
    +    runs-on: ${{ matrix.os }}
    +    env:
    +      NAME: fuzz-corpus-${{ matrix.os }}-${{ matrix.fn }}
    +    steps:
    +      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
    +        with:
    +          persist-credentials: false
    +      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
    +        with:
    +          go-version-file: go.mod
    +          cache: false
    +
    +      # The Actions cache cannot update an entry once saved and evicts idle ones, so
    +      # the corpus lives in artifacts: each run continues from the newest one of its
    +      # branch (forks excluded). A failure here stops the leg, because fuzzing from an
    +      # empty corpus would replace the kept one.
    +      - name: Restore fuzz corpus
    +        id: restore
    +        env:
    +          GH_TOKEN: ${{ github.token }}
    +        run: |

    Added set -euo pipefail in f52ef0f.

    AskAlexSharov AskAlexSharov commented on Nov 28, 2026 05:13 UTC
    Author

    Ported a small notify job in f52ef0f: a failed scheduled run opens or updates a nightly-fuzz issue with the run link. The "same as Erigon's" line is gone from the description. The ci.yml artifact rename is left for a separate change.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 28, 2026 05:17 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    No active review issues are reported for the persistent nightly fuzzing changes.

    No open issues 🎉

    <sub>Review effort: Balanced</sub>

    Reviewers
    Assignees
    AskAlexSharov AskAlexSharov
    Labels
    risk: low confidence: 83.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 46.1% (MEDIUM) · Higher = larger blast radius
    46.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 83.8% · Lower = rushed or shallow review
    83.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 7.5% · Safe to merge
    7.5%