Skip to content

Commit

Permalink
Merge pull request #6735 from multiversx/cosmetic_changes
Browse files Browse the repository at this point in the history
cosmetic changes
  • Loading branch information
sstanculeanu authored Jan 27, 2025
2 parents 4757ba0 + daaeffd commit 74e7ae2
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 12 deletions.
5 changes: 4 additions & 1 deletion dataRetriever/dataPool/proofsCache/proofsPool.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ func (pp *proofsPool) AddProof(
}
pp.mutCache.Unlock()

log.Trace("added proof to pool",
log.Debug("added proof to pool",
"header hash", headerProof.GetHeaderHash(),
"epoch", headerProof.GetHeaderEpoch(),
"nonce", headerProof.GetHeaderNonce(),
"shardID", headerProof.GetHeaderShardId(),
"pubKeys bitmap", headerProof.GetPubKeysBitmap(),
"round", headerProof.GetHeaderRound(),
"nonce", headerProof.GetHeaderNonce(),
"isStartOfEpoch", headerProof.GetIsStartOfEpoch(),
)

proofsPerShard.addProof(headerProof)
Expand Down
75 changes: 64 additions & 11 deletions process/block/baseProcess.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,22 @@ func displayHeader(headerHandler data.HeaderHandler) []*display.LineData {

proof := headerHandler.GetPreviousProof()

var prevAggregatedSig, prevBitmap []byte
var prevAggregatedSig, prevBitmap, prevHash []byte
var proofShard, proofEpoch uint32
var proofRound, proofNonce uint64
var isStartOfEpoch, hasProofInfo bool
if !check.IfNilReflect(proof) {
hasProofInfo = true
prevAggregatedSig, prevBitmap = proof.GetAggregatedSignature(), proof.GetPubKeysBitmap()
prevHash = proof.GetHeaderHash()
proofShard = proof.GetHeaderShardId()
proofEpoch = proof.GetHeaderEpoch()
proofRound = proof.GetHeaderRound()
proofNonce = proof.GetHeaderNonce()
isStartOfEpoch = proof.GetIsStartOfEpoch()
}

return []*display.LineData{
logLines := []*display.LineData{
display.NewLineData(false, []string{
"",
"ChainID",
Expand Down Expand Up @@ -438,19 +448,50 @@ func displayHeader(headerHandler data.HeaderHandler) []*display.LineData {
"",
"Receipts hash",
logger.DisplayByteSlice(headerHandler.GetReceiptsHash())}),
display.NewLineData(false, []string{
display.NewLineData(true, []string{
"",
"Epoch start meta hash",
logger.DisplayByteSlice(epochStartMetaHash)}),
display.NewLineData(false, []string{
"Previous proof",
"Aggregated signature",
logger.DisplayByteSlice(prevAggregatedSig)}),
display.NewLineData(true, []string{
"",
"Pub keys bitmap",
logger.DisplayByteSlice(prevBitmap)}),
}

if hasProofInfo {
logLines = append(logLines,
display.NewLineData(false, []string{
"Previous proof",
"Header hash",
logger.DisplayByteSlice(prevHash)}),
display.NewLineData(false, []string{
"",
"Aggregated signature",
logger.DisplayByteSlice(prevAggregatedSig)}),
display.NewLineData(false, []string{
"",
"Pub keys bitmap",
logger.DisplayByteSlice(prevBitmap)}),
display.NewLineData(false, []string{
"",
"Epoch",
fmt.Sprintf("%d", proofEpoch)}),
display.NewLineData(false, []string{
"",
"Round",
fmt.Sprintf("%d", proofRound)}),
display.NewLineData(false, []string{
"",
"Shard",
fmt.Sprintf("%d", proofShard)}),
display.NewLineData(false, []string{
"",
"Nonce",
fmt.Sprintf("%d", proofNonce)}),
display.NewLineData(true, []string{
"",
"IsStartOfEpoch",
fmt.Sprintf("%t", isStartOfEpoch)}),
)
}

return logLines
}

// checkProcessorParameters will check the input parameters values
Expand Down Expand Up @@ -2233,6 +2274,18 @@ func (bp *baseProcessor) addPrevProofIfNeeded(header data.HeaderHandler) error {
}

header.SetPreviousProof(prevBlockProof)

log.Debug("added proof on header",
"header hash", prevBlockProof.GetHeaderHash(),
"epoch", prevBlockProof.GetHeaderEpoch(),
"nonce", prevBlockProof.GetHeaderNonce(),
"shardID", prevBlockProof.GetHeaderShardId(),
"pubKeys bitmap", prevBlockProof.GetPubKeysBitmap(),
"round", prevBlockProof.GetHeaderRound(),
"nonce", prevBlockProof.GetHeaderNonce(),
"isStartOfEpoch", prevBlockProof.GetIsStartOfEpoch(),
)

return nil
}

Expand Down

0 comments on commit 74e7ae2

Please sign in to comment.