diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-15 16:06:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-15 16:06:21 +0800 |
commit | 8e1b6161f346993b74558124758cfb650465cf05 (patch) | |
tree | c5b60eae90c3358e6faf43cee9d3ffc3b9945dd1 /core/utils | |
parent | 809e8def862fdfa792061a448f952747f1af4d3c (diff) | |
download | dexon-consensus-8e1b6161f346993b74558124758cfb650465cf05.tar dexon-consensus-8e1b6161f346993b74558124758cfb650465cf05.tar.gz dexon-consensus-8e1b6161f346993b74558124758cfb650465cf05.tar.bz2 dexon-consensus-8e1b6161f346993b74558124758cfb650465cf05.tar.lz dexon-consensus-8e1b6161f346993b74558124758cfb650465cf05.tar.xz dexon-consensus-8e1b6161f346993b74558124758cfb650465cf05.tar.zst dexon-consensus-8e1b6161f346993b74558124758cfb650465cf05.zip |
core: Fix BA3.0 (#420)
* Add Restart to Ticker
* Change pre allocated size
* Return NextTime from lattice
* Few hacky fixes for BA
* PullVote in FastRollback state
* Add shallowBlock for agreementResult
* Extend period
* Fixup
Diffstat (limited to 'core/utils')
-rw-r--r-- | core/utils/nodeset-cache.go | 2 | ||||
-rw-r--r-- | core/utils/nodeset-cache_test.go | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/core/utils/nodeset-cache.go b/core/utils/nodeset-cache.go index 35828b7..8a07c9d 100644 --- a/core/utils/nodeset-cache.go +++ b/core/utils/nodeset-cache.go @@ -247,7 +247,7 @@ func (cache *NodeSetCache) update( nIDs.notarySet[i] = nodeSet.GetSubSet( int(cfg.NotarySetSize), types.NewNotarySetTarget(crs, uint32(i))) } - nodesPerChain := cfg.RoundInterval / (cfg.LambdaBA * 4) + nodesPerChain := cfg.RoundInterval / cfg.MinBlockInterval for i := range nIDs.leaderNode { nIDs.leaderNode[i] = make(map[uint64]types.NodeID, nodesPerChain) } diff --git a/core/utils/nodeset-cache_test.go b/core/utils/nodeset-cache_test.go index 9e6ceee..c600f15 100644 --- a/core/utils/nodeset-cache_test.go +++ b/core/utils/nodeset-cache_test.go @@ -36,11 +36,12 @@ type nsIntf struct { func (g *nsIntf) Configuration(round uint64) (cfg *types.Config) { return &types.Config{ - NotarySetSize: 7, - DKGSetSize: 7, - NumChains: 4, - LambdaBA: 250 * time.Millisecond, - RoundInterval: 60 * time.Second, + NotarySetSize: 7, + DKGSetSize: 7, + NumChains: 4, + LambdaBA: 250 * time.Millisecond, + RoundInterval: 60 * time.Second, + MinBlockInterval: 1 * time.Second, } } func (g *nsIntf) CRS(round uint64) (b common.Hash) { return g.crs } |