-
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_bank takes owned Arc<Bank> #31717
set_bank takes owned Arc<Bank> #31717
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31717 +/- ##
=========================================
- Coverage 81.9% 81.8% -0.1%
=========================================
Files 737 737
Lines 205985 205985
=========================================
- Hits 168719 168697 -22
- Misses 37266 37288 +22 |
@@ -1948,7 +1948,7 @@ impl ReplayStage { | |||
poh_recorder | |||
.write() | |||
.unwrap() | |||
.set_bank(&tpu_bank, track_transaction_indexes); | |||
.set_bank(tpu_bank, track_transaction_indexes); |
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.
yay, one less clone for block generation code path. :)
assert!(self.working_bank.is_none()); | ||
self.leader_bank_notifier.set_in_progress(bank); | ||
self.leader_bank_notifier.set_in_progress(&bank); |
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.
hehe, set_in_progress
seems to be a rare exception for this Arc<_>
arg fixup saga... lol
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.
Yeah, I think the exception is justified as it does not take ownership of the Arc. It uses the arc to create a weak-reference.
(I know you know this, just making it clear for anyone else looking at the PR why this should be an exception)
bank, | ||
start: Arc::new(Instant::now()), |
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.
oh, unfortunate reordering due to unhappy borrow checker. ;)
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.
lgtm; thanks for cleaning up (no nits this time!)
Problem
set_bank
is taking ownership of theArc<Bank>
.Summary of Changes
Update function signature.
Fixes #