From af3a293bfed8502dfe60191db2e2f1699ffc6d83 Mon Sep 17 00:00:00 2001 From: frozen <355847+Frozen@users.noreply.github.com> Date: Sat, 10 Sep 2022 18:02:45 +0700 Subject: [PATCH] fix --- api/service/explorer/service.go | 2 -- cmd/harmony/main.go | 3 --- consensus/consensus_service.go | 11 ----------- consensus/quorum/quorum.go | 7 +------ 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/api/service/explorer/service.go b/api/service/explorer/service.go index 5887bb3a0..6aa275332 100644 --- a/api/service/explorer/service.go +++ b/api/service/explorer/service.go @@ -115,8 +115,6 @@ func (s *Service) Run() *http.Server { s.router = mux.NewRouter() - fmt.Println("++", addr) - // Set up router for addresses. // Fetch addresses request, accepts parameter size: how much addresses to read, // parameter prefix: from which address prefix start diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 2fcfe5f03..4bb70a81b 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -266,8 +266,6 @@ func setupNodeLog(config harmonyconfig.HarmonyConfig) { func setupNodeAndRun(hc harmonyconfig.HarmonyConfig) { var err error - fmt.Println("OS: ", os.Args) - nodeconfigSetShardSchedule(hc) nodeconfig.SetShardingSchedule(shard.Schedule) nodeconfig.SetVersion(getHarmonyVersion()) @@ -803,7 +801,6 @@ func setupConsensusAndNode(hc harmonyconfig.HarmonyConfig, nodeConfig *nodeconfi // Set the consensus ID to be the current block number viewID := currentNode.Blockchain().CurrentBlock().Header().ViewID().Uint64() - fmt.Println("viewID:", viewID) currentConsensus.SetViewIDs(viewID + 1) utils.Logger().Info(). Uint64("viewID", viewID). diff --git a/consensus/consensus_service.go b/consensus/consensus_service.go index d26ea8ced..b01025121 100644 --- a/consensus/consensus_service.go +++ b/consensus/consensus_service.go @@ -213,7 +213,6 @@ func (consensus *Consensus) checkViewID(msg *FBFTMessage) error { if !msg.HasSingleSender() { return errors.New("Leader message can not have multiple sender keys") } - fmt.Println("[checkViewID] Set LEADEER PUB KEY ", msg.SenderPubkeys[0].Bytes.Hex(), utils.GetPort()) consensus.LeaderPubKey = msg.SenderPubkeys[0] consensus.IgnoreViewIDCheck.UnSet() consensus.consensusTimeout[timeoutConsensus].Start() @@ -397,7 +396,6 @@ func (consensus *Consensus) UpdateConsensusInformation() Mode { Str("leaderPubKey", leaderPubKey.Bytes.Hex()). Msg("[UpdateConsensusInformation] Most Recent LeaderPubKey Updated Based on BlockChain") consensus.pubKeyLock.Lock() - fmt.Println("[UpdateConsensusInformation] Most Recent LeaderPubKey Updated Based on BlockChain", leaderPubKey.Bytes.Hex(), utils.GetPort()) consensus.LeaderPubKey = leaderPubKey consensus.pubKeyLock.Unlock() } @@ -484,15 +482,6 @@ func (consensus *Consensus) StartFinalityCount() { consensus.finalityCounter.Store(time.Now().UnixNano()) } -//func (consensus *Consensus) ReshardingNextLeader(newblock *types.Block) { -// consensus.pubKeyLock.Lock() -// fmt.Println("nextBlock1 ", newblock.Header().Number().Uint64(), " ", consensus.LeaderPubKey.Bytes.Hex()) -// consensus.LeaderPubKey = consensus.getNextLeaderKey(consensus.GetCurBlockViewID() + 1) -// fmt.Println("nextBlock2 ", newblock.Header().Number().Uint64(), " ", consensus.LeaderPubKey.Bytes.Hex()) -// consensus.pubKeyLock.Unlock() -// -//} - // FinishFinalityCount calculate the current finality func (consensus *Consensus) FinishFinalityCount() { d := time.Now().UnixNano() diff --git a/consensus/quorum/quorum.go b/consensus/quorum/quorum.go index 0586ace4f..6cf79e549 100644 --- a/consensus/quorum/quorum.go +++ b/consensus/quorum/quorum.go @@ -230,17 +230,12 @@ func (s *cIdentities) NthNextHmy(instance shardingconfig.Instance, pubKey *bls.P Msg("[NthNextHmy] pubKey not found") } numNodes := instance.NumHarmonyOperatedNodesPerShard() - //fmt.Println("??idx:", idx, numNodes) // sanity check to avoid out of bound access if numNodes <= 0 || numNodes > len(s.publicKeys) { numNodes = len(s.publicKeys) } idx = (idx + next) % numNodes - //fmt.Println("-------idx:", idx) - - new := &s.publicKeys[idx] - fmt.Println("NthNextHmy: ", pubKey.Bytes.Hex(), new.Bytes.Hex()) - return found, new + return found, &s.publicKeys[idx] } // NthNextHmyExt return the Nth next pubkey of Harmony + allowlist nodes, next can be negative number