Skip to content

Commit 20162f4

Browse files
committed
reduce unnecessary debug logs
1 parent feb462e commit 20162f4

File tree

12 files changed

+0
-88
lines changed

12 files changed

+0
-88
lines changed

action/protocol/execution/evm/evm.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ func executeInEVM(evmParams *Params, stateDB *StateDBAdapter, g genesis.Blockcha
299299
// create contract
300300
var evmContractAddress common.Address
301301
_, evmContractAddress, remainingGas, evmErr = evm.Create(executor, evmParams.data, remainingGas, evmParams.amount)
302-
log.L().Debug("evm Create.", log.Hex("addrHash", evmContractAddress[:]))
303302
if evmErr == nil {
304303
if contractAddress, err := address.FromBytes(evmContractAddress.Bytes()); err == nil {
305304
contractRawAddress = contractAddress.String()

action/protocol/poll/candidateindexer.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ func (cd *CandidateIndexer) PutCandidateList(height uint64, candidates *state.Ca
6464
if err != nil {
6565
return err
6666
}
67-
log.L().Debug("put candidatelist into candidate indexer", zap.Uint64("height", height))
6867
return cd.kvStore.Put(CandidateNamespace, byteutil.Uint64ToBytes(height), candidatesByte)
6968
}
7069

@@ -76,15 +75,13 @@ func (cd *CandidateIndexer) PutProbationList(height uint64, probationList *vote.
7675
if err != nil {
7776
return err
7877
}
79-
log.L().Debug("put probation list into candidate indexer", zap.Uint64("height", height))
8078
return cd.kvStore.Put(ProbationNamespace, byteutil.Uint64ToBytes(height), probationListByte)
8179
}
8280

8381
// CandidateList gets candidate list from indexer given epoch start height
8482
func (cd *CandidateIndexer) CandidateList(height uint64) (state.CandidateList, error) {
8583
cd.mutex.RLock()
8684
defer cd.mutex.RUnlock()
87-
log.L().Debug("get candidatelist from candidate indexer", zap.Uint64("height", height))
8885
candidates := &state.CandidateList{}
8986
bytes, err := cd.kvStore.Get(CandidateNamespace, byteutil.Uint64ToBytes(height))
9087
if err != nil {
@@ -107,7 +104,6 @@ func (cd *CandidateIndexer) CandidateList(height uint64) (state.CandidateList, e
107104
func (cd *CandidateIndexer) ProbationList(height uint64) (*vote.ProbationList, error) {
108105
cd.mutex.RLock()
109106
defer cd.mutex.RUnlock()
110-
log.L().Debug("get probationlist from candidate indexer", zap.Uint64("height", height))
111107
bl := &vote.ProbationList{}
112108
bytes, err := cd.kvStore.Get(ProbationNamespace, byteutil.Uint64ToBytes(height))
113109
if err != nil {

action/protocol/poll/governance_protocol.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ func (p *governanceChainCommitteeProtocol) CalculateCandidatesByHeight(ctx conte
157157
if err != nil {
158158
return nil, errors.Wrap(err, "failed to get gravity chain height")
159159
}
160-
log.L().Debug(
161-
"fetch delegates from gravity chain",
162-
zap.Uint64("gravityChainHeight", gravityHeight),
163-
)
164160
return p.candidatesByGravityChainHeight(gravityHeight)
165161
}
166162

@@ -239,9 +235,5 @@ func (p *governanceChainCommitteeProtocol) getGravityHeight(ctx context.Context,
239235
if err != nil {
240236
return 0, err
241237
}
242-
log.L().Debug(
243-
"get gravity chain height by time",
244-
zap.Time("time", blkTime),
245-
)
246238
return p.electionCommittee.HeightByTime(blkTime)
247239
}

action/protocol/poll/nativestaking.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ func (ns *NativeStaking) Votes(ctx context.Context, ts time.Time, correctGas boo
105105

106106
for {
107107
vote, index, err := ns.readBuckets(ctx, prevIndex, limit, correctGas)
108-
log.L().Debug("Read native buckets from contract", zap.Int("size", len(vote)))
109108
if err == ErrEndOfData {
110109
// all data been read
111110
break

action/protocol/poll/slasher.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,6 @@ func (sh *Slasher) CalculateProbationList(
411411
unqualifiedDelegates := make(map[string]uint32)
412412
if epochNum <= easterEpochNum+sh.probationEpochPeriod {
413413
// if epoch number is smaller than easterEpochNum+K(probation period), calculate it one-by-one (initialize).
414-
log.L().Debug("Before using probation list",
415-
zap.Uint64("epochNum", epochNum),
416-
zap.Uint64("easterEpochNum", easterEpochNum),
417-
zap.Uint64("probationEpochPeriod", sh.probationEpochPeriod),
418-
)
419414
existinglist := upd.DelegateList()
420415
for _, listByEpoch := range existinglist {
421416
for _, addr := range listByEpoch {
@@ -445,11 +440,6 @@ func (sh *Slasher) CalculateProbationList(
445440
return nextProbationlist, setUnproductiveDelegates(sm, upd)
446441
}
447442
// ProbationList[N] = ProbationList[N-1] - Low-productivity-list[N-K-1] + Low-productivity-list[N-1]
448-
log.L().Debug("Using probationList",
449-
zap.Uint64("epochNum", epochNum),
450-
zap.Uint64("easterEpochNum", easterEpochNum),
451-
zap.Uint64("probationEpochPeriod", sh.probationEpochPeriod),
452-
)
453443
prevProbationlist, _, err := sh.getProbationList(sm, false)
454444
if err != nil {
455445
return nil, errors.Wrap(err, "failed to read latest probation list")
@@ -620,10 +610,6 @@ func filterCandidates(
620610

621611
// currentEpochProductivity returns the map of the number of blocks produced per delegate of current epoch
622612
func currentEpochProductivity(sr protocol.StateReader, start uint64, end uint64, numOfBlocksByEpoch uint64) (map[string]uint64, error) {
623-
log.L().Debug("Read current epoch productivity",
624-
zap.Uint64("start height", start),
625-
zap.Uint64("end height", end),
626-
)
627613
stats := make(map[string]uint64)
628614
blockmetas, err := allBlockMetasFromDB(sr, numOfBlocksByEpoch)
629615
if err != nil {

action/protocol/poll/util.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ func handle(ctx context.Context, act action.Action, sm protocol.StateManager, in
5858
if !ok {
5959
return nil, nil
6060
}
61-
zap.L().Debug("Handle PutPollResult Action", zap.Uint64("height", r.Height()))
62-
6361
if err := setCandidates(ctx, sm, indexer, r.Candidates(), r.Height()); err != nil {
6462
return nil, errors.Wrap(err, "failed to set candidates")
6563
}
@@ -124,13 +122,6 @@ func createPostSystemActions(ctx context.Context, sr protocol.StateReader, p Pro
124122
if _, _, err := candidatesutil.CandidatesFromDB(sr, nextEpochHeight, beforeEaster, true); errors.Cause(err) != state.ErrStateNotExist {
125123
return nil, err
126124
}
127-
log.L().Debug(
128-
"createPutPollResultAction",
129-
zap.Uint64("height", blkCtx.BlockHeight),
130-
zap.Uint64("epochNum", epochNum),
131-
zap.Uint64("epochHeight", epochHeight),
132-
zap.Uint64("nextEpochHeight", nextEpochHeight),
133-
)
134125
l, err := p.CalculateCandidatesByHeight(ctx, sr, epochHeight)
135126
if err == nil && len(l) == 0 {
136127
err = errors.Wrapf(
@@ -188,12 +179,6 @@ func setCandidates(
188179
if err := accountutil.StoreAccount(sm, candAddr, delegate); err != nil {
189180
return errors.Wrap(err, "failed to update pending account changes to trie")
190181
}
191-
log.L().Debug(
192-
"add candidate",
193-
zap.String("address", candidate.Address),
194-
zap.String("rewardAddress", candidate.RewardAddress),
195-
zap.String("score", candidate.Votes.String()),
196-
)
197182
}
198183
if indexer != nil {
199184
if err := indexer.PutCandidateList(height, &candidates); err != nil {
@@ -238,7 +223,6 @@ func setUnproductiveDelegates(
238223

239224
// shiftCandidates updates current data with next data of candidate list
240225
func shiftCandidates(sm protocol.StateManager) (uint64, error) {
241-
zap.L().Debug("Shift candidatelist from next key to current key")
242226
var next state.CandidateList
243227
var err error
244228
var stateHeight, putStateHeight, delStateHeight uint64
@@ -273,7 +257,6 @@ func shiftCandidates(sm protocol.StateManager) (uint64, error) {
273257

274258
// shiftProbationList updates current data with next data of probation list
275259
func shiftProbationList(sm protocol.StateManager) (uint64, error) {
276-
zap.L().Debug("Shift probationList from next key to current key")
277260
var err error
278261
var stateHeight, putStateHeight, delStateHeight uint64
279262
next := &vote.ProbationList{}

action/protocol/vote/candidatesutil/candidatesutil.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ func CandidatesFromDB(sr protocol.StateReader, height uint64, beforeEaster bool,
6363
protocol.NamespaceOption(protocol.SystemNamespace),
6464
)
6565
}
66-
log.L().Debug(
67-
"CandidatesFromDB",
68-
zap.Bool("beforeEaster", beforeEaster),
69-
zap.Uint64("height", height),
70-
zap.Uint64("stateHeight", stateHeight),
71-
zap.Any("candidates", candidates),
72-
zap.Error(err),
73-
)
7466
if errors.Cause(err) == nil {
7567
if len(candidates) > 0 {
7668
return candidates, stateHeight, nil
@@ -98,12 +90,6 @@ func ProbationListFromDB(sr protocol.StateReader, epochStartPoint bool) (*vote.P
9890
protocol.KeyOption(probationlistKey[:]),
9991
protocol.NamespaceOption(protocol.SystemNamespace),
10092
)
101-
log.L().Debug(
102-
"GetProbationList",
103-
zap.Any("Probation list", probationList.ProbationInfo),
104-
zap.Uint64("state height", stateHeight),
105-
zap.Error(err),
106-
)
10793
if err == nil {
10894
return probationList, stateHeight, nil
10995
}

actpool/actpool.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ func (ap *actPool) removeInvalidActs(acts []action.SealedEnvelope) {
459459
log.L().Debug("Skipping action due to hash error", zap.Error(err))
460460
continue
461461
}
462-
log.L().Debug("Removed invalidated action.", log.Hex("hash", hash[:]))
463462
delete(ap.allActions, hash)
464463
intrinsicGas, _ := act.IntrinsicGas()
465464
ap.subGasFromPool(intrinsicGas)

api/api.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ func (api *Server) GetServerMeta(ctx context.Context,
356356

357357
// SendAction is the API to send an action to blockchain.
358358
func (api *Server) SendAction(ctx context.Context, in *iotexapi.SendActionRequest) (*iotexapi.SendActionResponse, error) {
359-
log.L().Debug("receive send action request")
360359
var selp action.SealedEnvelope
361360
var err error
362361
if err = selp.LoadProto(in.Action); err != nil {
@@ -450,8 +449,6 @@ func (api *Server) GetReceiptByAction(ctx context.Context, in *iotexapi.GetRecei
450449

451450
// ReadContract reads the state in a contract address specified by the slot
452451
func (api *Server) ReadContract(ctx context.Context, in *iotexapi.ReadContractRequest) (*iotexapi.ReadContractResponse, error) {
453-
log.L().Debug("receive read smart contract request")
454-
455452
sc := &action.Execution{}
456453
if err := sc.LoadProto(in.Execution); err != nil {
457454
return nil, status.Error(codes.InvalidArgument, err.Error())

blocksync/blocksync.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ func (bs *blockSyncer) TargetHeight() uint64 {
158158

159159
// Start starts a block syncer
160160
func (bs *blockSyncer) Start(ctx context.Context) error {
161-
log.L().Debug("Starting block syncer.")
162161
if bs.syncTask != nil {
163162
if err := bs.syncTask.Start(ctx); err != nil {
164163
return err
@@ -215,7 +214,6 @@ func (bs *blockSyncer) ProcessBlock(ctx context.Context, peer string, blk *block
215214
syncedHeight++
216215
}
217216
bs.buf.Cleanup(syncedHeight)
218-
log.L().Debug("flush blocks", zap.Uint64("start", tip), zap.Uint64("end", syncedHeight))
219217
if syncedHeight > bs.lastTip {
220218
bs.lastTip = syncedHeight
221219
bs.lastTipUpdateTime = time.Now()

0 commit comments

Comments
 (0)