From 79f169f93349be97c773aea82c8937e7002e6cb0 Mon Sep 17 00:00:00 2001 From: Steven Landers Date: Mon, 25 Mar 2024 14:52:45 -0400 Subject: [PATCH] moar logs --- internal/consensus/state.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/internal/consensus/state.go b/internal/consensus/state.go index 2f46a87bd..b3884f4f5 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -2051,7 +2051,9 @@ func (cs *State) enterCommit(ctx context.Context, height int64, commitRound int3 cs.tryFinalizeCommit(spanCtx, height) }() + t2 := debugutil.NewTimer("enterCommit cs.roundState.Votes().Precommits(commitRound).TwoThirdsMajority()") blockID, ok := cs.roundState.Votes().Precommits(commitRound).TwoThirdsMajority() + t2.Stop() if !ok { panic("RunActionCommit() expects +2/3 precommits") } @@ -2061,8 +2063,14 @@ func (cs *State) enterCommit(ctx context.Context, height int64, commitRound int3 // otherwise they'll be cleared in updateToState. if cs.roundState.LockedBlock().HashesTo(blockID.Hash) { logger.Info("commit is for a locked block; set ProposalBlock=LockedBlock", "block_hash", blockID.Hash) + + t := debugutil.NewTimer("enterCommit cs.roundState.SetProposalBlock(cs.roundState.LockedBlock())") cs.roundState.SetProposalBlock(cs.roundState.LockedBlock()) + t.Stop() + + t2 := debugutil.NewTimer("enterCommit cs.roundState.SetProposalBlockParts(cs.roundState.LockedBlockParts())") cs.roundState.SetProposalBlockParts(cs.roundState.LockedBlockParts()) + t2.Stop() } // If we don't have the block being committed, set up to get it. @@ -2076,16 +2084,29 @@ func (cs *State) enterCommit(ctx context.Context, height int64, commitRound int3 // We're getting the wrong block. // Set up ProposalBlockParts and keep waiting. + t := debugutil.NewTimer("enterCommit cs.roundState.SetProposalBlock(cs.roundState.LockedBlock())") cs.roundState.SetProposalBlock(nil) + t.Stop() + cs.metrics.MarkBlockGossipStarted() + + t = debugutil.NewTimer("enterCommit cs.roundState.SetProposalBlockParts(types.NewPartSetFromHeader(blockID.PartSetHeader))") cs.roundState.SetProposalBlockParts(types.NewPartSetFromHeader(blockID.PartSetHeader)) + t.Stop() + t = debugutil.NewTimer("enterCommit cs.eventBus.PublishEventValidBlock(cs.roundState.RoundStateEvent())") if err := cs.eventBus.PublishEventValidBlock(cs.roundState.RoundStateEvent()); err != nil { logger.Error("failed publishing valid block", "err", err) } + t.Stop() + t = debugutil.NewTimer("enterCommit cs.roundState.CopyInternal()") roundState := cs.roundState.CopyInternal() + t.Stop() + + t = debugutil.NewTimer("enterCommit cs.evsw.FireEvent(types.EventValidBlockValue, roundState)") cs.evsw.FireEvent(types.EventValidBlockValue, roundState) + t.Stop() } } }