aboutsummaryrefslogtreecommitdiffstats
path: root/core/consensus.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-08-10 15:12:56 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2018-08-10 15:12:56 +0800
commit09a0ab086cdafcb27b74e6346efdc8e96ca8145d (patch)
treec14bda316a48c94e5300b5799f152a82f0594558 /core/consensus.go
parent03917cdfa1f762849541e1bed31394340ed1f957 (diff)
downloaddexon-consensus-09a0ab086cdafcb27b74e6346efdc8e96ca8145d.tar.gz
dexon-consensus-09a0ab086cdafcb27b74e6346efdc8e96ca8145d.tar.zst
dexon-consensus-09a0ab086cdafcb27b74e6346efdc8e96ca8145d.zip
core: update governance interface and move K into config (#40)
Diffstat (limited to 'core/consensus.go')
-rw-r--r--core/consensus.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/core/consensus.go b/core/consensus.go
index 33f2f8b..d668c9e 100644
--- a/core/consensus.go
+++ b/core/consensus.go
@@ -42,7 +42,6 @@ func NewConsensus(
app Application,
gov Governance,
db blockdb.BlockDatabase) *Consensus {
-
validatorSet := gov.GetValidatorSet()
// Setup acking by information returned from Governace.
@@ -52,11 +51,9 @@ func NewConsensus(
}
// Setup sequencer by information returned from Governace.
- // TODO(mission): the value of 'K' should be in governace.
- // TODO(mission): the ratio of 'phi' should be in governance.
to := newTotalOrdering(
- 0,
- uint64(2*(len(validatorSet)-1)/3+1),
+ uint64(gov.GetTotalOrderingK()),
+ uint64(float32(len(validatorSet)-1)*gov.GetPhiRatio()+1),
uint64(len(validatorSet)))
return &Consensus{