import math
C = 2200
d = 30
maxConstraints = 2**27
flatOverhead = 7.5e6/2200 # non-sha operations
SHA = 45331
for a in range(14):
constraints = SHA*(d-a)*C+flatOverhead*C
partitions = math.ceil(constraints / maxConstraints)
if a != 0:
constraints += SHA*2**(a-1)*partitions + C*2**(a-1)
newPartitions = math.ceil(constraints / maxConstraints)
while partitions != newPartitions:
constraints += SHA*2**(a-1)*(newPartitions - partitions)
partitions = newPartitions
newPartitions = math.ceil(constraints / maxConstraints)
print(f"Apex {a} constraints: {constraints}, partitions: {partitions}")
Results
For 128bit:
Apex 0 constraints: 1712240000.0, partitions: 13
Apex 1 constraints: 1655730120.0, partitions: 13
Apex 2 constraints: 1599168560.0, partitions: 12
Apex 3 constraints: 1542945120.0, partitions: 12
Apex 4 constraints: 1487346240.0, partitions: 12
Apex 5 constraints: 1432583040.0, partitions: 11
Apex 6 constraints: 1380318080.0, partitions: 11
Apex 7 constraints: 1330982400.0, partitions: 10
Apex 8 constraints: 1290812800.0, partitions: 10
Apex 9 constraints: 1267321600.0, partitions: 10
Apex 10 constraints: 1277187200.0, partitions: 10
Apex 11 constraints: 1380226560.0, partitions: 11
Apex 12 constraints: 1722533760.0, partitions: 13
Apex 13 constraints: 4686649600.0, partitions: 35
For 80bit:
Apex 0 constraints: 1070150000.0, partitions: 8
Apex 1 constraints: 1034828095.0, partitions: 8
Apex 2 constraints: 999506190.0, partitions: 8
Apex 3 constraints: 964392380.0, partitions: 8
Apex 4 constraints: 929488040.0, partitions: 7
Apex 5 constraints: 895416080.0, partitions: 7
Apex 6 constraints: 862802160.0, partitions: 7
Apex 7 constraints: 833104320.0, partitions: 7
Apex 8 constraints: 809238640.0, partitions: 7
Apex 9 constraints: 790422240.0, partitions: 6
Apex 10 constraints: 794934480.0, partitions: 6
Apex 11 constraints: 865949120.0, partitions: 7
Apex 12 constraints: 1069968560.0, partitions: 8
Apex 13 constraints: 2942386080.0, partitions: 22
import math
C = 2200/128*80
d = 30
maxConstraints = 2**27
flatOverhead = 7.5e6/2200 # non-sha overhead
SHA = 45331
Poseidon8 = 531
def mary(h, m):
return (m**(h+1)-1)/(m-1)
for a in range(0, 18, 1):
C2 = 2**a * math.ceil(C/(2**a))
main = SHA*(d-a)*C2 + flatOverhead*C2 + SHA*a
partitions = main / maxConstraints
print(f"Apex {a} constraints: {main}, partitions: {partitions:.2f}")