[Smart Contracts] Add error expiration/TTL with configurable retention and automatic cleanup - #220
Open
Dannyswiss1 wants to merge 1 commit into
Open
Conversation
…n and automatic cleanup
|
@Dannyswiss1 is attempting to deploy a commit to the Jaja's projects Team on Vercel. A member of the Team first needs to authorize it. |
devJaja
self-requested a review
August 24, 2026 01:02
Contributor
|
Nice implementation @Dannyswiss1 , I can see all CI checks passed. kindly resolve the conflicts |
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
created_at/expires_atfields toErrorEntry, stamped inreport_errorusing a configurable per-contract TTL (default ~30 days / 518,400 ledgers)set_error_ttl(ttl_ledgers)andget_error_ttl()to read/configure retention, following the existingpause/unpauseadmin-auth patterncleanup_expired_errors(error_ids)that removes entries past theirexpires_atfrom the caller-supplied id list (Soroban has no full-storage iterator, so callers/off-chain indexers supply candidate ids — noted in the issue as the expected approach)get_errorto bump the persistent-storage TTL on access, consistent with how agent records are treatedGasConfig/estimate_gaswithcleanup_error/cleanup_error_marginalsocleanup_expired_errorshas a gas budget estimate like the other batch opsCloses #166
Test plan
cargo test -p agent-registry --lib— 44/44 passing (36 pre-existing + 8 new)error_expires_after_configured_ttl,cleanup_expired_errors_removes_expired_entries, andset_error_ttl_requires_admin_authcover the three acceptance-criteria unit tests explicitly