Add pre-conditions to candidate limits and slot limits enforcing size #341
Labels
Feedback
good first issue
Good for newcomers
help wanted
Extra attention is needed
SC-Eng
Issues that we want to see surfaced in SC-Eng ZH Board
Issue To Be Solved
In general, we expect that:
the candidate limit exceeds the slot limit by a large margin (probably about an order of magnitude)
the number of new approved nodes is small relative to the difference between slot limit and candidate limit
In addition, nodes which are already staked do not take up candidate spots.
Suggest A Solution
It would be more useful to enforce some logical consistency in the two setter functions:
setSlotLimits panics if a slot limit is set higher than the candidate limit
setCandidateNodeLimit panics if a slot limit is set higher than the candidate limit
Need tests to test positive and negative cases
The text was updated successfully, but these errors were encountered: