Simd 118: always pass epoch reward status to snapshot as None #1253
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
As of #1159,
Bank::epoch_reward_status
is always populated from recalculation during the rewards period; the snapshot data is never used. Therefore, there is no need to pass a populatedepoch_reward_status
to snapshot serialization.Summary of Changes
Always pass
epoch_reward_status
to snapshot serialization as None. There are several other pieces of snapshot logic that can now be removed, but I wanted to take this slowly and carefully.Side note: I was surprised that the frozen_abi hash needed to be updated on this change, since the
Some
variant is still available in the snapshot format. However, it was a useful opportunity to learn more about the frozen_abi process. Structs tagged withAbiExample
are initialized with minimally populated values, not defaults. So a print statement forBank::epoch_reward_status
added to the test here showsEpochRewardStatus::Active(_)
containing one reward (with default values), and this is what was being used in serialization to determine the frozen_abi hash. Since this PR always usesNone
in serialization, the frozen_abi hash changes.On the plus side, I would expect the frozen_abi hash to not change again when the actual
epoch_reward_status
field is removed from the snapshot.