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

Connect Primitives to Layers #73

Merged
merged 9 commits into from
Mar 18, 2019

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Mar 15, 2019

Issue Number

#69

Overview

  • reviewed CLI Decodable / Encodable to allow decoding from a list of string
  • made the entropy a ScrubbedBytes rather than a ByteString
  • moved wallet metadata in Cardano.Wallet & define a basic wallet worker
  • made 'tick' pass whatever is fetched from the source
  • reviewed DBLayer & define a dummy db-layer with an MVar
  • Kept track of current network tip in the Wallet business logic
  • linked primitives together in the wallet server and do basic wallet work

Comments

This is a rather big PR, I'll split that in multiple smaller ones as I also introduce various tests. I wanted to test the full pipeline and it's rather okay so far. The wallet processes blocks from the chain producer at a rather decent pace (~4000 blocks per second).

$ stack build --fast --profile --exec "stack exec -- cardano-wallet-server xxx xxx xxx xxx xxx... +RTS -h -p -RTS"

Current tip: -0.21544
Available balance: 0 Lovelaces
Current tip: 1.21597
Available balance: 0 Lovelaces
Current tip: 2.21582
Available balance: 0 Lovelaces
...

The memory usage looks also quite okay:

image

Copy link
Contributor

@rvl rvl left a comment

Choose a reason for hiding this comment

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

Looks reasonable so far...

Copy link
Contributor

@paweljakubas paweljakubas left a comment

Choose a reason for hiding this comment

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

Tons of name changing (very good ones like entropyToByteString -> entropyToBytes, using put, read rathaer than implementation suggesting enqueue, dequeue), relocating stuff (like wallet types from Cardano.WalletLayer to Cardano.Wallet) and a number of more precision types application : like using ScrubbedBytes rather than ByteString in generation key functions. I am especially fond of introducing of GetArg class.

Still, do not understand why we forbid using more than one block per tick ... All "gaps" are going to be tackled elsewhere?

src/Cardano/NetworkLayer.hs Outdated Show resolved Hide resolved
@KtorZ KtorZ force-pushed the KtorZ/69/connect-primitive-to-layers branch from be59ed3 to 93e0605 Compare March 18, 2019 09:09
@KtorZ KtorZ marked this pull request as ready for review March 18, 2019 09:09
@KtorZ KtorZ force-pushed the KtorZ/69/connect-primitive-to-layers branch from 93e0605 to e77531a Compare March 18, 2019 09:10
putStrLn ""
exitWithUsage cli

class GetArg from where
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 Why not getArg and getAllArgs?

Side-note, previously I thought about (and wanted) to write the cli code like lift decode <$> getArg option

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually. I have been perhaps a bit too far. Having two functions would work as well. Once the Decodable instance have been adjusted, we could rely on that and have two getArg and getAllArgs functions.

app/server/Main.hs Outdated Show resolved Hide resolved
app/server/Main.hs Outdated Show resolved Hide resolved
@KtorZ KtorZ force-pushed the KtorZ/69/connect-primitive-to-layers branch from e77531a to fb60be2 Compare March 18, 2019 12:50
@paweljakubas paweljakubas merged commit 0aafbf6 into master Mar 18, 2019
@KtorZ KtorZ deleted the KtorZ/69/connect-primitive-to-layers branch March 18, 2019 13:39
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

4 participants