You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PR_DESCRIPTION.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,12 @@ The `extend_creator_ttl` function unconditionally emitted a `ttl_ext` event on e
13
13
### `creator-keys/src/lib.rs`
14
14
15
15
-**Added `TTL_EXTENSION_THRESHOLD` constant** (`100` ledgers) — the minimum remaining TTL below which a TTL extension event is emitted.
16
+
-**Added `DataKey::CreatorTtlLiveUntil(creator)`** — a per-creator `u32` recording the absolute live-until ledger the contract last set for the creator profile key. The Soroban SDK does not expose TTL reads to contract code, so this tracked value is what `extend_creator_ttl` uses to decide whether to emit the event.
3.Always call `extend_ttl` on all storage keys — the Soroban SDK call is a no-op when TTL is already healthy, preserving the existing on-chain behavior.
20
-
4. Only publish the `TTL_EXTENDED_EVENT_NAME` event when the check above returns `true`.
18
+
1.Derive the remaining TTL from `CreatorTtlLiveUntil` and evaluate `ttl::should_extend(remaining, TTL_EXTENSION_THRESHOLD)`.
19
+
2.Always call `extend_ttl` on all creator-scoped storage keys — the Soroban SDK call is a no-op when TTL is already healthy, preserving the existing on-chain behavior.
20
+
3.Only publish the `TTL_EXTENDED_EVENT_NAME` event when the check above returns `true`, then update the tracked live-until.
21
+
-**Write-time TTL alignment**: new entries start with the network-default TTL, which can be much shorter than `CREATOR_TTL_LEDGERS` on fresh networks. `register_creator` now forces the full `CREATOR_TTL_LEDGERS` window on the creator profile, curve preset, and tracked live-until; `set_key_price`, the buy path, and dividend settlement grant the same full window to `KeyPrice`, `KeyBalance(creator, holder)`, and the dividend checkpoint/pending keys.
21
22
22
23
### `creator-keys/tests/ttl_extension_on_buy.rs`
23
24
@@ -41,9 +42,9 @@ The `extend_creator_ttl` function unconditionally emitted a `ttl_ext` event on e
0 commit comments