diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-01-08 16:14:11 +0800 |
---|---|---|
committer | haoping-ku <haoping.ku@dexon.org> | 2019-01-08 16:14:11 +0800 |
commit | c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2 (patch) | |
tree | a0f97edeefcde58f7d0de245b96e14266d932cdb | |
parent | 72e71281d966985d21fe2ec0298c540cf442d055 (diff) | |
download | dexon-consensus-c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2.tar dexon-consensus-c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2.tar.gz dexon-consensus-c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2.tar.bz2 dexon-consensus-c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2.tar.lz dexon-consensus-c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2.tar.xz dexon-consensus-c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2.tar.zst dexon-consensus-c2f02dcd02c8bf50321ba8d742ebfaf2ab74f8d2.zip |
core: fix ci fail (#411)
* Compose hashes for debugApp only
* Remove TODOs
They are already done
* Fix total ordering handing issue
-rw-r--r-- | core/lattice.go | 8 | ||||
-rw-r--r-- | core/total-ordering.go | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/core/lattice.go b/core/lattice.go index 4c53352..4642820 100644 --- a/core/lattice.go +++ b/core/lattice.go @@ -256,11 +256,11 @@ func (l *Lattice) ProcessBlock( if len(toDelivered) == 0 { break } - hashes := make(common.Hashes, len(toDelivered)) - for idx := range toDelivered { - hashes[idx] = toDelivered[idx].Hash - } if l.debug != nil { + hashes := make(common.Hashes, len(toDelivered)) + for idx := range toDelivered { + hashes[idx] = toDelivered[idx].Hash + } l.debug.TotalOrderingDelivered(hashes, deliveredMode) } // Perform consensus timestamp module. diff --git a/core/total-ordering.go b/core/total-ordering.go index de8dd0b..2e2158e 100644 --- a/core/total-ordering.go +++ b/core/total-ordering.go @@ -652,12 +652,14 @@ func (global *totalOrderingGlobalVector) addBlock( return } // Add breakpoint. - global.breakpoints[chainID] = append( - global.breakpoints[chainID], - &totalOrderingBreakpoint{ - roundID: b.Position.Round, - lastHeight: tip.Position.Height, - }) + if b.Position.Round > global.curRound { + global.breakpoints[chainID] = append( + global.breakpoints[chainID], + &totalOrderingBreakpoint{ + roundID: b.Position.Round, + lastHeight: tip.Position.Height, + }) + } } else { if b.Position.Height != tip.Position.Height+1 { err = ErrInvalidDAG @@ -1052,7 +1054,6 @@ func (to *totalOrdering) generateDeliverSet() ( wg.Wait() // Reset dirty chains. to.dirtyChainIDs = to.dirtyChainIDs[:0] - // TODO(mission): ANS should be bounded by current numChains. globalAnsLength := globalInfo.getAckingNodeSetLength( globalInfo, cfg.k, cfg.numChains) CheckNextCandidateLoop: @@ -1126,7 +1127,6 @@ CheckNextCandidateLoop: checkANS := func() bool { var chainAnsLength uint64 for p := range precedings { - // TODO(mission): ANS should be bound by current numChains. chainAnsLength = to.candidates[p].getAckingNodeSetLength( globalInfo, cfg.k, cfg.numChains) if uint64(chainAnsLength) < uint64(cfg.numChains)-cfg.phi { |