@@ -113,6 +113,7 @@ import Ouroboros.Consensus.Mempool.TxSeq (TicketNo)
113113import Ouroboros.Consensus.NodeKernel (getMempoolReader ,
114114 getMempoolWriter )
115115import Ouroboros.Consensus.Util.ResourceRegistry (ResourceRegistry )
116+ import qualified Ouroboros.Consensus.Util.ResourceRegistry as ResourceRegistry
116117import Ouroboros.Network.Block (ChainUpdate (.. ),
117118 Point (.. ))
118119import qualified Ouroboros.Network.Point as Point (block )
@@ -700,13 +701,12 @@ withByronProxy
700701 :: ( ApplyTx (Block cfg ) )
701702 => Tracer IO (Severity , Text. Builder )
702703 -> ByronProxyConfig
703- -> ResourceRegistry IO
704704 -> Index IO (Header (Block cfg ))
705705 -> ChainDB IO (Block cfg )
706706 -> Mempool IO (Block cfg ) TicketNo
707707 -> (ByronProxy -> IO t )
708708 -> IO t
709- withByronProxy trace bpc rr idx db mempool k = do
709+ withByronProxy trace bpc idx db mempool k = do
710710
711711 -- The best announced block header, and the identifiers of every peer which
712712 -- announced it. `Nothing` whenever there is no known announcement. It will
@@ -807,7 +807,8 @@ withByronProxy trace bpc rr idx db mempool k = do
807807 , Logic. getBlockHeader = bbsGetBlockHeader epochSlots idx db blockDecodeError
808808 -- MsgGetHeaders conversation
809809 , getBlockHeaders = \ mLimit checkpoints mTip -> do
810- result <- bbsGetBlockHeaders epochSlots rr idx db blockDecodeError mLimit checkpoints mTip
810+ result <- ResourceRegistry. withRegistry $ \ rr ->
811+ bbsGetBlockHeaders epochSlots rr idx db blockDecodeError mLimit checkpoints mTip
811812 case result of
812813 Nothing -> pure $ Left $ GHFBadInput " "
813814 Just it -> pure $ Right it
@@ -825,7 +826,8 @@ withByronProxy trace bpc rr idx db mempool k = do
825826 Right (legacyBlk :: Byron.Legacy. Block ) -> pure legacyBlk
826827 -- GetBlocks conversation
827828 , getHashesRange = \ mLimit from to -> do
828- result <- bbsGetHashesRange rr idx db blockDecodeError mLimit from to
829+ result <- ResourceRegistry. withRegistry $ \ rr ->
830+ bbsGetHashesRange rr idx db blockDecodeError mLimit from to
829831 case result of
830832 Nothing -> pure $ Left $ GHRBadInput " "
831833 Just it -> pure $ Right it
@@ -837,8 +839,9 @@ withByronProxy trace bpc rr idx db mempool k = do
837839 -- at the given start hash! This is not documented in cardano-sl.
838840 -- That's done by giving `False` to `bbsStreamBlocks`, which uses
839841 -- the `ChainDB` `Reader` API to do streaming. It stops at a fork.
840- , Logic. streamBlocks = \ hh l ->
841- bbsStreamBlocks rr idx db blockDecodeError hh (pure . toSerializedBlock) False l
842+ , Logic. streamBlocks = \ hh l -> do
843+ ResourceRegistry. withRegistry $ \ rr ->
844+ bbsStreamBlocks rr idx db blockDecodeError hh (pure . toSerializedBlock) False l
842845 }
843846
844847 networkConfig = bpcNetworkConfig bpc
0 commit comments