Skip to content

Commit

Permalink
Retrigger GDD when the selection changes
Browse files Browse the repository at this point in the history
  • Loading branch information
facundominguez committed Mar 27, 2024
1 parent b47c8c9 commit f990d41
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -300,12 +300,17 @@ runPointSchedule schedulerConfig genesisTest tracer0 =
= pure nullTracer

gdd = updateLoEFragGenesis config (mkGDDTracerTestBlock tracer) getCandidates getHandles (readTVar (psrIdling resources))
-- We make GDD rerun every time the anchor or the blocks of the
-- selection change.
getCurrentChainWithAnchor = do
c <- getCurrentChain
return $ AF.anchorPoint c : map AF.blockPoint (AF.toOldestFirst c)

stateTracer <- mkStateTracer
BlockFetch.startBlockFetchLogic registry tracer chainDb fetchClientRegistry getCandidates
for_ loEVar $ \ var ->
void $ forkLinkedThread registry "LoE updater background" $
runGdd gdd var chainDb ((,) <$> getLatestSlots <*> readTVar (psrIdling resources))
runGdd gdd var chainDb ((,,) <$> getLatestSlots <*> readTVar (psrIdling resources) <*> getCurrentChainWithAnchor)
runScheduler
(Tracer $ traceWith tracer . TraceSchedulerEvent)
stateTracer
Expand Down

0 comments on commit f990d41

Please sign in to comment.