fix(investment_vault): persistent TTL extension and carbon-credit tests - #496
Open
adams813 wants to merge 1 commit into
Open
fix(investment_vault): persistent TTL extension and carbon-credit tests#496adams813 wants to merge 1 commit into
adams813 wants to merge 1 commit into
Conversation
…n credits Soroban does not auto-extend persistent TTL on write, so idle yield, queue, insurance, and carbon-credit keys could archive. Route every persistent write through set_persistent, document the 30-day rent policy, and add unit tests for carbon-credit calculation, issuance, transfer, and balance. Closes Heliobond#317 Closes Heliobond#364 Closes Heliobond#318 Closes Heliobond#360 Co-authored-by: Cursor <cursoragent@cursor.com>
|
@adams813 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
storage::set_persistent(extend_ttlto ~30 days), covering yield, queue, insurance, carbon-credit, compliance, and related keys that previously used a plain.set()(Most persistent storage keys in investment_vault never get a TTL extension #317, fix: extend TTL on persistent storage writes (#317) #364). Document the TTL policy indocs/STORAGE.mdand correct ADR-002's claim that writes implicitly pay rent.InsuranceFundstill readable after 100,000 idle ledgers and that a later write re-extends TTL.Linked issue
Closes #317
Closes #364
Closes #318
Closes #360
Type of change
Test plan
test_persistent_key_survives_n_idle_ledgers— key remains readable after N untouched ledgerstest_persistent_write_reextends_ttl_after_decay— rewrite restores target TTLfromauth, oracle unset / non-positive pricecargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test --all, WASM size, gas budgetsChecklist
Closes #…)docs/STORAGE.md,adr/002-storage-patterns.md)Made with Cursor