Skip to content

fix: Add storage-tier documentation for storage [b#015] - #942

Closed
Jenks00 wants to merge 1 commit into
CalloraOrg:mainfrom
Jenks00:fix/issue-1105-clean
Closed

fix: Add storage-tier documentation for storage [b#015]#942
Jenks00 wants to merge 1 commit into
CalloraOrg:mainfrom
Jenks00:fix/issue-1105-clean

Conversation

@Jenks00

@Jenks00 Jenks00 commented Jul 28, 2026

Copy link
Copy Markdown

Description

This PR addresses issue #1105 for the GrantFox FWC26 campaign. It introduces the contracts/storage package along with comprehensive documentation and focused tests detailing the storage tier architecture (Instance, Persistent, Temporary) used across the project.

Changes Included

  • Storage Contract: Created the callora-storage workspace package demonstrating all three Soroban storage tiers.
  • Documentation: Added contracts/storage/docs/storage.md detailing the rationale for mapping keys to specific tiers to optimize ledger footprint and avoid silent state archiving.
  • NatSpec Rustdocs: Added clear /// rustdoc comments on every StorageKey variant in lib.rs defining the tier and rationale.
  • Security & Validation:
    • require_auth() enforced on all state-modifying entrypoints.
    • Overflow-safe math (checked_add) used throughout — no unwrap() on fallible paths.
  • Testing: Focused test suite (src/test.rs) covering authorization rejection, state mutation across all three tiers, and overflow safety.

Storage Tier Mapping

Key Tier Rationale
Admin Instance Small shared config — bumped automatically with every contract interaction
UserBalance(Address) Persistent Per-user financial state that must survive across ledger epochs with explicit TTL tracking
RequestMarker(u64) Temporary Short-lived deduplication marker; expires after the idempotency window with no ledger bloat

Verification

  • cargo test -p callora-storage passes with no failures.
  • No regressions introduced; linting constraints verified.

Closes #1105

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Closing this as invalid — it doesn't link to a DripsWave-assigned issue or the PR author isn't the current assignee.

To contribute: apply on DripsWave, wait for assignment, then open a PR with Closes #<issue-number> in the body. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants