Repository navigation
docs(contracts): document storage.rs key layout and TTL bump semantics - #1613
Merged
K1NGD4VID merged 3 commits intoOct 6, 2026
Merged
Conversation
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>
Closed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1007
Added Rustdoc documentation to the storage helpers in
contracts/stream_contract/src/storage.rsto clarify storage key usage and ledger TTL bump semantics.Changes
storage.rs.Scope
Closes #1007