Skip to content

Add Kani formal verification harnesses and fix pre-existing clippy li… - #62

Merged
bakarezainab merged 5 commits into
LatterFixxx:mainfrom
Skinny001:feat/issue-11-kani-formal-verification
Jul 24, 2026
Merged

Add Kani formal verification harnesses and fix pre-existing clippy li…#62
bakarezainab merged 5 commits into
LatterFixxx:mainfrom
Skinny001:feat/issue-11-kani-formal-verification

Conversation

@Skinny001

Copy link
Copy Markdown
Contributor

This pull request introduces a new formal verification workflow using Kani, refactors and simplifies code throughout the codebase, and improves code clarity and maintainability. The main changes include the addition of a GitHub Actions workflow for Kani, code style improvements, and minor refactors for better parameter naming and grouping. Below are the most important changes grouped by theme:
close #11
Formal Verification Integration

  • Added .github/workflows/formal-verification.yml to run Kani proofs on pushes and pull requests, ensuring formal verification of Rust code.
  • Added build.rs to enable conditional compilation for Kani with cfg(kani).
  • Updated src/lib.rs to only include Kani proof modules when the kani configuration is enabled.

Code Style and Refactoring

  • Refactored all event emitter functions in src/events.rs to use single-line parameter lists and improved argument formatting for clarity and consistency. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Reordered imports in src/events.rs for style consistency.
  • Reformatted chained method calls in src/lib.rs and other files for improved readability. [1] [2] [3] [4] [5] [6] [7] [8]

Minor Refactoring and Naming

  • Renamed unused parameters to _min_reputation and _caller in src/governance.rs for clarity and to suppress warnings. [1] [2]
  • Unified function signatures in src/governance.rs for consistency.

These changes collectively improve the maintainability and reliability of the codebase, while introducing formal verification as part of the CI process.…nt errors

  • 14 Kani proof harnesses (18 proof functions) covering fee math, vault invariants, escrow safety, reputation bounds, oracle overflow, state machine, dispute split, governance thresholds, swap routes
  • gated behind #[cfg(kani)] in src/kani_proofs.rs
  • build.rs registers cfg(kani) for clippy compatibility
  • CI workflow at .github/workflows/formal-verification.yml
  • Fix pre-existing clippy errors across 6 source files

Skinny001 and others added 5 commits July 23, 2026 17:36
…nt errors

- 14 Kani proof harnesses (18 proof functions) covering fee math, vault
  invariants, escrow safety, reputation bounds, oracle overflow,
  state machine, dispute split, governance thresholds, swap routes
- gated behind #[cfg(kani)] in src/kani_proofs.rs
- build.rs registers cfg(kani) for clippy compatibility
- CI workflow at .github/workflows/formal-verification.yml
- Fix pre-existing clippy errors across 6 source files
- Fix type mismatch: Soroban Vec::len() returns u32, not usize
- Remove unnecessary  casts from ledger().timestamp()
- Fix leading-zero decimal literals flagged by clippy
- Add missing BytesN import and ToXdr trait
- Prefix unused variables with underscore
- Wrap TWAP tests in env.as_contract() for storage access (Soroban 21.x)
- Fix pre-existing TWAP test bugs (cumulative values)
- Remove duplicate  in lib.rs
- Convert module-level doc comments to regular // comments
- Remove duplicate BytesN import in test.rs
- Add allow(deprecated) to multisig_test.rs
- Add allow(dead_code) to Ctx struct
- Add allow(clippy::too_many_arguments) to register_verification_key
@bakarezainab
bakarezainab merged commit 314eed8 into LatterFixxx:main Jul 24, 2026
1 check 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.

#011: Formal Verification of Multi-Sig & Escrow Logic (Kani / SMT)

2 participants