Skip to content

feat(stellar): add announcement cache with MemoryCache and IndexedDBC…#36

Open
AlonsoFi wants to merge 1 commit into
wraith-protocol:developfrom
AlonsoFi:feat/stellar-cache-layer
Open

feat(stellar): add announcement cache with MemoryCache and IndexedDBC…#36
AlonsoFi wants to merge 1 commit into
wraith-protocol:developfrom
AlonsoFi:feat/stellar-cache-layer

Conversation

@AlonsoFi
Copy link
Copy Markdown

Closes #21

Implements the full cache layer from issue #12:

Cache abstraction: AnnouncementCache interface with get, put, getLastSeen, setLastSeen, clear
MemoryCache: LRU eviction by ledger bucket, deduplication by stealthAddress, network isolation
IndexedDBCache: batched writes (single IDBTransaction per put), 50 MB LRU eviction, schema versioning via
onupgradeneeded
fetchAnnouncements: delta-fetch wired — resumes from lastSeen ledger+cursor, merges with cache, supports bypassCache
option
Tests (cache.test.ts): eviction, network isolation, idempotency, lastSeen — MemoryCache
Tests (cache.idb.test.ts): full IndexedDBCache suite via fake-indexeddb + version migration test
Benchmarks (cache.bench.ts): put/get on 1000 announcements, incremental delta — run with pnpm vitest bench

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@AlonsoFi 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

@truthixify truthixify changed the base branch from main to develop June 1, 2026 15:32
@truthixify
Copy link
Copy Markdown
Contributor

Cache layer additions (MemoryCache + IndexedDB) are what we want for issue #21. Same rebase blocker as several other PRs this round, your branch is pre-develop. Rebase, keep develop's versions for files you didn't intend to touch, keep your new cache.ts / cache.test.ts / cache.idb.test.ts / cache.bench.ts additions.

git fetch origin
git rebase origin/develop
git push --force-with-lease

Thanks @AlonsoFi.

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.

In-memory + IndexedDB cache layer for fetchAnnouncements

2 participants