Overview
Callers have no way to estimate the instruction count or memory usage of contract calls before submitting them. Add a simulation-based estimation utility and document budget limits for all public functions.
Acceptance Criteria
estimate_compute(function_name, args) off-chain utility function using soroban_simulation
- Returns
{ instructions: u64, mem_bytes: u64, read_entries: u32, write_entries: u32 }
- Estimation covers all public contract functions:
create_invoice, pay_invoice, release_funds, get_invoice, get_leaderboard, get_stats
COMPUTE_BUDGETS.md documents measured instruction counts for typical inputs (1 recipient, 5 recipients, 20 recipients)
- Warning emitted in tests if any function exceeds 80% of the Soroban instruction limit
- CI benchmark job runs estimation on each PR and posts a budget table as a PR comment
- Any function exceeding the instruction limit fails CI
Overview
Callers have no way to estimate the instruction count or memory usage of contract calls before submitting them. Add a simulation-based estimation utility and document budget limits for all public functions.
Acceptance Criteria
estimate_compute(function_name, args)off-chain utility function usingsoroban_simulation{ instructions: u64, mem_bytes: u64, read_entries: u32, write_entries: u32 }create_invoice,pay_invoice,release_funds,get_invoice,get_leaderboard,get_statsCOMPUTE_BUDGETS.mddocuments measured instruction counts for typical inputs (1 recipient, 5 recipients, 20 recipients)