PohRecorder: SharedWorkingBank#7280
Conversation
This reverts commit ea2f9db.
| .upgrade() | ||
| /// Get the current poh working bank with a timeout. | ||
| fn get_working_bank_with_timeout(&self) -> Option<Arc<Bank>> { | ||
| const TIMEOUT: Duration = Duration::from_millis(50); |
There was a problem hiding this comment.
kept the timeout the same in this PR. I think we may want to remove this in the near future.
There was a problem hiding this comment.
for my own understanding since this is the first thing that jumped out: when/why
did we need such a long timeout?
There was a problem hiding this comment.
|
@alessandrod once merged we can use this in DecisionMaker to remove the poh lock optimistically when we are leader. We'll need some additional changes to remove the lock to get time until leader when we're not leader. I think that's also quite straight-forward though! |
| tick_cache: Vec<(Entry, u64)>, // cache of entry and its tick_height | ||
| working_bank: Option<WorkingBank>, | ||
| working_bank_sender: Sender<WorkingBankEntry>, | ||
| shared_working_bank: SharedWorkingBank, |
There was a problem hiding this comment.
I split this from working_bank because of unified-scheduler type messyness. Would have had like 3 or 4 levels of Arc indirection and would have required splitting the bank from the other working bank meta anyway.
This was the easier path.
There was a problem hiding this comment.
this seems fine, but maybe add a comment explaining that working_bank and
shared_working_bank are the same thing? Just in the (unlikely) case someone goes
and reworks working bank and doesn't notice the shared one or something
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7280 +/- ##
=========================================
- Coverage 82.8% 82.8% -0.1%
=========================================
Files 803 802 -1
Lines 364439 364255 -184
=========================================
- Hits 302080 301870 -210
- Misses 62359 62385 +26 🚀 New features to boost your workflow:
|
| .upgrade() | ||
| /// Get the current poh working bank with a timeout. | ||
| fn get_working_bank_with_timeout(&self) -> Option<Arc<Bank>> { | ||
| const TIMEOUT: Duration = Duration::from_millis(50); |
There was a problem hiding this comment.
for my own understanding since this is the first thing that jumped out: when/why
did we need such a long timeout?
| tick_cache: vec![], | ||
| working_bank: None, | ||
| working_bank_sender, | ||
| shared_working_bank: SharedWorkingBank::default(), |
There was a problem hiding this comment.
nit: I'd rather have this be SharedWorkingBank::empty() or something
IMO default is an anti pattern when the default isn't obvious, and in this case
it isn't clear what a default SharedWorkingBank is
| .get_or_wait_for_in_progress(Duration::from_millis(50)) | ||
| .upgrade() | ||
| /// Get the current poh working bank with a timeout. | ||
| fn get_working_bank_with_timeout(&self) -> Option<Arc<Bank>> { |
There was a problem hiding this comment.
nit: we must kill the get_ prefixes at some point (thing(), set_thing() is
idiomatic rust)
| tick_cache: Vec<(Entry, u64)>, // cache of entry and its tick_height | ||
| working_bank: Option<WorkingBank>, | ||
| working_bank_sender: Sender<WorkingBankEntry>, | ||
| shared_working_bank: SharedWorkingBank, |
There was a problem hiding this comment.
this seems fine, but maybe add a comment explaining that working_bank and
shared_working_bank are the same thing? Just in the (unlikely) case someone goes
and reworks working bank and doesn't notice the shared one or something
Problem
Summary of Changes
Fixes #