feat(cold): increase LRU cache from 128 to 2048 entries#55
Merged
Conversation
Member
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
prestwich
requested changes
Apr 16, 2026
Member
prestwich
left a comment
There was a problem hiding this comment.
add patch version bump on this pr
128 entries is too small for RPC workloads where the same recent blocks, transactions, and receipts are queried repeatedly by different concurrent callers, causing unnecessary cold storage round-trips. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removes the explanatory comment on DEFAULT_CACHE_CAPACITY per review feedback. Bumps workspace version from 0.7.1 to 0.7.2. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d1f5ca5 to
dfa0f4f
Compare
prestwich
approved these changes
Apr 16, 2026
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
DEFAULT_CACHE_CAPACITYfrom 128 to 2048 entries per map (headers, transactions, receipts)Context
The cold storage task allows up to 64 concurrent readers, all of which populate and read from a shared LRU cache. At 128 entries, the cache thrashes under typical RPC workloads where multiple callers request overlapping blocks/transactions, defeating the purpose of the cache layer.
2048 entries covers roughly the last ~2048 blocks of headers and the most active transactions/receipts, which is a reasonable working set for an RPC endpoint.
Test plan
cargo +nightly fmt -- --checkcargo clippy -p signet-cold --all-targetscargo t -p signet-cold🤖 Generated with Claude Code