Safe HaskellNone




period :: Int Source #

How often do we check the queue

measureEventByTxs :: ChainSyncEvent -> Natural Source #

We estimate the size of the event with the number of the transactions in the block. By doing this we accumulate some number of blocks but with less than queueSize number of transactions. This approach helps to process blocks with a constant memory usage.

Just accumulating queueSize blocks doesn't work as a block can have any number of transactions. It works fine at the beginning of the chain but later blocks grow in their size and the memory usage grows tremendously.

processEventsQueue :: Trace IO (PrettyObject SyncLog) -> RunRequirements -> EventsQueue -> IO () Source #

processEventsQueue reads events from TBQueue, collects enough RollForwards to append blocks at once.