BakerPoolRewardDetails
hashing and updating improvements
#1109
Labels
[Size] Small
[Type] Change Request
Some visible functionality should be change.
[Type] Maintenance
Cleanup or handling of technical debt.
Currently, the
BakerPoolRewardDetails
are stored in an LFMBTree usingBufferedRef
references:One problem with this is that the reward details of the baker of a block (at least) are updated every block, and so the hash needs to be recomputed. For
BufferedRef
, the hashes of nodes in the LFMBTree are not cached, and will be recomputed for the entire tree when we need the hash.HashedBufferedRef
should avoid this.Related to this,
bsoMarkFinalizationAwakeBakers
actually touches all of the entries inBakerPoolRewardDetails
for bakers that are to be marked as awake for finalization (even if they already are). This results in unnecessary data being written to the block state database on almost every block. Instead, the reward details should only be updated when a change is actually being made. (Without this, the benefits of usingHashedBufferedRef
would likely be diminished, as much of the tree would be rehashed anyway.)The text was updated successfully, but these errors were encountered: