Skip to content

feat(fuzz): coverage-guided fuzz testing pipeline with cargo-fuzz#460

Merged
Smartdevs17 merged 2 commits into
Smartdevs17:mainfrom
activatedkc:feat/fuzz-testing-pipeline-438
May 28, 2026
Merged

feat(fuzz): coverage-guided fuzz testing pipeline with cargo-fuzz#460
Smartdevs17 merged 2 commits into
Smartdevs17:mainfrom
activatedkc:feat/fuzz-testing-pipeline-438

Conversation

@activatedkc
Copy link
Copy Markdown
Contributor

Summary

Implements issue #438 — a production-ready fuzz testing pipeline using cargo-fuzz (libFuzzer) with 4 coverage-guided targets, CI integration, seed corpus management, and crash triage workflow.

Changes

contracts/fuzz/ — cargo-fuzz crate (2 commits)

  • 4 fuzz targets: subscription (full lifecycle), pricing (boundary/refund math), rate_limit (enforcement windows), state_machine (illegal transitions)
  • utils.rs — shared helpers for byte parsing, env setup, time management
  • Seed corpus — 12 edge-case inputs across all 4 targets
  • FUZZING.md — comprehensive documentation

.github/workflows/fuzz-test.yml — CI rewrite

  • Matrix strategy running all 4 targets in parallel (30 min each)
  • Nightly toolchain + cargo-fuzz, corpus cache, crash artifact upload, weekly schedule

Closes #438

- subscription: full lifecycle fuzzing (create_plan → subscribe →
  charge → pause → resume → cancel)
- pricing: boundary price values, refund math, charge timing
- rate_limit: per-function rate-limit enforcement windows
- state_machine: illegal state transitions (double-cancel,
  charge-while-paused, etc.)
- utils: shared helpers for byte parsing, env setup, time management
- .gitignore for cargo-fuzz artifacts and corpus directories
- seed corpus files for all 4 targets with edge-case inputs

Each target parses raw bytes from libFuzzer into a command stream
and catches panics to keep fuzzing on invalid inputs.
… triage

- 4-target matrix (subscription, pricing, rate_limit, state_machine)
  running in parallel
- nightly toolchain + cargo-fuzz installation
- seed corpus copied from .github/corpus/ and cached between runs
- 30-minute run per target with AddressSanitizer
- crash artifacts uploaded on failure with 14-day retention
- corpus uploaded weekly for coverage continuity
- scheduled weekly run (Monday 06:00 UTC)
- explicit error notification with local reproduction command
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@activatedkc Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17 Smartdevs17 merged commit 3f79c00 into Smartdevs17:main May 28, 2026
5 of 26 checks passed
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.

Set up automated contract fuzz testing pipeline

3 participants