Skip to content

feat(maintainable): support temporary storage keys in impl_maintainable #2

Description

@0dillon

Summary

impl_maintainable! takes an instance extension and a persistent: key list
(crates/maintainable/src/macros.rs). Temporary storage has a TTL too, and a contract that keeps
anything meaningful there has no way to declare it. Adding an optional temporary: list makes the
macro cover all three tiers.

Temporary entries differ from persistent ones in a way the macro has to respect: when a temporary
entry expires it is deleted outright, not archived, and Protocol 23's automatic restore does not
bring it back. Extending a key that no longer exists must not abort the whole run.

Acceptance Criteria

  • impl_maintainable! accepts an optional temporary: [...] list alongside persistent:.
  • Omitting temporary: compiles and behaves exactly as it does today.
  • The generated __lk_extend_all extends temporary keys with the same threshold and
    extend_to as the rest.
  • The returned count includes temporary keys that were extended.
  • A test covers a contract declaring both tiers, and a test covers a declared temporary key that
    has already been deleted.
  • The rustdoc on the macro explains the delete-versus-archive difference.

Tech Stack

Rust (edition 2021, toolchain 1.93.0 pinned in rust-toolchain.toml), soroban-sdk 27.0.4,
target wasm32v1-none. Build with stellar contract build, never cargo build. Tests are
#[cfg(test)] modules on Env::default(); run them with cargo test --all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions