Skip to content

test: fuzz core fee arithmetic invariants#524

Closed
dangelo352 wants to merge 1 commit into
Commitlabs-Org:masterfrom
dangelo352:test/core-fee-fuzz-486
Closed

test: fuzz core fee arithmetic invariants#524
dangelo352 wants to merge 1 commit into
Commitlabs-Org:masterfrom
dangelo352:test/core-fee-fuzz-486

Conversation

@dangelo352

Copy link
Copy Markdown

Summary

  • Make the commitment_core fuzz fee helper use quotient/remainder math so valid max-sized inputs do not overflow before division
  • Add deterministic seed-grid coverage for fee <= amount and net_amount + fee == amount across boundary bps values
  • Cover invalid domains, zero-fee, full-fee, and i128::MAX-adjacent amount observations
  • Document the fee arithmetic invariants in SECURITY_AUDIT_PREP.md

Closes #486.

Tests

  • CARGO_TARGET_DIR=/tmp/commitlabs-fuzz-target cargo test -p commitment_core fuzz -- --nocapture
  • git diff --check

Note: Rust formatting was applied only to the touched fuzz files because repo-wide cargo fmt --check currently reports unrelated pre-existing formatting drift.

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 property-based fuzz tests for commitment_core fee and value arithmetic

2 participants