refactor(refund-vault): move yield keys to persistent storage (#131) - #253
Open
fredericklamar342-prog wants to merge 5 commits into
Open
refactor(refund-vault): move yield keys to persistent storage (#131)#253fredericklamar342-prog wants to merge 5 commits into
fredericklamar342-prog wants to merge 5 commits into
Conversation
…a#131) Move yield-related storage keys (YieldStrategy, DeployedPrincipal, HarvestedYield, ReserveRatio, MaxDeployRatio) from Instance to Persistent storage so non-yield calls (deposit, refund, withdraw, pause) no longer pay the read/write byte cost of loading them. Persistent entries receive TTL bumping on every write via the new persist_yield_ttl helper. This reduces the Instance storage footprint and lowers per-invocation fees for the most common operations. Fixes accensa#131 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
MergeKeeper review Scope: in scope for linked issue Successfully migrated RefundVault yield keys from instance to persistent storage with TTL bumping and documentation updates satisfying issue 131. Reviewed commit: |
|
MergeKeeper merge status Status: blocked Reason: One or more required CI checks failed. Failing checks:
Next steps:
|
- Add missing Events trait imports for self-transfer tests - Prefix unused variable with underscore in set_token test Fixes accensa#131 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…storage audit (accensa#131) Add 7 tests to yield_tests.rs verifying yield-related keys (YieldStrategy, DeployedPrincipal, HarvestedYield, ReserveRatio, MaxDeployRatio) are stored in Persistent storage with proper TTL extension via persist_yield_ttl, and that non-yield calls (deposit, refund) never create or mutate them. Update docs/storage-audit.md to document all yield keys as Persistent entries, explain their TTL strategy, and add them to the rent cost section. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
MergeKeeper review unavailable AI provider review response did not contain valid JSON No approval or merge action was taken. |
- Move soroban-sdk testutils feature from dependencies to dev-dependencies in contracts/testutils/Cargo.toml, fixing the build-wasm failure where soroban-sdk's testutils module compiled for wasm32v1-none and pulled in `rand` (which doesn't support wasm32). - Fix unclosed delimiter in test_process_batch_exceeds_max_size_fails (test.rs) where the assert_eq! macro and closing brace were missing due to a bad merge. - Fix import ordering in test.rs (cargo fmt). - Apply cargo fmt to yield_tests.rs for consistent formatting. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
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
Moves yield-related storage keys from Instance to Persistent storage in
RefundVaultin response to Issue #131 (Optimize Storage Layout and Instance Data Footprint).Problem
Yield-related keys (
YieldStrategy,DeployedPrincipal,HarvestedYield,ReserveRatio,MaxDeployRatio) were stored in Instance storage, which is loaded on every contract invocation — including non-yield calls likedeposit,refund,withdraw,pause, and admin transfers. This led to unnecessarily high read/write byte fees on the most common operations.Fix
persist_yield_ttlhelper.get_yield_info()reads from Persistent storage.Acceptance criteria
Files changed
contracts/refund-vault/src/lib.rs— Storage class changes,persist_yield_ttlhelperCHANGELOG.md— Entry for issue Optimize Storage Layout and Instance Data Footprint in RefundVault #131Fixes #131