Objective: ensure PRs do not introduce significant cost regressions and follow best practices.
- Cover all public entrypoints with valid and invalid inputs (fail fast saves gas).
- Include large-market tests (e.g., many voters) to catch algorithmic costs.
- For stable scenarios, snapshot CLI
--costoutputs and diff on PRs. - Store under
test_snapshots/cost/with scenario descriptions.
- Review loops for storage/cross-contract calls per iteration.
- Check for repeated
.get()/.set()rather than single read/single write patterns. - Ensure strings/bytes sizes are validated.
- Storage ops minimized and batched
- No per-iteration storage writes in loops
- External calls minimized/batched
- Return/events payloads small
- Enforced input length caps
- Consider running a Soroban-focused analyzer to detect storage-in-loop and repeated indirect storage access patterns.