Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ target/
# Test snapshots generated by soroban-sdk testutils
test_snapshots/
**/test_snapshots/
**/*.snap
**/*.snap.new

# Node / JS tooling (reference indexer dependencies if ever added)
node_modules/
Expand Down Expand Up @@ -47,12 +49,26 @@ deploy-testnet.env
# proptest failure-seed artifacts
proptest-regressions/

# Cargo lock files for library crates (keep for binary/contract crates)
# Uncomment to ignore: #Cargo.lock

# Cargo generated lock files in sub-crates (root Cargo.lock is tracked)
intent_periphery/Cargo.lock
examples/policy_daily_cap/Cargo.lock

# Benchmark / profiling output
# Coverage / profiling artifacts
lcov.info
*.profraw
*.profdata
tarpaulin-report.html
cobertura.xml

# Benchmark / criterion output
criterion/
flamegraph.svg
perf.data*

# Temporary / scratch files
*.tmp
*.bak
*.orig
31 changes: 31 additions & 0 deletions docs/145-ttl-bump-frequency-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,34 @@ short-circuits below-threshold. A guest-side threshold gate would add code
and, in the common case, no saving — in the rare case, an extra host call.
The current constants and their rationale are documented in
[docs/ttl-constants-rationale.md](ttl-constants-rationale.md).

---

## 5. Issue #371: Permissionless intent pruning (`close_intent`)

The addition of `close_intent` (issue #371) changes the retention picture for
terminal intents:

* **Before #371:** terminal `IntentRecord` entries stayed in persistent storage
until the Soroban ledger archived them after TTL expiry. The protocol kept
bumping TTL on those entries whenever they were touched, potentially keeping
them alive indefinitely.

* **After #371:** `close_intent(intent_id)` can be called by anyone after
`intent.terminal_at + intent_retention_secs <= now` (default 30 days).
It deletes the record and all ancillary keys (`IntentFillHistory`,
`ExtensionGranted`, `BestBid`, the `UserIntents` bucket slot) and emits
an `intent_closed` event. An `IntentTombstone` is left in place
(persistent, TTL-bumped) to prevent id reuse.

* **TTL implication:** closed intents no longer accumulate rent.
`IntentTombstone` entries are cheap (a single `bool`) and share the same
`PERSISTENT_TTL_THRESHOLD`/`PERSISTENT_TTL_EXTEND_TO` schedule — they
expire naturally once no one touches them for 30 days.

* **Retention is configurable** via `set_intent_retention(secs)` (admin-only).
The default is `DEFAULT_INTENT_RETENTION_SECS` = 2 592 000 s (30 days).
Reading via `get_intent_retention()`.

This means the storage growth rate for terminal intents is now bounded by
the throughput × retention window rather than by the full protocol lifetime.
Loading
Loading