Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
AdoAdoAdo committed Jan 20, 2025
1 parent e63d4fe commit 3bd8598
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion consensus/spos/bls/v2/subroundBlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ func (sr *subroundBlock) receivedBlockHeader(headerHandler data.HeaderHandler) {

headerLeader, err := sr.getLeaderForHeader(headerHandler)
if err != nil {
log.Debug("subroundBlock.receivedBlockHeader - error", err.Error())
log.Debug("subroundBlock.receivedBlockHeader - error getting leader for header", err.Error())
return
}

Expand Down
1 change: 0 additions & 1 deletion epochStart/shardchain/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ func NewEpochStartTrigger(args *ArgsShardEpochStartTrigger) (*trigger, error) {
extraDelayForRequestBlockInfo: args.ExtraDelayForRequestBlockInfo,
}

// TODO: for equivalent messages this trigger needs to be changed, on start of epoch block proof instead
t.headersPool.RegisterHandler(t.receivedMetaBlock)
t.proofsPool.RegisterHandler(t.receivedProof)

Expand Down
15 changes: 2 additions & 13 deletions process/block/baseProcess.go
Original file line number Diff line number Diff line change
Expand Up @@ -2201,12 +2201,6 @@ func (bp *baseProcessor) checkSentSignaturesAtCommitTime(header data.HeaderHandl
return nil
}

func isProofEmpty(proof data.HeaderProofHandler) bool {
return len(proof.GetAggregatedSignature()) == 0 ||
len(proof.GetPubKeysBitmap()) == 0 ||
len(proof.GetHeaderHash()) == 0
}

func (bp *baseProcessor) addPrevProofIfNeeded(header data.HeaderHandler) error {
if !common.ShouldBlockHavePrevProof(header, bp.enableEpochsHandler, common.EquivalentMessagesFlag) {
return nil
Expand All @@ -2217,11 +2211,6 @@ func (bp *baseProcessor) addPrevProofIfNeeded(header data.HeaderHandler) error {
return err
}

if !isProofEmpty(prevBlockProof) {
header.SetPreviousProof(prevBlockProof)
return nil
}

log.Debug("addPrevProofIfNeeded: no proof found", "header hash", header.GetPrevHash())
return process.ErrNilHeaderProof
header.SetPreviousProof(prevBlockProof)
return nil
}

0 comments on commit 3bd8598

Please sign in to comment.