-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature - Epoch boundary recompilation phase #33477
Feature - Epoch boundary recompilation phase #33477
Conversation
c74fd46
to
496b3d8
Compare
2cd41cf
to
b82339f
Compare
Codecov Report
@@ Coverage Diff @@
## master #33477 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 809 809
Lines 218062 218105 +43
=========================================
+ Hits 178672 178684 +12
- Misses 39390 39421 +31 |
e5d13d3
to
0fac427
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
7a850e0
to
b9c2b05
Compare
b9c2b05
to
3a9ca95
Compare
a29f8cc
to
0d25f22
Compare
0d25f22
to
a5814fe
Compare
let mut loaded_programs_cache = new.loaded_programs_cache.write().unwrap(); | ||
loaded_programs_cache.replenish(key, recompiled); | ||
} | ||
} else if new.epoch() != loaded_programs_cache.latest_root_epoch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could a malicious leader trigger this check by adding a bank in a future epoch? Does it make sense to make this check more specific (e.g. new.epoch == loaded_programs_cache.latest_root_epoch + 1, and slot is within N slots in the new epoch)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't leaders bound by the leader schedule in that they can't just submit a block for any slot, but only the one they were assigned to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember seeing this in one of the outages where the leader submitted a slot way in future. Maybe its not an issue anymore due to other checks.
Would making this check more strict cause any problems? It can be done in a separate PR if that's preferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would making this check more strict cause any problems?
Probably not, but haven't thought it through.
a5814fe
to
5347856
Compare
8e7c67d
to
1bad18d
Compare
1bad18d
to
a5db6d5
Compare
* Adds LoadedPrograms::upcoming_environments. * Moves LoadedPrograms::prune_feature_set_transition() into LoadedPrograms::prune(). * Adds parameter recompile to Bank::load_program(). * Sets latest_root_slot/epoch and environments in Bank::finish_init(). * Removes FEATURES_AFFECTING_RBPF list. * Adjusts test_feature_activation_loaded_programs_recompilation_phase(). (cherry picked from commit a9509f5) # Conflicts: # runtime/src/bank/tests.rs
* Adds LoadedPrograms::upcoming_environments. * Moves LoadedPrograms::prune_feature_set_transition() into LoadedPrograms::prune(). * Adds parameter recompile to Bank::load_program(). * Sets latest_root_slot/epoch and environments in Bank::finish_init(). * Removes FEATURES_AFFECTING_RBPF list. * Adjusts test_feature_activation_loaded_programs_recompilation_phase(). (cherry picked from commit a9509f5)
…) (#34003) Feature - Epoch boundary recompilation phase (#33477) * Adds LoadedPrograms::upcoming_environments. * Moves LoadedPrograms::prune_feature_set_transition() into LoadedPrograms::prune(). * Adds parameter recompile to Bank::load_program(). * Sets latest_root_slot/epoch and environments in Bank::finish_init(). * Removes FEATURES_AFFECTING_RBPF list. * Adjusts test_feature_activation_loaded_programs_recompilation_phase(). (cherry picked from commit a9509f5) Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
…na-labs#33477) (solana-labs#34003) Feature - Epoch boundary recompilation phase (solana-labs#33477) * Adds LoadedPrograms::upcoming_environments. * Moves LoadedPrograms::prune_feature_set_transition() into LoadedPrograms::prune(). * Adds parameter recompile to Bank::load_program(). * Sets latest_root_slot/epoch and environments in Bank::finish_init(). * Removes FEATURES_AFFECTING_RBPF list. * Adjusts test_feature_activation_loaded_programs_recompilation_phase(). (cherry picked from commit a9509f5) Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
…na-labs#33477) (solana-labs#34003) Feature - Epoch boundary recompilation phase (solana-labs#33477) * Adds LoadedPrograms::upcoming_environments. * Moves LoadedPrograms::prune_feature_set_transition() into LoadedPrograms::prune(). * Adds parameter recompile to Bank::load_program(). * Sets latest_root_slot/epoch and environments in Bank::finish_init(). * Removes FEATURES_AFFECTING_RBPF list. * Adjusts test_feature_activation_loaded_programs_recompilation_phase(). (cherry picked from commit a9509f5) Co-authored-by: Alexander Meißner <AlexanderMeissner@gmx.net>
Problem
This is a different approach to the problem as #32172 was flawed. It ended the recompilation phase at the first block after the epoch boundary, but we need to wait for a rerooting to be sure that we won't replay any blocks from before the epoch boundary anymore.
Summary of Changes
LoadedPrograms::upcoming_environments
: Which isSome
during the recompilation phase, even if there is no change to any environment.LoadedPrograms::prune_feature_set_transition()
intoLoadedPrograms::prune()
: Delays it to happen on the first rerooting after the epoch boundary.FEATURES_AFFECTING_RBPF
list: Because we can now automatically detect changes by usingBuiltinProgram::eq()
.Bank::load_program()
: Which isSome
when called from within the recompilation phase.