-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Set a global fork graph in program cache #33776
Conversation
aff744c
to
f6f234c
Compare
Codecov Report
@@ Coverage Diff @@
## master #33776 +/- ##
=========================================
- Coverage 81.8% 81.8% -0.1%
=========================================
Files 806 806
Lines 217937 218009 +72
=========================================
+ Hits 178322 178378 +56
- Misses 39615 39631 +16 |
@@ -55,6 +55,7 @@ struct SetRootTimings { | |||
prune_remove_ms: i64, | |||
} | |||
|
|||
#[derive(Debug)] |
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.
Think this can be removed again.
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.
Removing it causes the following error
error[E0277]: `BankForks` doesn't implement `std::fmt::Debug`
--> runtime/src/bank.rs:823:5
|
661 | #[derive(AbiExample, Debug)]
| ----- in this derive macro expansion
...
823 | pub loaded_programs_cache: Arc<RwLock<LoadedPrograms<BankForks>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `BankForks` cannot be formatted using `{:?}`
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.
Then manually: impl Debug for LoadedPrograms {}
. Should do that anyway because it contains a lot of things that are unhelpful to display.
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.
Yes, agree. Would be better as a separate PR.
61f588c
to
8a44175
Compare
* Set a global fork graph in program cache * fix deadlock * review feedback (cherry picked from commit 59cb3b5)
@@ -455,6 +455,20 @@ pub struct LoadedPrograms { | |||
/// Environments of the current epoch | |||
pub environments: ProgramRuntimeEnvironments, | |||
pub stats: Stats, | |||
fork_graph: Option<Arc<RwLock<FG>>>, |
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.
This should to be a Weak reference.
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.
Funny that I came across the same problem now: anza-xyz#1893
Backports to the stable branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. |
Problem
LoadedPrograms::prune()
is passed an instance of fork graph. Same information can be used in few other methods in the cache. It'll be ideal if the fork_graph can be set globally for the cache.Summary of Changes
Set fork_graph at startup and use it in prune.
Fixes #