Skip to content

Commit

Permalink
make generateNextBakers independent of suspended validator ids.
Browse files Browse the repository at this point in the history
  • Loading branch information
drsk committed Dec 9, 2024
1 parent 7920c4c commit 9646f20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions concordium-consensus/src/Concordium/Kontrol/Bakers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ computeBakerStakesAndCapital poolParams activeBakers passiveDelegators snapshotS
passiveDelegatorsCapital = Vec.fromList $ delegatorCapital <$> passiveDelegators
capitalDistribution = CapitalDistribution{..}

-- | Generate and set the next epoch bakers and next capital based on the current active bakers.
-- | Generate and set the next epoch bakers and next capital based on the
-- current active bakers. This assumes that no validators are suspended.
generateNextBakers ::
forall m.
( TreeStateMonad m,
Expand All @@ -221,10 +222,9 @@ generateNextBakers ::
) =>
-- | The payday epoch
Epoch ->
Set.Set BakerId ->
UpdatableBlockState m ->
m (UpdatableBlockState m)
generateNextBakers paydayEpoch suspendedBids bs0 = do
generateNextBakers paydayEpoch bs0 = do
isEffective <- effectiveTest paydayEpoch
-- Determine the bakers and delegators for the next reward period, accounting for any
-- stake reductions that are currently pending on active bakers with effective time at
Expand All @@ -244,7 +244,7 @@ generateNextBakers paydayEpoch suspendedBids bs0 = do
(cps ^. cpPoolParameters)
activeBakers
passiveDelegators
suspendedBids
Set.empty
bs1 <- bsoSetNextEpochBakers bs0 bakerStakes NoParam
bsoSetNextCapitalDistribution bs1 capitalDistribution

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import qualified Data.Map as Map
import Data.Maybe
import Data.Ratio
import qualified Data.Sequence as Seq
import qualified Data.Set as Set
import Data.Time
import qualified Data.Vector as Vec
import Data.Word
Expand Down Expand Up @@ -1111,7 +1110,7 @@ updateBirkParameters newSeedState bs0 oldChainParameters updates = case protocol
processPaydays pd mrps0 bspp0 = do
bspp1 <-
if oldSeedState ^. epoch < pd - 1 && pd - 1 <= newSeedState ^. epoch
then generateNextBakers pd Set.empty bspp0
then generateNextBakers pd bspp0
else return bspp0
if pd <= newSeedState ^. epoch
then do
Expand Down

0 comments on commit 9646f20

Please sign in to comment.