-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add create-testnet-data command #488
Conversation
a6bed88
to
32cbe4a
Compare
A question to reviewers:
Comments on design choices:
|
32cbe4a
to
5556418
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left quite a few comments, but mostly nitpicks. This is still a messy bit of code, and there are a few things I still feel uneasy about (for example readGenDelegsMap
: the way it's implemented to compute the intersection and differences of a few maps, and then apply another transformation to the result, the fact that we even need it (going from numbers to file names seems brittle), the weird error message containing lists of meaningless (to the user) numbers,...) .
Nonetheless, I think this is an improvement. Approved, thank you!
cardano-cli/test/cardano-cli-golden/Test/Golden/CreateTestnetData.hs
Outdated
Show resolved
Hide resolved
de378d5
to
aa49d92
Compare
6cb04c4
to
3836a7c
Compare
, numStakeDelegators :: !Word | ||
, numStuffedUtxo :: !Word | ||
, numUtxoKeys :: !Word | ||
, supply :: !(Maybe Lovelace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maximum supply of lovelace right? A comment would be useful here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the maximum supply of non-delegated lovelace, not the total supply. I propose to discuss the final API we want on Slack, and follow-up with another PR.
pure newTemplate | ||
|
||
-- Genesis keys | ||
let mkPaths :: String -> String -> String -> Map Int FilePath = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be clearer to factor this out IMO and have a little comment as to what the map will be used for. Could be done in a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
@@ -500,7 +502,7 @@ updateCreateStakedOutputTemplate | |||
] | |||
, sgStaking = | |||
ShelleyGenesisStaking | |||
{ sgsPools = ListMap pools | |||
{ sgsPools = ListMap . Set.toList $ pools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we use ListMap for performance reasons. You'll need to ask @newhoggy if this is OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a problem. Please avoid conversion from List
to Set
and back again, which I think is what happens. Please also ensure that the list can be evaluated lazily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also double-check that you can create 30 million UTxOs on a 64G laptop: IntersectMBO/cardano-node#3938
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@newhoggy> I removed the conversion and will benchmark soon 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
9717978
to
4b0dbda
Compare
f8ce9f1
to
d39d9de
Compare
d39d9de
to
9075f99
Compare
Changelog
Context
Fixes #473
How to trust this PR
Run/Genesis.hs
toRun/CreateTestnetData.hs
is not modifiedRun/Genesis.hs
is unchanged.create-testnet-data
is in a golden file, and it is consistent with what we said we would do.Checklist