Description
Measure set_metadata cost at 1, 5, and MAX_METADATA_KEYS key counts to detect superlinear growth in the metadata storage layout. Publishes to CI for regression tracking.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
contracts/subscription_vault/src/metadata.rs
- Bench lives in
contracts/subscription_vault/benches/metadata_write.rs
Suggested execution
- Fork the repo and create a branch
git checkout -b bench/metadata-write
- Implement changes
- Parametrise bench over key counts
- Record read+write costs separately
- Enforce ceiling in CI
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Key at MAX length, value at MAX length, and idempotent overwrite
- Include test output and security notes
Example commit message
bench: metadata write cost by key count
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Measure
set_metadatacost at 1, 5, and MAX_METADATA_KEYS key counts to detect superlinear growth in the metadata storage layout. Publishes to CI for regression tracking.Requirements and context
contracts/subscription_vault/src/metadata.rscontracts/subscription_vault/benches/metadata_write.rsSuggested execution
git checkout -b bench/metadata-writeTest and commit
cargo test --allExample commit message
bench: metadata write cost by key countGuidelines