This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
Searching leader schedule for leader slots is inefficient #8484
Labels
enhancement
New feature or request
stale
[bot only] Added to stale content; results in auto-close after a week.
Milestone
Problem
Follow up to: #8468
In the current implementation here: https://github.com/solana-labs/solana/pull/8468/files#diff-bf2148039ffb77b38df2bbae2f74b418R146,
Once the first leader slot
N
is found, the last slot is at most N + GRACE_TICKS_FACTOR * MAX_GRACE_SLOTS. This means:What still sucks: You still have to iterate through N entries in the schedule, granted these iterations are a lot faster because they do not incur a RocksDb lookup.
Proposed Solution
Build a
BTreeSet
with all the leader schedule slots a validator is scheduled for, which should make "next" queries fast with thebtreeset.range
function. Purge the set when roots are set.The text was updated successfully, but these errors were encountered: