-
Notifications
You must be signed in to change notification settings - Fork 720
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
cardano-testnet: Avoid rewrite of sgMaxLovelaceSupply #5746
Conversation
@@ -137,8 +137,8 @@ createSPOGenesisAndFiles (NumPools numPoolNodes) era shelleyGenesis alonzoGenesi | |||
, "--spec-conway", inputGenesisConwayFp | |||
, "--testnet-magic", show testnetMagic | |||
, "--pools", show numPoolNodes | |||
, "--total-supply", show @Int 2_000_000_000_000 | |||
, "--delegated-supply", show @Int 1_000_000_000_000 | |||
, "--total-supply", show @Int 2_000_000_000_000 -- 2 trillions |
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 are overwriting the inputGenesisShelleyFp
. We don't want to do this.
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 better to either:
- Disallow values that result in a negative treasury
- Add a check that will fail if the treasury in the node state is negative
We don't to hard code values unless its specifically contained in a default Haskell value
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.
@Jimbo4350> Please note that this was the case before this PR, I'm not changing this behavior here 🙂
Disallow values that result in a negative treasury
Add a check that will fail if the treasury in the node state is negative
That was actually my first instinct, but alas, looking at the ledger's spec; it seems quite involved to catch cases that will cause treasury to be negative (at least with my level of knowledge) and also it seemed wrong to have this code here. I would favor reusing the ledger's core that does this (if any).
We don't to hard code values unless its specifically contained in a default Haskell value
Agreed, but I would rather do that in a follow-up PR. This PR is an improvement over the current state, so it makes sense as a first step.
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.
Please note that this was the case before this PR, I'm not changing this behavior here
Yep definitely wasn't blaming you. It was likely me who put those values there 🤡
Agreed, but I would rather do that in a follow-up PR.
👍
116f78a
to
40406dd
Compare
40406dd
to
a3aaa72
Compare
a3aaa72
to
7397a3c
Compare
Description
Avoid this hacky rewrite that was necessary for the treasury growth test to pass (without the rewrite the treasury was negative).
How to trust this PR
The treasury growth test now passes without the genesis' rewrite (try it with
PARALLEL_TESTNETS=1 DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/Treasury Growth/"'
)Checklist