Skip to content

[WIP][Shannon][Caching] Implement intelligent session caching based on actual session expiration block height#41

Draft
commoddity wants to merge 1 commit intoshannon-sdk-refactor-pt2from
intelligent-session-refresh
Draft

[WIP][Shannon][Caching] Implement intelligent session caching based on actual session expiration block height#41
commoddity wants to merge 1 commit intoshannon-sdk-refactor-pt2from
intelligent-session-refresh

Conversation

@commoddity
Copy link
Copy Markdown
Contributor

@commoddity commoddity commented Jun 19, 2025

🌿 Summary

Enable intelligent session caching in Shannon SDK gateways by aligning session refresh logic with blockchain block height instead of time-based TTLs.

🌱 Primary Changes:

  • Implement block-aware session monitoring using SessionEndBlockHeight with support for zero-downtime cache swaps.
  • Transition from time-based TTL to intelligent block-based session refresh lifecycle.
  • Add background sync system to pre-fetch and hot-swap sessions before expiration.
  • Replace early-refresh strategy with a polling mechanism at 1-second intervals near block height boundaries.
  • Restructure GatewayClientCache to support dynamic cache invalidation and background refresh.

🍃 Secondary changes:

  • Refactor and document caching constants and system architecture.
  • Simplify and consolidate configuration logic; remove TTL and early-refresh toggles.
  • Improve comments/docstrings across client packages for readability and maintainability.
  • Refactor and modularize sessionRefreshState, including internal helper methods.
  • Update GRPC client and associated error handling to reflect new session fetching strategy.

🛠️ Type of change

Select one or more from the following:

  • New feature, functionality or library

🤯 Sanity Checklist

  • I have updated the GitHub Issue 'assignees', 'reviewers', 'labels', 'project', 'iteration' and 'milestone'
  • I added TODOs where applicable

@commoddity commoddity self-assigned this Jun 19, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Shannon Jun 19, 2025
@Olshansk Olshansk changed the title [Shannon][Caching] Implement intelligent session caching based on actual session expiration block height [WIP][Shannon][Caching] Implement intelligent session caching based on actual session expiration block height Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 📋 Backlog

Development

Successfully merging this pull request may close these issues.

1 participant