File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
eras/shelley/impl/src/Cardano/Ledger/Shelley/Rules Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ poolDelegationTransition ::
215
215
poolDelegationTransition = do
216
216
TRC
217
217
( PoolEnv cEpoch pp
218
- , ps@ PState {psStakePools, psVRFKeyHashes}
218
+ , ps@ PState {psStakePools, psFutureStakePools, psVRFKeyHashes}
219
219
, poolCert
220
220
) <-
221
221
judgmentContext
@@ -269,9 +269,17 @@ poolDelegationTransition = do
269
269
& psVRFKeyHashesL %~ Set. insert ppVrf
270
270
Just _ -> do
271
271
-- re-register Pool
272
+
273
+ -- If a pool re-registers with a fresh VRF, we have to add it to the list,
274
+ -- but also remove th potential VRF stored in previous re-registration within the same epoch,
275
+ -- which we can retrieve from futureStakePools. We first delete and then insert the new one,
276
+ -- so in case they are the same, it will still end up in the set.
272
277
let updateVRFs
273
278
| hasMatchingVRF = id
274
- | otherwise = psVRFKeyHashesL %~ Set. insert ppVrf
279
+ | otherwise = psVRFKeyHashesL %~ (Set. insert ppVrf . withoutFutureVrf)
280
+ where
281
+ withoutFutureVrf s = maybe s (`Set.delete` s) futureVrf
282
+ futureVrf = (^. spsVrfL) <$> Map. lookup ppId psFutureStakePools
275
283
tellEvent $ ReregisterPool ppId
276
284
-- hk is already registered, so we want to reregister it. That means adding it
277
285
-- to the Future pool params (if it is not there already), and overriding the
You can’t perform that action at this time.
0 commit comments