Skip to content

Add benchmark for metadata write cost as key count grows #615

Description

@greatest0fallt1me

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveStellar Wave issue batch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions