Summary
A vault's interval is the minimum number of ledgers between paid claims. Nothing explains how to
pick it, and the obvious guess is wrong.
The maintenance period of a target is extend_to - threshold, not threshold. A contract with
threshold: 100_000, extend_to: 500_000 has its TTL pushed to 500,000 ledgers and does not need
attention again until it falls to 100,000 — a gap of 400,000 ledgers. An owner who sets
interval to threshold pays for four times as many claims as the target needs. That mistake was
in scripts/init_testnet.sh until it was fixed by deriving the interval from the two macro values;
the contract's own documentation still says nothing about it.
Acceptance Criteria
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.
Summary
A vault's
intervalis the minimum number of ledgers between paid claims. Nothing explains how topick it, and the obvious guess is wrong.
The maintenance period of a target is
extend_to - threshold, notthreshold. A contract withthreshold: 100_000, extend_to: 500_000has its TTL pushed to 500,000 ledgers and does not needattention again until it falls to 100,000 — a gap of 400,000 ledgers. An owner who sets
intervaltothresholdpays for four times as many claims as the target needs. That mistake wasin
scripts/init_testnet.shuntil it was fixed by deriving the interval from the two macro values;the contract's own documentation still says nothing about it.
Acceptance Criteria
openandset_termsrustdoc give the relationship asextend_to - thresholdwith theworked example above.
supply a consistent
intervaland nothing on-chain checks it.linked rather than restated.
Tech Stack
Rust (edition 2021, toolchain 1.93.0 pinned in
rust-toolchain.toml),soroban-sdk27.0.4,target
wasm32v1-none. Build withstellar contract build, nevercargo build. Tests are#[cfg(test)]modules onEnv::default(); run them withcargo test --all.