Skip to content

docs(contracts): document storage.rs key layout and TTL bump semantics - #1613

Merged
K1NGD4VID merged 3 commits into
LabsCrypt:mainfrom
Joyful12-tech:docs/storage-rustdoc-ttl-semantics
Oct 6, 2026
Merged

K1NGD4VID merged 3 commits into
LabsCrypt:mainfrom
Joyful12-tech:docs/storage-rustdoc-ttl-semantics

Conversation

@Joyful12-tech

Copy link
Copy Markdown
Contributor

Summary

Closes #1007

Added Rustdoc documentation to the storage helpers in contracts/stream_contract/src/storage.rs to clarify storage key usage and ledger TTL bump semantics.

Changes

  • Added Rustdoc comments to each public function in storage.rs.
  • Documented the storage key touched by each helper.
  • Documented any ledger TTL bump behavior performed by the helpers.
  • Added documentation for the storage key enum and its variants.
  • Clarified persistence and storage-cost considerations for contributors.

Scope

  • Documentation-only changes.
  • No storage layout changes.
  • No new storage entries.
  • No runtime behavior changes.

Closes #1007

Joyful12-tech and others added 3 commits October 2, 2026 15:24
storage.rs centralizes every ledger read and write for streams and config,
but its helpers carried no rustdoc describing the storage keys they touch
or the TTL bumps they perform, making persistence costs hard to reason
about for new contributors.

Add a module-level doc covering the DataKey layout (which variants are
persistent vs. instance and which helpers touch each) plus a table of the
TTL policy, and give all 13 public functions Key/TTL lines. Also clarify
that extend_ttl's second argument is a target lifetime rather than an
increment, despite the BUMP_AMOUNT naming.

Comments only; no behavior change.

Refs LabsCrypt#1007

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Merging main into this branch left two `remove_stream` definitions in
storage.rs (E0428), which failed Soroban Contracts CI at the clippy step
and the CodeQL rust job at `cargo check`. Keep the canonical definition
in the Stream CRUD section, fold its **Key**/**TTL** rustdoc into that
one copy, and drop the duplicate appended at the end of the module.
Comments only — no behavior or storage-layout change.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@K1NGD4VID
K1NGD4VID merged commit f12e003 into LabsCrypt:main Oct 6, 2026
12 checks passed
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.

[Contracts] storage.rs read/write helpers have no doc comments explaining TTL/bump semantics

2 participants