Proto: do not initialize the staking balance lazily
Context
In !10455 (merged), we keep track of the minimum of the delegated balance of a delegate over each cycle, but it is always zero in the cycle when a delegate is registered because of the lazy initialization of the staking balance.
This MR ensures that the staking balance is explicitly initialized when a delegate is registered. The lazy initialization was useless. Though we could think it was introduced at some point and some registered delegates may have no staking balance but it is probably wrong, and at least it is wrong on mainnet where I checked that the set of registered delegates and the keys of staking balances are the same.
This MR is a prerequisite for !10455 (merged)
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR