uses MAX_LEADER_SCHEDULE_STAKES for cluster-nodes cache capacity#2151
Merged
behzadnouri merged 1 commit intoanza-xyz:masterfrom Jul 18, 2024
Merged
Conversation
Because of the TTL based eviction it does not make sense to cache more than MAX_LEADER_SCHEDULE_STAKES epochs.
bw-solana
approved these changes
Jul 18, 2024
bw-solana
left a comment
There was a problem hiding this comment.
Looks good to me. Left one question
| mod standard_broadcast_run; | ||
|
|
||
| const CLUSTER_NODES_CACHE_NUM_EPOCH_CAP: usize = 8; | ||
| const_assert_eq!(CLUSTER_NODES_CACHE_NUM_EPOCH_CAP, 5); |
There was a problem hiding this comment.
Why the assert? Are you worried about max leader schedule stakes adjusting up? If so, maybe we should min this with some constant cap?
Author
There was a problem hiding this comment.
Just as an explicit signal that if that constant is changed, it has ramifications here.
Also serves as a documentation that what the capacity actually is.
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.
Problem
Because of the TTL based eviction it does not make sense to cache more than
MAX_LEADER_SCHEDULE_STAKESepochs.Summary of Changes
Set
CLUSTER_NODES_CACHE_NUM_EPOCH_CAPequal toMAX_LEADER_SCHEDULE_STAKES.Some more context here: #1735 (comment)