Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow BlockSyncer.listen to catch up with the node #71

Merged
merged 1 commit into from
Mar 15, 2019
Merged

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Mar 15, 2019

Relates to #52.

Overview

It will now process blocks continuously, in chunks, until all the local blocks from the node are done. Then it will start polling.

@rvl rvl self-assigned this Mar 15, 2019
@rvl rvl force-pushed the rvl/52/catch-up branch 2 times, most recently from 66fb354 to df20bbe Compare March 15, 2019 09:16
@rvl rvl mentioned this pull request Mar 15, 2019
6 tasks
@@ -92,6 +94,9 @@ mkReader = do
, \x -> modifyMVar_ ref $ return . (x :)
)

flatten :: [TickResult [Block]] -> [Block]
flatten = concat . concat . map toList
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe : concat . concatMap toList ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see HLint complained about it. I will fix this, squash and push

data TickResult a
= GotChunk !a -- ^ Have a result, and there may be more available.
| Sleep -- ^ There is no result available now, so wait.
deriving (Show, Eq, Foldable)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how the Foldable instance is derived here 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{-# LANGUAGE DeriveFoldable #-}

@KtorZ
Copy link
Member

KtorZ commented Mar 15, 2019

Please don't merge now. I am trying to resolve issues with building the http bridge first.

@paweljakubas
Copy link
Contributor

just rebased

It will now process blocks continuously, in chunks, until all the local
blocks from the node are done. Then it will start polling.

[23] Hlint fix
@KtorZ KtorZ merged commit 2c90f8f into master Mar 15, 2019
@KtorZ KtorZ deleted the rvl/52/catch-up branch March 15, 2019 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants