Skip to content

feat:implimented TTL configuration#186

Merged
Cedarich merged 7 commits intoPulsefy:mainfrom
Agbeleshe:top-ups
Mar 31, 2026
Merged

feat:implimented TTL configuration#186
Cedarich merged 7 commits intoPulsefy:mainfrom
Agbeleshe:top-ups

Conversation

@Agbeleshe
Copy link
Copy Markdown
Contributor

@Agbeleshe Agbeleshe commented Mar 24, 2026

Summary

This PR implements storage optimization strategies for the escrow contract by introducing Time-To-Live (TTL) management and data archiving mechanisms. The goal is to reduce on-chain storage footprint and minimize long-term costs for users in line with Soroban best practices.

Changes Made

  • Added TTL configuration for escrow records (default: 6 months)
  • Implemented an extend_ttl function to allow extension of active escrows
  • Introduced cleanup logic to remove expired or refunded escrow data
  • Ensured storage deposits are reclaimed where applicable
  • Updated internal storage handling to maintain a lean contract state

Technical Details

  • TTL is applied at the time of escrow creation
  • extend_ttl can only be called on active escrows
  • Cleanup function safely deletes expired or finalized records
  • Logic ensures no valid or active escrow data is accidentally removed

Testing

  • Verified TTL is correctly set and extended
  • Tested cleanup function for expired and refunded escrows
  • Confirmed no impact on active escrow operations
  • Ensured storage usage is reduced after cleanup execution

Notes

This implementation follows Soroban storage best practices to optimize contract efficiency and reduce unnecessary storage costs over time.

Closes: #159

@Agbeleshe Agbeleshe changed the title feat:implimented Grace Period for Top-Ups feat:implimented TTL configuration Mar 24, 2026
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 24, 2026

@Agbeleshe 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! 🚀

Learn more about application limits

@Cedarich
Copy link
Copy Markdown
Contributor

@Agbeleshe please fix workflow

@Agbeleshe
Copy link
Copy Markdown
Contributor Author

@Cedarich please review

@Agbeleshe
Copy link
Copy Markdown
Contributor Author

@Cedarich please review

@Agbeleshe
Copy link
Copy Markdown
Contributor Author

@Cedarich awaiting review

@Cedarich
Copy link
Copy Markdown
Contributor

@Agbeleshe please fix clippy

@Agbeleshe
Copy link
Copy Markdown
Contributor Author

@Cedarich Please review

Copy link
Copy Markdown
Contributor

@Cedarich Cedarich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cedarich Cedarich merged commit cd34020 into Pulsefy:main Mar 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Storage Footprint Optimization: TTL & Archiving

2 participants