Skip to content

fix(tempo): expire replay claims after challenge deadline - #33

Open
EfeDurmaz16 wants to merge 1 commit into
stripe:mainfrom
EfeDurmaz16:fix/expiring-replay-claims
Open

EfeDurmaz16 wants to merge 1 commit into
stripe:mainfrom
EfeDurmaz16:fix/expiring-replay-claims

Conversation

@EfeDurmaz16

Copy link
Copy Markdown

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 build passed 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.

@EfeDurmaz16
EfeDurmaz16 marked this pull request as ready for review September 24, 2026 09:09
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.

MemoryStore should evict claims once their challenge expires

1 participant