Skip to content

Add per-period concentration-history audit so retroactive reviews can recompute exposure #478

Description

@thlpkee20-wq

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
    • cargo test --all
  • 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

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions