perf: cursor-based event polling, Redis group state cache, and WebP images#949
Open
Markodiba wants to merge 2 commits into
Open
perf: cursor-based event polling, Redis group state cache, and WebP images#949Markodiba wants to merge 2 commits into
Markodiba wants to merge 2 commits into
Conversation
…mages - Soroban event polling: persist cursor to new SorobanEventCursor DB model so restarts resume from the last processed ledger; use startLedger param for incremental fetches at a fixed 5 s interval; invalidate group state cache on every new event batch - Redis group state cache: add GroupStateCache in backend/src/lib/cache.ts with 10 s TTL and per-contract bulk invalidation; expose cache_hits_total and cache_misses_total Prometheus counters on /metrics - Image optimisation: install vite-imagetools, configure Vite plugin, serve something_went_wrong as WebP with PNG fallback via <picture>, add lazy loading Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@Markodiba 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! 🚀 |
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
SorobanEventCursorPrisma model to persist the last processed ledger and Horizon paging token across restarts. The poll loop now passesstartLedgeras an incremental fetch parameter at a fixed 5 s interval and callsGroupStateCache.invalidateContract()after each batch.GroupStateCacheclass inbackend/src/lib/cache.tswraps ioredis with a 10-second TTL and supports per-group and per-contract invalidation. Two Prometheus counters (cache_hits_total,cache_misses_total) with acache="group_state"label are now exported on the/metricsendpoint.vite-imagetoolsand wired it intovite.config.ts. The error-page illustration is now served as WebP with a PNG fallback via a<picture>element and includesloading="lazy".Test plan
prisma migrate devthenprisma generateto apply the newSorobanEventCursortableResuming from persisted ledger …on a second start/metricsand verifycache_hits_totalandcache_misses_totalcounters appearGroupStateCache.get/setand check Redis keygroup_state:<contractId>:<groupId>expires after 10 snpm run buildinfrontend/and confirm no imagetools errors; inspect built assets for a.webpfile.webp)closes [Performance] Optimize Soroban event polling with cursor pagination #898
closes [Performance] Add Redis caching for group state queries #899
closes [Performance] Implement image optimization for frontend assets #900