params_shared.go 391 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
package sectorbuilder

// /////
// Proofs

// 1 / n
const SectorChallengeRatioDiv = 25

const MaxFallbackPostChallengeCount = 10

// extracted from lotus/chain/types/blockheader
Jakub Sztandera's avatar
Jakub Sztandera committed
12
13
func ElectionPostChallengeCount(sectors uint64, faults uint64) uint64 {
	if sectors-faults == 0 {
14
15
16
		return 0
	}
	// ceil(sectors / SectorChallengeRatioDiv)
Jakub Sztandera's avatar
Jakub Sztandera committed
17
	return (sectors-faults-1)/SectorChallengeRatioDiv + 1
18
}