Description
Once atomic_close_period lands, its gas should remain O(holders) without hidden quadratic paths. Add a gas-bound test parameterized by 1, 10, 100, 1_000 holders asserting the cpu_insn budget grows linearly within tolerance.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
Revora-Contracts/src/test_close_period.rs
- Linearity check uses
env.cost_estimate().budget() snapshots
Suggested execution
- Fork the repo and create a branch
git checkout -b test/atomic-close-period-gas-linearity
- Implement changes
- Parameterize over holder counts via a helper
- Fit a line and assert R^2 > 0.98 for cpu_insn vs holders
- Document tolerance and fail-mode in MULTISIG_GAS_TEST_SUMMARY.md style
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Zero-holder offering must close with bounded constant cost
- Include test output and security notes
Example commit message
test: assert atomic_close_period gas grows linearly with holders
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Once
atomic_close_periodlands, its gas should remain O(holders) without hidden quadratic paths. Add a gas-bound test parameterized by 1, 10, 100, 1_000 holders asserting the cpu_insn budget grows linearly within tolerance.Requirements and context
Revora-Contracts/src/test_close_period.rsenv.cost_estimate().budget()snapshotsSuggested execution
git checkout -b test/atomic-close-period-gas-linearityTest and commit
cargo test --allExample commit message
test: assert atomic_close_period gas grows linearly with holdersGuidelines