Skip to content

Commit 7be7e91

Browse files
authored
Merge branch 'main' into empty-request
2 parents 8cd3f78 + 5217daa commit 7be7e91

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

epoch.go

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,13 @@ func (e *Epoch) createBlockVerificationTask(block Block, from NodeID, vote Vote)
18201820
return md.Digest
18211821
}
18221822

1823+
e.deleteFutureProposal(from, md.Round)
1824+
1825+
if !e.storeProposal(verifiedBlock) {
1826+
e.Logger.Debug("Unable to store proposed block for the round", zap.Stringer("NodeID", from), zap.Uint64("round", md.Round))
1827+
return md.Digest
1828+
}
1829+
18231830
record := BlockRecord(md, blockBytes)
18241831
if err := e.WAL.Append(record); err != nil {
18251832
e.haltedError = err
@@ -1831,13 +1838,6 @@ func (e *Epoch) createBlockVerificationTask(block Block, from NodeID, vote Vote)
18311838
zap.Uint64("round", md.Round),
18321839
zap.Stringer("digest", md.Digest))
18331840

1834-
e.deleteFutureProposal(from, md.Round)
1835-
1836-
if !e.storeProposal(verifiedBlock) {
1837-
e.Logger.Debug("Unable to store proposed block for the round", zap.Stringer("NodeID", from), zap.Uint64("round", md.Round))
1838-
return md.Digest
1839-
}
1840-
18411841
// We might have received votes and finalizations from future rounds before we received this block.
18421842
// So load the messages into our round data structure now that we have created it.
18431843
err = e.maybeLoadFutureMessages()
@@ -2507,14 +2507,7 @@ func (e *Epoch) startRound() error {
25072507
// We're not the leader, make sure if a block is not notarized within a timely manner,
25082508
// we will agree on an empty block.
25092509
e.monitorProgress(e.round)
2510-
2511-
// If we're not the leader, check if we have received a proposal earlier for this round
2512-
msgsForRound, exists := e.futureMessages[string(leaderForCurrentRound)][e.round]
2513-
if !exists || msgsForRound.proposal == nil {
2514-
return nil
2515-
}
2516-
2517-
return e.handleBlockMessage(msgsForRound.proposal, leaderForCurrentRound)
2510+
return nil
25182511
}
25192512

25202513
func (e *Epoch) doProposed(block VerifiedBlock) error {
@@ -2901,6 +2894,10 @@ func (e *Epoch) haveNotFinalizedNotarizedRound() (uint64, bool) {
29012894
var minRoundNum uint64
29022895
var found bool
29032896
for _, round := range e.rounds {
2897+
if round.finalization != nil || round.notarization == nil {
2898+
continue
2899+
}
2900+
29042901
if !found {
29052902
minRoundNum = round.num
29062903
found = true

0 commit comments

Comments
 (0)