aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@byzantine-lab.io>2019-08-27 23:06:41 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-08-27 23:13:43 +0800
commit733d64bfa11a412f82987a38a722dc5cd2749c0f (patch)
tree811f2e61161f6c0e5ec4436e4c6d07a271f31bd4
parent85029b400825d021bc2a72bdf46c93f10e824bbd (diff)
downloadtangerine-consensus-733d64bfa11a412f82987a38a722dc5cd2749c0f.tar
tangerine-consensus-733d64bfa11a412f82987a38a722dc5cd2749c0f.tar.gz
tangerine-consensus-733d64bfa11a412f82987a38a722dc5cd2749c0f.tar.bz2
tangerine-consensus-733d64bfa11a412f82987a38a722dc5cd2749c0f.tar.lz
tangerine-consensus-733d64bfa11a412f82987a38a722dc5cd2749c0f.tar.xz
tangerine-consensus-733d64bfa11a412f82987a38a722dc5cd2749c0f.tar.zst
tangerine-consensus-733d64bfa11a412f82987a38a722dc5cd2749c0f.zip
core: utils: add GetDKGNackThreshold method
Nacking DKG requires a different threshold then DKG itself, since if there are more than t + 1 of node nacking a node, we can assume the node is actually dead.
-rw-r--r--core/utils/utils.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/utils/utils.go b/core/utils/utils.go
index f8b70d0..1d650bf 100644
--- a/core/utils/utils.go
+++ b/core/utils/utils.go
@@ -134,6 +134,11 @@ func LaunchDummyReceiver(
return dummyCancel, finishedChan
}
+// GetDKGNackThreshold return expected threshold for given nacking DKG set.
+func GetDKGNackThreshold(config *types.Config) int {
+ return int(config.NotarySetSize*1/3) + 1
+}
+
// GetDKGThreshold return expected threshold for given DKG set size.
func GetDKGThreshold(config *types.Config) int {
return int(config.NotarySetSize*2/3) + 1