From 7914431426dde08a4edcf71cdaac6b85bc2dd63b Mon Sep 17 00:00:00 2001 From: Chengxuan Xing Date: Thu, 14 Nov 2024 09:59:59 +0000 Subject: [PATCH] shorten the prefix string Signed-off-by: Chengxuan Xing --- internal/ethereum/blocklistener.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/ethereum/blocklistener.go b/internal/ethereum/blocklistener.go index ed7ac53..bf0b489 100644 --- a/internal/ethereum/blocklistener.go +++ b/internal/ethereum/blocklistener.go @@ -387,7 +387,7 @@ func (bl *blockListener) rebuildCanonicalChain() *list.Element { var expectedParentHash string if lastValidBlock != nil { nextBlockNumber = lastValidBlock.number + 1 - log.L(bl.ctx).Infof("Block listener in-memory canonical chain partially rebuilding from block %d", nextBlockNumber) + log.L(bl.ctx).Infof("Canonical chain partially rebuilding from block %d", nextBlockNumber) expectedParentHash = lastValidBlock.hash } else { firstBlock := bl.canonicalChain.Front() @@ -395,7 +395,7 @@ func (bl *blockListener) rebuildCanonicalChain() *list.Element { return nil } nextBlockNumber = firstBlock.Value.(*minimalBlockInfo).number - log.L(bl.ctx).Warnf("Block listener in-memory canonical chain re-initialized at block %d", nextBlockNumber) + log.L(bl.ctx).Warnf("Canonical chain re-initialized at block %d", nextBlockNumber) // Clear out the whole chain bl.canonicalChain = bl.canonicalChain.Init() } @@ -413,7 +413,7 @@ func (bl *blockListener) rebuildCanonicalChain() *list.Element { } } if bi == nil { - log.L(bl.ctx).Infof("Block listener in-memory canonical chain rebuilt the chain to the head block %d", nextBlockNumber-1) + log.L(bl.ctx).Infof("Canonical chain rebuilt the chain to the head block %d", nextBlockNumber-1) break } mbi := &minimalBlockInfo{ @@ -425,7 +425,7 @@ func (bl *blockListener) rebuildCanonicalChain() *list.Element { // It's possible the chain will change while we're doing this, and we fall back to the next block notification // to sort that out. if expectedParentHash != "" && mbi.parentHash != expectedParentHash { - log.L(bl.ctx).Infof("Block listener in-memory canonical chain rebuilding stopped at block: %d due to mismatch hash for parent block (%d): %s (expected: %s)", nextBlockNumber, nextBlockNumber-1, mbi.parentHash, expectedParentHash) + log.L(bl.ctx).Infof("Canonical chain rebuilding stopped at block: %d due to mismatch hash for parent block (%d): %s (expected: %s)", nextBlockNumber, nextBlockNumber-1, mbi.parentHash, expectedParentHash) break } expectedParentHash = mbi.hash @@ -458,12 +458,12 @@ func (bl *blockListener) trimToLastValidBlock() (lastValidBlock *minimalBlockInf currentViewBlock := lastElem.Value.(*minimalBlockInfo) if startingNumber == nil { startingNumber = ¤tViewBlock.number - log.L(bl.ctx).Debugf("Block listener in-memory canonical chain checking from last block: %d", startingNumber) + log.L(bl.ctx).Debugf("Canonical chain checking from last block: %d", startingNumber) } var freshBlockInfo *blockInfoJSONRPC var reason ffcapi.ErrorReason err := bl.c.retry.Do(bl.ctx, "rebuild listener canonical chain", func(_ int) (retry bool, err error) { - log.L(bl.ctx).Debugf("Block listener in-memory canonical chain validating block: %d", currentViewBlock.number) + log.L(bl.ctx).Debugf("Canonical chain validating block: %d", currentViewBlock.number) freshBlockInfo, reason, err = bl.getBlockInfoByNumber(bl.ctx, currentViewBlock.number, false, "") return reason != ffcapi.ErrorReasonNotFound, err }) @@ -474,7 +474,7 @@ func (bl *blockListener) trimToLastValidBlock() (lastValidBlock *minimalBlockInf } if freshBlockInfo != nil && freshBlockInfo.Hash.String() == currentViewBlock.hash { - log.L(bl.ctx).Debugf("Block listener in-memory canonical chain found last valid block %d", currentViewBlock.number) + log.L(bl.ctx).Debugf("Canonical chain found last valid block %d", currentViewBlock.number) lastValidBlock = currentViewBlock // Trim everything after this point, as it's invalidated nextElem := lastElem.Next() @@ -489,7 +489,7 @@ func (bl *blockListener) trimToLastValidBlock() (lastValidBlock *minimalBlockInf } if startingNumber != nil && lastValidBlock != nil && *startingNumber != lastValidBlock.number { - log.L(bl.ctx).Debugf("Block listener in-memory canonical chain trimmed from block %d to block %d (total number of in memory blocks: %d)", startingNumber, lastValidBlock.number, bl.unstableHeadLength) + log.L(bl.ctx).Debugf("Canonical chain trimmed from block %d to block %d (total number of in memory blocks: %d)", startingNumber, lastValidBlock.number, bl.unstableHeadLength) } return lastValidBlock }