Add optional Hunter invariant workflow (value-conservation regression guardrail)#93
Add optional Hunter invariant workflow (value-conservation regression guardrail)#93hunterinvariants wants to merge 5 commits into
Conversation
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| - uses: Saintk7/hunter-invariants/actions/v4-invariants@v1 |
There was a problem hiding this comment.
An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. Github, foundry, and uniswap made github actions are exempt.
🎈 Fixed in commit e55ac1e 🎈
|
Updated per the Semgrep suggestion: the action is now pinned to the v3 release commit SHA ( |
| with: | ||
| submodules: recursive # pull in v4-core / forge-std so `forge test` resolves | ||
|
|
||
| - uses: hunterinvariants/hunter-invariants/actions/v4-invariants@v3 |
There was a problem hiding this comment.
An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. Github, foundry, and uniswap made github actions are exempt.
🧹 Fixed in commit 38127f5 🧹
|
Hi - small update on this PR; no action needed unless it's useful. This adds one optional CI workflow that runs Hunter's value-conservation invariant suite on this repo's hook(s) on each PR: no free swap round-trip, the hook can't drain the You can see the result for this repo without approving CI - it's on the public board: https://hunterinvariants.github.io/hunter-invariants/leaderboard.html (this repo's hook shows a green PASS, exercised across thousands of fuzzed value-bearing ops). The Action was also run end-to-end on a fork to verify the full CI path. Since it's a third-party action, the safety basics: it makes no network calls, forces No pressure at all - happy to adjust anything or close it. Just wanted to make it easy to evaluate. |
Optional, self-contained GitHub Action that gates PRs on a value-conservation invariant suite for the hook. Delete the workflow file to remove it; nothing else changes.
It generates a Foundry invariant harness, fuzzes the hook against seven value-conservation properties (no free swap round-trip, LP can always withdraw, callbacks reject non-PoolManager, no draining the shared PoolManager, sane fee bound, no free LP round-trip, no phantom liquidity), and fails the PR only on a real break. Too-thin coverage reports INCONCLUSIVE, not PASS; a build or config problem reports ERROR, never a fabricated violation.
Safe on untrusted PRs: ffi forced off, only the generated suite runs (your tests are untouched), no network, no telemetry, deterministic (no LLM). The action is commit-pinned.
Fuzzing, not a proof or an audit. Fully opt-in.