Skip to content

Commit 2f0c018

Browse files
reduce debug logs amount (#19399)
as a preparation for 3.4 release
1 parent d7ce028 commit 2f0c018

File tree

9 files changed

+26
-43
lines changed

9 files changed

+26
-43
lines changed

cl/rpc/peer_selection.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,12 @@ func (c *columnDataPeers) refreshPeers(ctx context.Context) {
135135
c.peersQueue = newPeers
136136
c.peersIndex = 0
137137
c.peersMutex.Unlock()
138-
custodies := []uint64{}
139-
for _, peer := range newPeers {
140-
custodies = append(custodies, uint64(len(peer.mask)))
141-
}
142-
log.Debug("[peerSelector] updated peers", "totalPeers", len(peers.Peers), "peerCount", len(newPeers), "custodies", custodies, "elapsedTime", time.Since(begin))
138+
//custodies := []uint64{}
139+
//for _, peer := range newPeers {
140+
// custodies = append(custodies, uint64(len(peer.mask)))
141+
//}
142+
//log.Debug("[peerSelector] updated peers", "totalPeers", len(peers.Peers), "peerCount", len(newPeers), "custodies", custodies, "elapsedTime", time.Since(begin))
143+
log.Debug("[peerSelector] updated peers", "totalPeers", len(peers.Peers), "peerCount", len(newPeers), "elapsedTime", time.Since(begin))
143144
}
144145

145146
// begin

db/kv/prune/prune.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,13 @@ func TableScanningPrune(
235235

236236
var pairs, valLen uint64
237237

238-
defer func() {
239-
logger.Debug("scan pruning res", "name", name, "txFrom", txFrom, "txTo", txTo, "limit", limit, "keys",
240-
stat.PruneCountTx, "vals", stat.PruneCountValues, "all vals", valLen, "dups", stat.DupsDeleted,
241-
"spent ms", time.Since(start).Milliseconds(),
242-
"key prune status", stat.KeyProgress.String(),
243-
"val prune status", stat.ValueProgress.String())
244-
}()
238+
//defer func() {
239+
// logger.Debug("scan pruning res", "name", name, "txFrom", txFrom, "txTo", txTo, "limit", limit, "keys",
240+
// stat.PruneCountTx, "vals", stat.PruneCountValues, "all vals", valLen, "dups", stat.DupsDeleted,
241+
// "spent ms", time.Since(start).Milliseconds(),
242+
// "key prune status", stat.KeyProgress.String(),
243+
// "val prune status", stat.ValueProgress.String())
244+
//}()
245245
if prevStat.KeyProgress != Done {
246246
txnb := common.Copy(keyCursorPosition.StartKey)
247247
// This deletion iterator goes last to preserve invariant: if some `txNum=N` pruned - it's pruned Fully

db/state/domain.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,8 +1904,7 @@ func (dt *DomainRoTx) prune(ctx context.Context, rwTx kv.RwTx, step kv.Step, txF
19041904
if limit == 0 {
19051905
limit = math.MaxUint64
19061906
}
1907-
st := time.Now()
1908-
defer mxPruneTookDomain.ObserveDuration(st)
1907+
defer mxPruneTookDomain.ObserveDuration(time.Now())
19091908
stat = &DomainPruneStat{MinStep: math.MaxUint64}
19101909
if stat.History, err = dt.ht.Prune(ctx, rwTx, txFrom, txTo, limit, false, logEvery); err != nil {
19111910
return nil, fmt.Errorf("prune history at step %d [%d, %d): %w", step, txFrom, txTo, err)
@@ -1919,13 +1918,9 @@ func (dt *DomainRoTx) prune(ctx context.Context, rwTx kv.RwTx, step kv.Step, txF
19191918
return stat, nil
19201919
}
19211920

1922-
defer func() {
1923-
dt.d.logger.Debug("scan domain pruning res", "name", dt.name, "txFrom", txFrom, "txTo", txTo, "limit", limit, "vals", stat.Values, "spent ms", time.Since(st).Milliseconds())
1924-
}()
1925-
19261921
mxPruneInProgress.Inc()
19271922
defer mxPruneInProgress.Dec()
1928-
defer func(t time.Time) { mxPruneTookDomain.ObserveDuration(t) }(time.Now())
1923+
defer mxPruneTookDomain.ObserveDuration(time.Now())
19291924
var valsCursor kv.PseudoDupSortRwCursor
19301925
var mode prune.StorageMode
19311926
if dt.d.LargeValues {

execution/commitment/commitment.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
"strings"
2929
"sync"
3030
"sync/atomic"
31-
"time"
3231
"unsafe"
3332

3433
"github.com/google/btree"
@@ -441,10 +440,6 @@ func ApplyDeferredBranchUpdates(
441440
numWorkers int,
442441
putBranch func(prefix []byte, data []byte, prevData []byte, prevStep kv.Step) error,
443442
) (int, error) {
444-
start := time.Now()
445-
defer func() {
446-
log.Debug("ApplyDeferredBranchUpdates completed", "updates", len(deferred), "took", time.Since(start))
447-
}()
448443
if len(deferred) == 0 {
449444
return 0, nil
450445
}

execution/commitment/warmuper.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ func (w *Warmuper) Start() {
164164
return
165165
}
166166

167-
w.startTime = time.Now()
168167
w.work = make(chan warmupWorkItem, w.numWorkers*64)
169168
w.g, w.ctx = errgroup.WithContext(w.ctx)
170169

@@ -289,13 +288,6 @@ func (w *Warmuper) Wait() error {
289288
close(w.work)
290289
w.g.Wait()
291290

292-
log.Debug(fmt.Sprintf("[%s][warmup] completed", w.logPrefix),
293-
"keys", common.PrettyCounter(int(w.keysProcessed.Load())),
294-
"maxDepth", w.maxDepth,
295-
"workers", w.numWorkers,
296-
"spent", time.Since(w.startTime),
297-
)
298-
299291
return nil
300292
}
301293

execution/stagedsync/exec3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func ExecV3(ctx context.Context,
207207
isChainTip := maxBlockNum == startBlockNum
208208
// Do it only for chain-tip blocks!
209209
doms.EnableWarmupCache(isChainTip)
210-
log.Debug("Warmup Cache", "enabled", isChainTip)
210+
//log.Debug("Warmup Cache", "enabled", isChainTip)
211211
postValidator := newBlockPostExecutionValidator()
212212
doms.SetDeferCommitmentUpdates(false)
213213
if isChainTip {

execution/stagedsync/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ func (s *Sync) PrintTimings() []any {
491491

492492
func (s *Sync) runStage(stage *Stage, doms *execctx.SharedDomains, rwTx kv.TemporalRwTx, initialCycle, firstCycle bool, badBlockUnwind bool) (bool, error) {
493493
start := time.Now()
494-
s.logger.Debug(fmt.Sprintf("[%s] Starting Stage run", s.LogPrefix()))
494+
//s.logger.Debug(fmt.Sprintf("[%s] Starting Stage run", s.LogPrefix()))
495495
stageState, err := s.StageState(stage.ID, rwTx, initialCycle, firstCycle)
496496
if err != nil {
497497
return false, err

p2p/discover/table_reval.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (tr *tableRevalidation) handleResponse(tab *Table, resp revalidationRespons
168168
if n.livenessChecks <= 0 {
169169
tab.deleteInBucket(b, n.ID())
170170
} else {
171-
tab.log.Debug("Node revalidation failed", "b", b.index, "id", n.ID(), "checks", n.livenessChecks, "q", n.revalList.name)
171+
tab.log.Debug("[p2p] Node revalidation failed", "b", b.index, "id", n.ID(), "checks", n.livenessChecks, "q", n.revalList.name)
172172
tr.moveToList(&tr.fast, n, now, &tab.rand)
173173
}
174174
return
@@ -177,7 +177,7 @@ func (tr *tableRevalidation) handleResponse(tab *Table, resp revalidationRespons
177177
// The node responded.
178178
n.livenessChecks++
179179
n.isValidatedLive = true
180-
tab.log.Debug("Node revalidated", "b", b.index, "id", n.ID(), "checks", n.livenessChecks, "q", n.revalList.name)
180+
tab.log.Debug("[p2p] Node revalidated", "b", b.index, "id", n.ID(), "checks", n.livenessChecks, "q", n.revalList.name)
181181
var endpointChanged bool
182182
if resp.newRecord != nil {
183183
_, endpointChanged = tab.bumpInBucket(b, resp.newRecord, false)

p2p/discover/v5_udp.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ func (t *UDPv5) handlePacket(rawpacket []byte, fromAddr netip.AddrPort) error {
753753
t.unhandled <- up
754754
return nil
755755
}
756-
t.log.Debug("Bad discv5 packet", "id", fromID, "addr", addr, "err", err)
756+
t.log.Trace("Bad discv5 packet", "id", fromID, "addr", addr, "err", err)
757757
return err
758758
}
759759
if fromNode != nil {
@@ -774,15 +774,15 @@ func (t *UDPv5) handlePacket(rawpacket []byte, fromAddr netip.AddrPort) error {
774774
func (t *UDPv5) handleCallResponse(fromID enode.ID, fromAddr netip.AddrPort, p v5wire.Packet) bool {
775775
ac := t.activeCallByNode[fromID]
776776
if ac == nil || !bytes.Equal(p.RequestID(), ac.reqid) {
777-
t.log.Debug(fmt.Sprintf("Unsolicited/late %s response", p.Name()), "id", fromID, "addr", fromAddr)
777+
t.log.Debug(fmt.Sprintf("[p2p] Unsolicited/late %s response", p.Name()), "id", fromID, "addr", fromAddr)
778778
return false
779779
}
780780
if fromAddr != ac.addr {
781-
t.log.Debug(fmt.Sprintf("%s from wrong endpoint", p.Name()), "id", fromID, "addr", fromAddr)
781+
t.log.Debug(fmt.Sprintf("[p2p] %s from wrong endpoint", p.Name()), "id", fromID, "addr", fromAddr)
782782
return false
783783
}
784784
if p.Kind() != ac.responseType {
785-
t.log.Debug(fmt.Sprintf("Wrong discv5 response type %s", p.Name()), "id", fromID, "addr", fromAddr)
785+
t.log.Debug(fmt.Sprintf("[p2p] Wrong discv5 response type %s", p.Name()), "id", fromID, "addr", fromAddr)
786786
return false
787787
}
788788
t.startResponseTimeout(ac)
@@ -840,7 +840,7 @@ func (t *UDPv5) handleUnknown(p *v5wire.Unknown, fromID enode.ID, fromAddr netip
840840
// them which handshake attempt they need to complete. We tell them to use the
841841
// existing handshake attempt since the response to that one might still be in
842842
// transit.
843-
t.log.Debug("Repeating discv5 handshake challenge", "id", fromID, "addr", fromAddr)
843+
t.log.Debug("[p2p] Repeating discv5 handshake challenge", "id", fromID, "addr", fromAddr)
844844
t.sendResponse(fromID, fromAddr, currentChallenge)
845845
return
846846
}
@@ -864,13 +864,13 @@ var (
864864
func (t *UDPv5) handleWhoareyou(p *v5wire.Whoareyou, fromID enode.ID, fromAddr netip.AddrPort) {
865865
c, err := t.matchWithCall(fromID, p.Nonce)
866866
if err != nil {
867-
t.log.Debug("Invalid "+p.Name(), "addr", fromAddr, "err", err)
867+
t.log.Trace("[p2p] Invalid "+p.Name(), "addr", fromAddr, "err", err)
868868
return
869869
}
870870

871871
if c.node == nil {
872872
// Can't perform handshake because we don't have the ENR.
873-
t.log.Debug("Can't handle "+p.Name(), "addr", fromAddr, "err", "call has no ENR")
873+
t.log.Debug("[p2p] Can't handle "+p.Name(), "addr", fromAddr, "err", "call has no ENR")
874874
c.err <- errors.New("remote wants handshake, but call has no ENR")
875875
return
876876
}

0 commit comments

Comments
 (0)