Skip to content

Conversation

@aamirpashaa
Copy link
Contributor

DON'T MERGE UNTIL #54 IS MERGED

This pull request updates the maximum number of block producers from 42 to 35 across the system contract codebase and related tests. The changes ensure consistency in producer count definitions and update related logic and comments for clarity.

Producer count update:

  • Changed the MAX_PRODUCERS definition from 42 to 35 in producer_pay.cpp, system_rotation.cpp, and the test file telos.system_tests.cpp to ensure consistent producer limits throughout the system. [1] [2] [3]

Producer pay logic and documentation:

  • Updated the comments and logic for producer pay multipliers in producer_pay.cpp to reflect the new range for standby block producers (now ranks 22nd to 35th) and adjusted example values accordingly. [1] [2]

// ...
// activecount = 42: 63
// activecount = 35: 56.98
double sum_of_multipliers = activecount <= 21 ? (((activecount)/2)*(2*1.2-(activecount-1)*0.02) * 2) : (42 + ((activecount-21)/2)*(2*1.2-(activecount-22)*0.02));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without diving more into the math, I'm unsure if this change needs to be made or not. But I'll leave a comment here so that those with better knowledge of the math can give it some thought.

(42 + ((activecount-21)/2)*(2*1.2-(activecount-22)*0.02))

This formulate for when more than 21 producers exist has 42 hardcoded into the math. Should this also be changed to 35 or potentially use the MAX_PRODUCERS constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

42 is the sum of the multipliers for the first 21 BPs (active producers), which is the sum of [2x1.2, 2x1.18, 2x1.16, ..., 2x0.82, 2x0.8], which is equal to [2.4, 2,36, ..., 1.64,1.6].
If the total number of active producers is less than 21, we only need to sum the first n multipliers. If they exceed 21, it would be 42 plus the sum of the multipliers for the next standby BPs which is sum of [1.2, 1.18, ..., 0.82, 0.8]
For example if the total number of BPs are 25, the sum of the multipliers would be 42 + (1.2 + 1.18 + 1.16 + 1.14) which is equal to 46.68
We should notice that this arithmetic sequence is designated for 21 producers based on the governance proposal. Therefore, we may need to select an alternative common difference and initial term for this series if we modify the total number of active BPs and adjust the formula.

@aamirpashaa aamirpashaa changed the base branch from voting_changes to main November 30, 2025 11:05
@aamirpashaa aamirpashaa changed the base branch from main to voting_changes November 30, 2025 11:05
@aamirpashaa aamirpashaa merged commit 1a5d156 into voting_changes Dec 4, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants