Conversation
Greptile SummaryAdds two honggfuzz harnesses (
Confidence Score: 5/5Safe to merge — no P0 or P1 issues found; all remaining findings are P2 style improvements The only substantive gap (missing user-balance check in fuzz_reset_smt's final invariant) is a test-coverage improvement rather than a defect in the program under test. All other findings are code-quality suggestions. P2-only findings default to 5/5 per the scoring guidance. contra-escrow-program/tests/fuzz/src/bin/fuzz_reset_smt.rs — missing user balance assertion in final invariant Important Files Changed
Sequence DiagramsequenceDiagram
participant F as Fuzzer
participant H as Harness
participant L as LiteSVM
participant P as Escrow Program
F->>H: raw bytes (arbitrary input)
H->>H: deserialize FuzzInput (Vec<Op>)
H->>L: setup_fuzz_context() — fresh instance
loop for each Op (max 32)
H->>L: warp_to_slot (unique blockhash)
alt Deposit
H->>P: DepositFunds ix
P-->>L: transfer user→escrow ATA
H->>H: assert per-op balance shift
else Release (valid proof)
H->>H: generate exclusion proof from local SMT
H->>P: ReleaseFunds ix (1.2 M CU budget)
P-->>L: verify SMT proof, transfer escrow→user, update root
H->>H: update local SMT mirror
H->>H: assert per-op balances
else Release (invalid/garbage proof)
H->>P: ReleaseFunds ix (garbage proof)
P-->>L: reject tx
H->>H: assert balances unchanged
else DoubleSpend (fuzz_escrow only)
H->>P: replay previous ReleaseFunds verbatim
P-->>L: reject (nonce already in SMT root)
H->>H: assert balances unchanged
else ResetSmtRoot (fuzz_reset_smt only)
H->>P: ResetSmtRoot ix
P-->>L: advance tree index, clear root
H->>H: increment local tree_index, reset local SMT
else ReleaseStaleNonce (fuzz_reset_smt only)
H->>P: ReleaseFunds ix with prev-gen nonce
P-->>L: reject (nonce outside current tree range)
H->>H: assert balances unchanged
end
end
H->>H: final invariant: instance == deposited − released
Reviews (1): Last reviewed commit: "fuzz testing implemented with honggfuzz" | Re-trigger Greptile |
02328cf to
bae235f
Compare
Summary
fuzz_escrow— tests the core lifecycle: deposit, release (50% valid / 50% garbage proof), and double-spend replay. Verifies that valid SMT proofs succeed, garbage proofs are rejected without touching balances, and replayed releases are permanently rejectedfuzz_reset_smt— tests the SMT reset lifecycle across multiple tree generations. Verifies that nonces from previous generations are rejected after a reset, and that balances are never affected by a resetshared.rsto avoid duplication between harnessesTest plan
cargo build-sbf(from repo root)cd contra-escrow-program/tests/trident-tests && cargo run --bin fuzz_escrowcargo run --bin fuzz_reset_smtTRIDENT_FUZZ_DEBUG=0000000000000000 ./target/debug/fuzz_escrow 2>&1 | head -200Coverage Report