flow-core-contracts icon indicating copy to clipboard operation
flow-core-contracts copied to clipboard

Add pre-conditions to candidate limits and slot limits enforcing size

Open joshuahannan opened this issue 2 years ago • 0 comments

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

joshuahannan avatar Feb 01 '23 19:02 joshuahannan