diff --git a/CHANGELOG.md b/CHANGELOG.md index f51916ad9..661f3e793 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ rounds in the previous payday. - Add support for suspend/resume to validator configuration updates. - Validators that are suspended are paused from participating in the consensus algorithm. +- Add suspension info to `BakerPoolStatus` / `CurrentPaydayBakerPoolStatus` query results. - Add `GetConsensusDetailedStatus` gRPC endpoint for getting detailed information on the status of the consensus, at consensus version 1. - Update Rust version to 1.82. diff --git a/concordium-base b/concordium-base index 98501a721..92150abc9 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit 98501a7210e9eb21aad138f555e5e9e53d4ab891 +Subproject commit 92150abc924a39580aa8e5bee1aaee52a5ef4739 diff --git a/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs b/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs index 80b883672..d96f50a69 100644 --- a/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs +++ b/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs @@ -3331,10 +3331,12 @@ doGetPoolStatus pbs psBakerId@(BakerId aid) = case delegationChainParameters @pv return $! ActiveBakerPoolStatus{..} epochBakers <- refLoad (_birkCurrentEpochBakers $ bspBirkParameters bsp) mepochBaker <- epochBaker psBakerId epochBakers - psCurrentPaydayStatus <- case mepochBaker of - Nothing -> return Nothing + (psCurrentPaydayStatus, psIsSuspended) <- case mepochBaker of + Nothing -> return (Nothing, Nothing) Just (currentEpochBaker, effectiveStake) -> do poolRewards <- refLoad (bspPoolRewards bsp) + let isSuspended = + fromCondDef (Just <$> BaseAccounts._bieIsSuspended currentEpochBaker) Nothing mbcr <- lookupBakerCapitalAndRewardDetails psBakerId poolRewards case mbcr of Nothing -> @@ -3344,8 +3346,8 @@ doGetPoolStatus pbs psBakerId@(BakerId aid) = case delegationChainParameters @pv ++ " is present in the current epoch bakers, but not \ \the current epoch capital distribution." Just (bc, BakerPoolRewardDetails{..}) -> do - return $ - Just + return + ( Just CurrentPaydayBakerPoolStatus { bpsBlocksBaked = blockCount, bpsFinalizationLive = finalizationAwake, @@ -3359,8 +3361,14 @@ doGetPoolStatus pbs psBakerId@(BakerId aid) = case delegationChainParameters @pv bpsCommissionRates = currentEpochBaker ^. BaseAccounts.bieBakerPoolInfo - . BaseAccounts.poolCommissionRates - } + . BaseAccounts.poolCommissionRates, + bpsIsPrimedForSuspension = + fromCondDef (fmap (Just . primedForSuspension) suspensionInfo) Nothing, + bpsMissedRounds = + fromCondDef (fmap (Just . missedRounds) suspensionInfo) Nothing + }, + isSuspended + ) if isJust psActiveStatus || isJust psCurrentPaydayStatus then return $ Just BakerPoolStatus{..} else return Nothing