Make ReplayStage create the parallel fork replay threadpool#137
Make ReplayStage create the parallel fork replay threadpool#137steviez merged 5 commits intoanza-xyz:masterfrom
Conversation
More defensive should someone grow the enum
| if active_bank_slots.is_empty() { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
I thought that this was a simple enough sanity check to pull out and explicitly return early for - this enabled us to remove a level of indentation for everything else
There was a problem hiding this comment.
early returns make code more complex and easier to introduce bugs in the future. CHANGE MY MIND
There was a problem hiding this comment.
Number of bugs in a function is proportional to the maximum indent. CHANGE MY MIND
There was a problem hiding this comment.
early returns make code more complex and easier to introduce bugs in the future
There was a problem hiding this comment.
Number of bugs in a function is proportional to the maximum indent. CHANGE MY MIND
you're stuck in the present old man. join us in the future!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #137 +/- ##
=======================================
Coverage 81.8% 81.8%
=======================================
Files 838 838
Lines 226223 226227 +4
=======================================
+ Hits 185240 185266 +26
+ Misses 40983 40961 -22 |
|
How painful is it on validators to switch up CLI args? It would be nice to replace |
I was probably going to partially deprecate this argument anyways in favor an argument that allows for configuration of the number of threads. So, something like: We can still accept the old flag (but issue a warning that it is deprecated), but just choose a reasonable default value for the old flag (since the old flag is a bool, not a number) |
…#137) ReplayStage owning the pool allows for subsequent work to configure the size of the pool; configuring the size of the pool inside of the lazy_static would have been a little messy
We want to have invalidator specific changes in the release branches as well. Document the synchronization process for release branches. Extend slow-rebase.sh to accept target branch name as an argument.
Problem
As part of work for #105, it will be desirable to make the thread pool size configurable on the CLI. The pool is currently within a
lazy_static; configuring the size for that from the CLI is a little "messy". We'd need to add another function that sets a global (before the thread pool is created), and then have thread pool creation read that value. This is of course susceptible to a potential race condition and/or some annoying code to ensure that the pool comes back the size we actually wanted it to be.Summary of Changes
Instead of using the lazy_static, just have
ReplayStagecreate the thread pool (if parallel replay is enabled).There will be some whitespace difference - I'd suggest either viewing with "hide whitespace", or view commit-by-commit (I ran
cargo fmtin separate commits)