Skip to content

test(futarchy): add fuzz testing suite - #496

Open
hyckomatej wants to merge 2 commits into
metaDAOproject:pileks/mini-instructions-fixesfrom
accretion-xyz:futarchy-fuzzing
Open

hyckomatej wants to merge 2 commits into
metaDAOproject:pileks/mini-instructions-fixesfrom
accretion-xyz:futarchy-fuzzing

Conversation

@hyckomatej

@hyckomatej hyckomatej commented Sep 18, 2026

Copy link
Copy Markdown

Summary

Adds a Wake.sol fuzz testing suite for the Futarchy program.

The suite includes:

  • Happy and expected-failure flows
  • Postcondition checks and atomic rollback validation for each instruction
  • Support flows for clock advancement and execution of passed proposal payloads
  • global invariants covering:
    • DAO and proposal account integrity
    • Token supply and reserve accounting
    • AMM liquidity positions and fee backing
    • Proposal stake custody
    • Squads approval, cancellation, and execution behavior
  • Generated Python bindings and tooling for producing a Wake-compatible IDL
  • A manually triggered GitHub Actions workflow with configurable sequence count, flow count, and seed-based failure reproduction

RetriggerConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking workflow cache-key issue that should be corrected to avoid wasting cache storage and degrading future build-cache effectiveness.

Findings

  1. P2 Run-specific caches accumulate

Summary

This PR adds a comprehensive Wake.sol stateful fuzzing harness for Futarchy, including generated bindings, instruction-level flows, accounting and lifecycle invariants, deterministic setup utilities, documentation, and a manually dispatched GitHub Actions campaign.

  • Exercises happy and expected-failure paths across proposal, AMM, DAO configuration, and Squads instructions.
  • Verifies account rollback, token backing, liquidity accounting, proposal custody, and Squads lifecycle properties.
  • Adds reproducible seeded runs and uploaded diagnostic artifacts.
  • The workflow’s run-specific build-cache key should be made stable to avoid continual cache duplication and eviction.

Reviews (1) · Last reviewed commit: "Update cu limit"

~/.cache/uv/
target/
${{ runner.temp }}/wake-sol/target/
key: futarchy-fuzz-build-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }}-${{ github.run_attempt }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Run-specific caches accumulate

The cache key includes both github.run_id and github.run_attempt, so every invocation creates a distinct cache even when Cargo.lock is unchanged. GitHub caches are immutable: the restore prefix can reuse an older entry, but the workflow will still save another copy of the Cargo, build, and Wake artifacts. Repeated fuzz runs will consume the cache quota and eventually evict useful entries. A stable, content-based key would allow these build caches to be reused without creating a duplicate for every run.

Suggested change
key: futarchy-fuzz-build-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ github.run_id }}-${{ github.run_attempt }}
key: futarchy-fuzz-build-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant