Description
BENCHMARKS.md lacks concrete cost comparisons between single deduct and batch_deduct for the vault, which integrators need to size their settlement windows. Capture real Soroban budget metrics (CPU instructions, memory, read/write entries) for representative batch sizes and document the break-even point.
Requirements and Context
- Use
env.budget() (or cost_estimate in tests) to measure single deduct vs batch_deduct at sizes 1, 10, 25, and 50.
- Record CPU/mem and storage entry counts in
BENCHMARKS.md.
- Note the per-item marginal cost and recommended batch size.
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b task/vault-deduct-benchmarks
- Implement changes
contracts/vault/src/test.rs — budget-measuring tests
BENCHMARKS.md — record results and recommendation
- Test and commit
cargo test -p callora-vault
- Capture budget output for each batch size
- Include test output and notes in the PR
Example commit message
task: benchmark vault single vs batch deduct costs
Acceptance Criteria
Guidelines
.rs under contracts/vault/src/, cargo test, /// docs, minimum 95% line coverage, no unwrap() in prod paths
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
BENCHMARKS.mdlacks concrete cost comparisons between singledeductandbatch_deductfor the vault, which integrators need to size their settlement windows. Capture real Soroban budget metrics (CPU instructions, memory, read/write entries) for representative batch sizes and document the break-even point.Requirements and Context
env.budget()(orcost_estimatein tests) to measure singledeductvsbatch_deductat sizes 1, 10, 25, and 50.BENCHMARKS.md.Suggested Execution
contracts/vault/src/test.rs— budget-measuring testsBENCHMARKS.md— record results and recommendationcargo test -p callora-vaultExample commit message
Acceptance Criteria
BENCHMARKS.mdupdated with resultsGuidelines
.rsundercontracts/vault/src/,cargo test,///docs, minimum 95% line coverage, nounwrap()in prod paths