aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/governance.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2018-09-28 13:06:16 +0800
committerGitHub <noreply@github.com>2018-09-28 13:06:16 +0800
commit9ad4ae71b5a49ddc77687cc368c31416a0ee0688 (patch)
treeca29f72aa63b6610f0a8ec1aef2e842677e9ac6f /simulation/governance.go
parent5fc0efa940c7663a33d0fc501807a2627d2cb573 (diff)
downloaddexon-consensus-9ad4ae71b5a49ddc77687cc368c31416a0ee0688.tar
dexon-consensus-9ad4ae71b5a49ddc77687cc368c31416a0ee0688.tar.gz
dexon-consensus-9ad4ae71b5a49ddc77687cc368c31416a0ee0688.tar.bz2
dexon-consensus-9ad4ae71b5a49ddc77687cc368c31416a0ee0688.tar.lz
dexon-consensus-9ad4ae71b5a49ddc77687cc368c31416a0ee0688.tar.xz
dexon-consensus-9ad4ae71b5a49ddc77687cc368c31416a0ee0688.tar.zst
dexon-consensus-9ad4ae71b5a49ddc77687cc368c31416a0ee0688.zip
core: Add sizes of various nodeSets (#148)
Diffstat (limited to 'simulation/governance.go')
-rw-r--r--simulation/governance.go19
1 files changed, 13 insertions, 6 deletions
diff --git a/simulation/governance.go b/simulation/governance.go
index 3290075..3351202 100644
--- a/simulation/governance.go
+++ b/simulation/governance.go
@@ -43,6 +43,7 @@ type simGovernance struct {
dkgMasterPublicKey map[uint64][]*types.DKGMasterPublicKey
lambdaBA time.Duration
lambdaDKG time.Duration
+ roundInterval time.Duration
network *network
}
@@ -63,6 +64,7 @@ func newSimGovernance(
dkgMasterPublicKey: make(map[uint64][]*types.DKGMasterPublicKey),
lambdaBA: time.Duration(consensusConfig.LambdaBA) * time.Millisecond,
lambdaDKG: time.Duration(consensusConfig.LambdaDKG) * time.Millisecond,
+ roundInterval: time.Duration(consensusConfig.RoundInterval) * time.Millisecond,
}
}
@@ -84,12 +86,17 @@ func (g *simGovernance) GetNodeSet(round uint64) (ret []crypto.PublicKey) {
// GetConfiguration returns the configuration at a given round.
func (g *simGovernance) GetConfiguration(round uint64) *types.Config {
return &types.Config{
- NumShards: 1,
- NumChains: g.chainNum,
- LambdaBA: g.lambdaBA,
- LambdaDKG: g.lambdaDKG,
- K: g.k,
- PhiRatio: g.phiRatio,
+ NumShards: 1,
+ NumChains: g.chainNum,
+ LambdaBA: g.lambdaBA,
+ LambdaDKG: g.lambdaDKG,
+ K: g.k,
+ PhiRatio: g.phiRatio,
+ NumNotarySet: len(g.nodeSet),
+ NumWitnessSet: len(g.nodeSet),
+ NumDKGSet: len(g.nodeSet),
+ MinBlockInterval: g.lambdaBA * 3,
+ MaxBlockInterval: g.lambdaBA * 8,
}
}