Description
Concentration limits change over time; today only the latest value is queryable. Persist (period_id -> ConcentrationConfig) history so auditors can recompute concentration violations as of any past period without replaying the chain.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
Revora-Contracts/src/lib.rs
- History storage must respect contract size budget; cap to last N periods configurable
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/concentration-history-audit
- Implement changes
- Add
ConcentrationHistory map keyed by period_id
- Write on every
set_concentration_limit and on period close
- Add view
get_concentration_at(offering_id, period_id)
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Lookup beyond retention horizon must return
None not a stale default
- Include test output and security notes
Example commit message
feat: persist per-period concentration config for audit lookup
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Concentration limits change over time; today only the latest value is queryable. Persist
(period_id -> ConcentrationConfig)history so auditors can recompute concentration violations as of any past period without replaying the chain.Requirements and context
Revora-Contracts/src/lib.rsSuggested execution
git checkout -b feat/concentration-history-auditConcentrationHistorymap keyed by period_idset_concentration_limitand on period closeget_concentration_at(offering_id, period_id)Test and commit
cargo test --allNonenot a stale defaultExample commit message
feat: persist per-period concentration config for audit lookupGuidelines