fix(tempo): expire replay claims after challenge deadline - #33
Open
EfeDurmaz16 wants to merge 1 commit into
Open
EfeDurmaz16 wants to merge 1 commit into
EfeDurmaz16 wants to merge 1 commit into
Conversation
EfeDurmaz16
marked this pull request as ready for review
September 24, 2026 09:09
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.
Tempo replay claims currently remain in MemoryStore for the lifetime of the process. Add an expiry-aware Store overload and reclaim expired claims on subsequent store operations, using a map and expiry queue under one lock. Existing Store implementations and lambdas remain compatible and retain claims permanently through the default overload.
Tempo passes the authenticated, memo-bound challenge deadline to the store and rejects verification at or after that deadline, including after receipt verification and a delayed store call. This intentionally makes completion strict: a transaction broadcast before expiry may settle even though verification subsequently returns payment-expired. No background worker or dependency is added; idle stores keep expired records until the next operation.
Validation:
./gradlew test buildpassed on Java 17 (Java 11 target), with 176 tests. Coverage includes exact expiry boundaries, untouched-key reclamation, permanent claims, concurrent single-winner claims, lock waiting, both Tempo payload types, and legacy stores. A local retention repro retained 100,001 entries before the change; the expiry workload reclaimed 100,000 expired entries on the next call. Live-node integration tests were not run.Closes #25.