From 81662cacf2c3480586548c03ce715682d3b82ddd Mon Sep 17 00:00:00 2001 From: dhrubabasu <7675102+dhrubabasu@users.noreply.github.com> Date: Sun, 10 Dec 2023 21:00:40 -0500 Subject: [PATCH] nit --- vms/platformvm/block/builder/builder.go | 16 ++++++++-------- vms/platformvm/block/executor/rejector.go | 2 +- vms/platformvm/network/network.go | 4 ++-- vms/platformvm/txs/mempool/mempool.go | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/vms/platformvm/block/builder/builder.go b/vms/platformvm/block/builder/builder.go index e9c13777f14c..f898e17ea86b 100644 --- a/vms/platformvm/block/builder/builder.go +++ b/vms/platformvm/block/builder/builder.go @@ -92,7 +92,7 @@ func New( } func (b *builder) StartBlockTimer() { - b.txExecutorBackend.Ctx.Log.Debug("[builder.StartBlockTimer]: Called") + b.txExecutorBackend.Ctx.Log.Error("[builder.StartBlockTimer]: Called") go func() { timer := time.NewTimer(0) defer timer.Stop() @@ -126,7 +126,7 @@ func (b *builder) StartBlockTimer() { break } - b.txExecutorBackend.Ctx.Log.Debug("[builder.StartBlockTimer]: Calling [mempool.RequestBuildBlock] with emptyBlockPermitted=true") + b.txExecutorBackend.Ctx.Log.Error("[builder.StartBlockTimer]: Calling [mempool.RequestBuildBlock] with emptyBlockPermitted=true") // Block needs to be issued to advance time. b.Mempool.RequestBuildBlock(true /*=emptyBlockPermitted*/) @@ -147,7 +147,7 @@ func (b *builder) StartBlockTimer() { } func (b *builder) durationToSleep() (time.Duration, error) { - b.txExecutorBackend.Ctx.Log.Debug("[builder.durationToSleep]: Called") + b.txExecutorBackend.Ctx.Log.Error("[builder.durationToSleep]: Called") // Grabbing the lock here enforces that this function is not called mid-way // through modifying of the state. b.txExecutorBackend.Ctx.Lock.Lock() @@ -179,7 +179,7 @@ func (b *builder) durationToSleep() (time.Duration, error) { } func (b *builder) ResetBlockTimer() { - b.txExecutorBackend.Ctx.Log.Debug("[builder.ResetBlockTimer]: Called") + b.txExecutorBackend.Ctx.Log.Error("[builder.ResetBlockTimer]: Called") // Ensure that the timer will be reset at least once. select { case b.resetTimer <- struct{}{}: @@ -188,7 +188,7 @@ func (b *builder) ResetBlockTimer() { } func (b *builder) ShutdownBlockTimer() { - b.txExecutorBackend.Ctx.Log.Debug("[builder.ShutdownBlockTimer]: Called") + b.txExecutorBackend.Ctx.Log.Error("[builder.ShutdownBlockTimer]: Called") b.closeOnce.Do(func() { close(b.closed) }) @@ -252,7 +252,7 @@ func buildBlock( forceAdvanceTime bool, parentState state.Chain, ) (block.Block, error) { - builder.txExecutorBackend.Ctx.Log.Debug("[builder.buildBlock]: Called") + builder.txExecutorBackend.Ctx.Log.Error("[builder.buildBlock]: Called") // Try rewarding stakers whose staking period ends at the new chain time. // This is done first to prioritize advancing the timestamp as quickly as @@ -291,7 +291,7 @@ func buildBlock( ) for { - builder.txExecutorBackend.Ctx.Log.Debug("[builder.buildBlock] mempool: peeking tx", + builder.txExecutorBackend.Ctx.Log.Error("[builder.buildBlock] mempool: peeking tx", zap.Int("remainingSize", remainingSize), zap.Error(err), ) @@ -302,7 +302,7 @@ func buildBlock( builder.Mempool.Remove([]*txs.Tx{tx}) txID := tx.ID() - builder.txExecutorBackend.Ctx.Log.Debug("[builder.buildBlock] mempool: removed tx", + builder.txExecutorBackend.Ctx.Log.Error("[builder.buildBlock] mempool: removed tx", zap.Stringer("txID", txID), zap.Error(err), ) diff --git a/vms/platformvm/block/executor/rejector.go b/vms/platformvm/block/executor/rejector.go index 232dfc5929cb..7845d2059f6d 100644 --- a/vms/platformvm/block/executor/rejector.go +++ b/vms/platformvm/block/executor/rejector.go @@ -82,7 +82,7 @@ func (r *rejector) rejectBlock(b block.Block, blockType string) error { } txID := tx.ID() - r.ctx.Log.Debug("[rejector.rejectBlock] mempool: adding tx", + r.ctx.Log.Error("[rejector.rejectBlock] mempool: adding tx", zap.Stringer("txID", txID), ) } diff --git a/vms/platformvm/network/network.go b/vms/platformvm/network/network.go index f993b54df8be..326f35b0abac 100644 --- a/vms/platformvm/network/network.go +++ b/vms/platformvm/network/network.go @@ -118,7 +118,7 @@ func (n *network) AppGossip(ctx context.Context, nodeID ids.NodeID, msgBytes []b defer n.ctx.Lock.Unlock() if reason := n.mempool.GetDropReason(txID); reason != nil { - n.ctx.Log.Debug("[network.AppGossip] mempool: dropped tx", + n.ctx.Log.Error("[network.AppGossip] mempool: dropped tx", zap.Stringer("txID", txID), zap.Error(reason), ) @@ -185,7 +185,7 @@ func (n *network) issueTx(tx *txs.Tx) error { return err } - n.ctx.Log.Debug("[network.issueTx] added tx to mempool", + n.ctx.Log.Error("[network.issueTx] added tx to mempool", zap.Stringer("txID", txID), ) diff --git a/vms/platformvm/txs/mempool/mempool.go b/vms/platformvm/txs/mempool/mempool.go index 0d5ca3896aea..19c0190cb925 100644 --- a/vms/platformvm/txs/mempool/mempool.go +++ b/vms/platformvm/txs/mempool/mempool.go @@ -136,7 +136,7 @@ func New( } func (m *mempool) Add(tx *txs.Tx) error { - m.log.Debug("[mempool.Add] trying to add tx", + m.log.Error("[mempool.Add] trying to add tx", zap.Stringer("txID", tx.ID()), ) @@ -177,7 +177,7 @@ func (m *mempool) Add(tx *txs.Tx) error { return fmt.Errorf("%w: %s", errConflictsWithOtherTx, txID) } - m.log.Debug("[mempool.Add] added tx", + m.log.Error("[mempool.Add] added tx", zap.Stringer("txID", tx.ID()), ) @@ -207,13 +207,13 @@ func (m *mempool) Get(txID ids.ID) *txs.Tx { func (m *mempool) Remove(txsToRemove []*txs.Tx) { for _, tx := range txsToRemove { txID := tx.ID() - m.log.Debug("[mempool.Remove] attempting to remove tx", + m.log.Error("[mempool.Remove] attempting to remove tx", zap.Stringer("txID", txID), ) if !m.unissuedTxs.Delete(txID) { continue } - m.log.Debug("[mempool.Remove] removed tx", + m.log.Error("[mempool.Remove] removed tx", zap.Stringer("txID", tx.ID()), ) m.numTxs.Dec() @@ -228,14 +228,14 @@ func (m *mempool) Remove(txsToRemove []*txs.Tx) { func (m *mempool) Peek() *txs.Tx { _, tx, _ := m.unissuedTxs.Oldest() - m.log.Debug("[mempool.Peek] returning tx", + m.log.Error("[mempool.Peek] returning tx", zap.Stringer("txID", tx.ID()), ) return tx } func (m *mempool) MarkDropped(txID ids.ID, reason error) { - m.log.Debug("[mempool.MarkDropped] marking tx dropped", + m.log.Error("[mempool.MarkDropped] marking tx dropped", zap.Stringer("txID", txID), ) m.droppedTxIDs.Put(txID, reason) @@ -247,7 +247,7 @@ func (m *mempool) GetDropReason(txID ids.ID) error { } func (m *mempool) RequestBuildBlock(emptyBlockPermitted bool) { - m.log.Debug("[mempool.RequestBuildBlock] called", + m.log.Error("[mempool.RequestBuildBlock] called", zap.Bool("emptyBlockPermitted", emptyBlockPermitted), zap.Int("mempoolSize", m.unissuedTxs.Len()), )