Skip to content

Commit c80677b

Browse files
committed
move sync to start
1 parent 7b57385 commit c80677b

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

epoch.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ func (e *Epoch) Start() error {
273273
}
274274
// Only init receiving messages once you have initialized the data structures required for it.
275275
defer func() {
276+
e.broadcastReplicationSync()
276277
e.canReceiveMessages.Store(true)
277278
}()
278279
return e.restoreFromWal()
@@ -501,8 +502,6 @@ func (e *Epoch) broadcastReplicationSync() {
501502
func (e *Epoch) resumeFromWal(highestRoundRecord *walRound) error {
502503
e.Logger.Info("Most relevant record recovered from WAL", zap.Uint64("round", highestRoundRecord.round), zap.Stringer("relevant", highestRoundRecord))
503504

504-
e.broadcastReplicationSync()
505-
506505
// Handle the most relevant record based on priority: finalization > notarization > emptyNotarization > emptyVote > block
507506
if highestRoundRecord.finalization != nil {
508507
finalizationMsg := &Message{Finalization: highestRoundRecord.finalization}

recovery_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -969,14 +969,6 @@ func TestRecoveryAndBroadcast(t *testing.T) {
969969
require.Equal(t, startSeq, normalNode3.Storage.NumBlocks())
970970
require.Equal(t, uint64(2), laggingNode.Storage.NumBlocks())
971971

972-
blockBytes, err := storageData[0].VerifiedBlock.Bytes()
973-
require.NoError(t, err)
974-
blockRecord := BlockRecord(storageData[0].VerifiedBlock.BlockHeader(), blockBytes)
975-
_, finalizationRecord := testutil.NewFinalizationRecord(t, laggingNode.E.EpochConfig.Logger, laggingNode.E.EpochConfig.SignatureAggregator, storageData[0].VerifiedBlock, nodes)
976-
977-
laggingNode.WAL.Append(blockRecord)
978-
laggingNode.WAL.Append(finalizationRecord)
979-
980972
normalNode1.Start()
981973
normalNode2.Start()
982974
normalNode3.Start()

0 commit comments

Comments
 (0)