Implement-Soroban-Contract-Invocation-Cache#412
Merged
mijinummi merged 1 commit intoMay 30, 2026
Merged
Conversation
Implement-Soroban-Contract-Invocation-Cache
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.
Implement Soroban Contract Invocation Cache
Overview
This PR introduces a caching layer for Soroban contract invocation results to reduce RPC load, improve response times, and optimize overall application performance. Frequently requested contract calls can now be served from cache instead of repeatedly querying the Stellar RPC endpoint.
Problem
Repeated invocations of the same Soroban contract methods generate unnecessary RPC traffic and increase latency for end users. As application usage grows, redundant requests can lead to higher infrastructure costs and slower response times.
Changes Implemented
Contract Invocation Cache
src/cache/contracts/stellar/Cache Expiration Policies
Cache Management
Generates deterministic cache keys based on:
Prevents collisions between different contract invocations
Performance Improvements
Technical Details
Location
Cache Flow
Request for contract invocation received
Cache key generated from invocation parameters
Cache checked for existing valid response
If cache hit:
If cache miss:
Acceptance Criteria Coverage
Testing
Verified Scenarios
Impact
This implementation significantly reduces redundant Soroban RPC traffic, improves application responsiveness, and provides a scalable foundation for future blockchain data caching strategies.
Closes #356