From 38bb234ebc0802d8889c5ac29e7f90a3b625279f Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Thu, 25 Feb 2021 15:49:14 -0800 Subject: [PATCH] Reuse old shard state if no validator is elected --- shard/committee/assignment.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shard/committee/assignment.go b/shard/committee/assignment.go index b9507f0d2..f0b6dabb4 100644 --- a/shard/committee/assignment.go +++ b/shard/committee/assignment.go @@ -350,6 +350,10 @@ func eposStakedCommittee( ) } + if len(completedEPoSRound.AuctionWinners) == 0 { + utils.Logger().Warn().Msg("No elected validators in the new epoch!!! Reuse old shard state.") + return stakerReader.ReadShardState(big.NewInt(0).Sub(epoch, big.NewInt(1))) + } return shardState, nil }