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

create-testnet-data: use experimental API and make arguments era specific #968

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Nov 14, 2024

Changelog

- description: |
    More fine grained controls of eras for create-testnet-data. Forbid creating DReps and CC in babbage.

    Remove the `create-testnet-data` altogether in eras earlier than Babbage
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Fixes #962

How to trust this PR

Look at the changes in golden files

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Self-reviewed the diff

@smelc smelc added the next-update Needs a dependency to be updated to be merged label Nov 14, 2024
@smelc smelc force-pushed the smelc/parameterize-create-testnet-data-on-exp-era branch 3 times, most recently from a53325e to cf64c8b Compare November 15, 2024 09:45
@smelc smelc changed the base branch from master to smelc/use-inject-instead-of-XtoY-era-functions November 15, 2024 09:45
@smelc smelc force-pushed the smelc/use-inject-instead-of-XtoY-era-functions branch from b9c394f to 9c3bac2 Compare November 15, 2024 09:50
@smelc smelc force-pushed the smelc/parameterize-create-testnet-data-on-exp-era branch from cf64c8b to e700d78 Compare November 26, 2024 20:29
@smelc smelc changed the base branch from smelc/use-inject-instead-of-XtoY-era-functions to master November 27, 2024 09:55
@smelc smelc force-pushed the smelc/parameterize-create-testnet-data-on-exp-era branch from a41b90c to 50bb15c Compare December 6, 2024 10:03
@smelc smelc changed the base branch from master to smelc/update-api-to-10.4.0.0 December 6, 2024 10:03
@smelc smelc force-pushed the smelc/parameterize-create-testnet-data-on-exp-era branch from 50bb15c to 1075901 Compare December 6, 2024 10:04
@smelc smelc marked this pull request as ready for review December 6, 2024 10:05
@smelc smelc force-pushed the smelc/parameterize-create-testnet-data-on-exp-era branch from 1075901 to 8560a66 Compare December 6, 2024 10:27
Copy link
Contributor

@palas palas left a comment

Choose a reason for hiding this comment

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

Looks good. I left a couple of comments on things that caught my eye, just minor things. Feel free to address them if you think they make sense, but I leave it to your judgment

deriving Show

instance Show GenesisCreateTestNetDataCmdArgs where
show _ = "GenesisCreateTestNetDataCmdArgs"
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't derive anymore? It is odd because Era does have a Show instance (here), maybe after moving the parameter it will?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@palas> it doesn't derive anymore because there's an existential type in GenesisCreateTestnetDataCmdArgs now:

image

<*> pNumCommittee
<*> pNumDReps
<*> (case era of Exp.BabbageEra -> pure 0; Exp.ConwayEra -> pNumCommittee) -- Committee doesn't exist in babbage
<*> (case era of Exp.BabbageEra -> pure $ DRepCredentials OnDisk 0; Exp.ConwayEra -> pNumDReps) -- DReps don't exist in babbage
Copy link
Contributor

Choose a reason for hiding this comment

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

Making it unrepresentable on the type would be safer. But this is probably much simpler, so it seems a reasonable trade-off

@palas
Copy link
Contributor

palas commented Dec 10, 2024

Ah, one more thing, probably say what got broken in the change log. (That some eras no longer have the command.)

Base automatically changed from smelc/update-api-to-10.4.0.0 to master December 10, 2024 13:05
@smelc smelc force-pushed the smelc/parameterize-create-testnet-data-on-exp-era branch from 8560a66 to 7db283b Compare December 10, 2024 14:56
@smelc smelc enabled auto-merge December 10, 2024 14:56
@smelc smelc added this pull request to the merge queue Dec 10, 2024
Merged via the queue into master with commit e192227 Dec 10, 2024
25 checks passed
@smelc smelc deleted the smelc/parameterize-create-testnet-data-on-exp-era branch December 10, 2024 15:32
@smelc smelc removed the next-update Needs a dependency to be updated to be merged label Dec 10, 2024
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.

More fine grained era control in create-testnet-data
2 participants