Skip to content

test: fuzz dispute_open boundary cases#892

Merged
greatest0fallt1me merged 1 commit into
Predictify-org:masterfrom
chiprime:task/fuzz-dispute-open
Jul 24, 2026
Merged

test: fuzz dispute_open boundary cases#892
greatest0fallt1me merged 1 commit into
Predictify-org:masterfrom
chiprime:task/fuzz-dispute-open

Conversation

@chiprime

Copy link
Copy Markdown

Summary

Add proptest-based fuzz target exercising dispute_open (process_dispute) boundary conditions.

Changes

New files

  • contracts/predictify-hybrid/fuzz/targets/dispute_open.rs: Cargo-fuzz target stub with documentation for future cargo-fuzz setup
  • contracts/predictify-hybrid/src/tests/dispute_open_fuzz.rs: Proptest-based fuzz target (main implementation, kept internal for crate API access)

Modified files

  • contracts/predictify-hybrid/src/tests/mod.rs: Registered the new dispute_open_fuzz module
  • Cargo.lock: Updated ethnum from 1.5.0 to 1.5.3 for Rust 1.80+ compatibility

Boundary conditions covered

Category Conditions
Stake MIN_DISPUTE_STAKE (10_000_000), just below, just above, i128::MAX, zero, negative
Market timing Before end_time, after end_time, after dispute window closes
Duplicates Same user disputing twice
Stake caps Per-market per-user cap exceeded
Reason None, empty Some, long string

Testing

cargo test -p predictify-hybrid -- dispute_open_fuzz

Runs 200 proptest cases per test to cover all boundary conditions (configurable via ProptestConfig::with_cases).

Security

  • All fuzz cases assume mock_all_auths() is active (auth tested separately in require_auth_coverage_tests)
  • No unwrap() in production paths — errors propagated via Result
  • Safe arithmetic via i128 (overflow-checked in release profile)

Closes #739

Add proptest-based fuzz target exercising dispute_open boundary
conditions across stake amounts, market timing, anti-grief floors,
duplicate disputes, and stake caps.

Closes Predictify-org#739

Boundary conditions covered:
- Stake: MIN_DISPUTE_STAKE (10_000_000), just below, just above,
  i128::MAX, zero, negative
- Market timing: before end_time, after end_time, after dispute
  window closes
- Duplicates: same user disputing twice
- Stake caps: per-market per-user cap exceeded
- Reason: None, empty Some, long string

Update ethnum to 1.5.3 for Rust 1.80+ compatibility.
@drips-wave

drips-wave Bot commented Jul 23, 2026

Copy link
Copy Markdown

@chiprime 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

@greatest0fallt1me
greatest0fallt1me merged commit ca98fbe into Predictify-org:master Jul 24, 2026
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Merged into master via admin resolver (-X theirs).

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Merging — great job on the clean implementation. 💯

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.

Add fuzz target for dispute_open with malformed inputs

2 participants