Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cosmetic changes #6735

Open
wants to merge 2 commits into
base: equivalent-proofs-stabilization-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading