Clean up before credits_auto_rewind#22839
Conversation
| // Drive credits_observed forward unconditionally when rewards are disabled | ||
| // or when this is the stake's activation epoch | ||
| if point_value.rewards == 0 | ||
| || (fix_activating_credits_observed && stake.delegation.activation_epoch == rewarded_epoch) |
There was a problem hiding this comment.
I'm intentionally removing the sole use of this obsolete feature guard ( fix_activating_credits_observed #19309 ) because i believe this has been activated across board already (mainnet-beta, testnet, devnet). CC: @joncinque
On the other hand, i'm trying to reuse its plumbing for another my feature (ref: #22546 ). so, I'm keeping the plumbing intentionally as well.
There was a problem hiding this comment.
Yep, it's been active for awhile, so feel free to remove it
Codecov Report
@@ Coverage Diff @@
## master #22839 +/- ##
=========================================
- Coverage 81.2% 81.2% -0.1%
=========================================
Files 560 560
Lines 151332 151340 +8
=========================================
- Hits 122980 122978 -2
- Misses 28352 28362 +10 |
| if let Some(inflation_point_calc_tracer) = inflation_point_calc_tracer.as_ref() { | ||
| inflation_point_calc_tracer(&SkippedReason::DisabledInflation.into()); | ||
| } | ||
| forced_credits_update_with_skipped_reward |= true; |
There was a problem hiding this comment.
Any (upcoming) reason this needs to be |= instead of just =? Seems more confusing than helpful in the case of a mutable bool, and the two cases won't ever both be evaluated.
There was a problem hiding this comment.
well, there is no reason. changed to =: 6ea8189
| if let Some(inflation_point_calc_tracer) = inflation_point_calc_tracer.as_ref() { | ||
| inflation_point_calc_tracer(&SkippedReason::JustActivated.into()); | ||
| } | ||
| forced_credits_update_with_skipped_reward |= true; |
* Clean up before credits_auto_rewind * Use `=` intead of `|=` for mutable bool (cherry picked from commit 545c97f)
* Clean up before credits_auto_rewind * Use `=` intead of `|=` for mutable bool (cherry picked from commit 545c97f)
* Clean up before credits_auto_rewind * Use `=` intead of `|=` for mutable bool
Problem
it's desired to clean some code upfront before the staking reward code tweak (#22546 ) in order to minimize the risk and cognitive load when reviewing such a critical code change.
Summary of Changes
Do the cleanup as a preparatory pr; there should be no functionality change in this pr in any way.
Fixes #