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: add option to create constitutional committee members #961

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Nov 5, 2024

Changelog

- description: |
    Add option --committee-keys to `create-testnet-data` to create the cold and hot credential for constitutional committee members
# 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 #757

How to trust this PR

Try it out:

> mkdir create_testnet_out
> cabal run cardano-cli -- conway genesis create-testnet-data --out-dir create_testnet_out --testnet-magic 42 --committee-keys 2

Observe the resulting directory has the expected shape:

> tree create_testnet_out/cc-keys/
create_testnet_out/cc-keys/
├── cc1
│   ├── cc.cold.skey
│   ├── cc.cold.vkey
│   ├── cc.hot.skey
│   └── cc.hot.vkey
├── cc2
│   ├── cc.cold.skey
│   ├── cc.cold.vkey
│   ├── cc.hot.skey
│   └── cc.hot.vkey
└── README.md

And you can next open the various key files to see that the envelope is the correct one:

> nvim -p $(find create_testnet_out/cc-keys/ -name '*.skey' -o -name '*.vkey')

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@smelc smelc force-pushed the smelc/create-testnet-data-populate-committee-members branch from 2a4c664 to 8c952f8 Compare November 5, 2024 10:16
@smelc smelc force-pushed the smelc/create-testnet-data-populate-committee-members branch from 8c952f8 to a3ed90b Compare November 5, 2024 11:35
@smelc smelc force-pushed the smelc/create-testnet-data-populate-committee-members branch 2 times, most recently from b6f391b to a4fe0d7 Compare November 5, 2024 20:41
@smelc smelc marked this pull request as ready for review November 6, 2024 10:23
Comment on lines +265 to +266
hotArgs = CC.GovernanceCommitteeKeyGenHotCmdArgs ConwayEraOnwardsConway vkeyHotFile skeyHotFile
coldArgs = CC.GovernanceCommitteeKeyGenColdCmdArgs ConwayEraOnwardsConway vkeyColdFile skeyColdFile
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not hardcode the era here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we can if we make create-testnet-data only Conway onwards. Which makes sense, because it was introduced when we were developing conway. Right now we are incorrect, because nothing in create-testnet-data is parameterized on the era (everything is Shelley onwards, including for example DReps).

@Jimbo4350> what do you think about making create-testnet-data only Conway onwards?

Copy link
Contributor

@Jimbo4350 Jimbo4350 Nov 6, 2024

Choose a reason for hiding this comment

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

I would parameterize it on Era era. We actually need to deprecate the BabbageEra constructor of Era era.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created a follow-up issue to avoid mixing this change in this PR: #962

@smelc smelc force-pushed the smelc/create-testnet-data-populate-committee-members branch from dbe6213 to cd3de55 Compare November 6, 2024 13:14
@@ -253,6 +255,26 @@ runGenesisCreateTestNetDataCmd

when (0 < numPools) $ writeREADME poolsDir poolsREADME

-- CC members
ccColdKeys <- forM [1 .. numCommitteeKeys] $ \index -> do
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we not missing a transient vs on disk distinction here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Jimbo4350> Yes we do miss the distinction. I thought the transient case was not worth the extra effort for the constitutional committee, because I think having a committee with millions of members is not a case we likely want to spend resource testing.

WDYT? Do you want me to add a on-disk/transient distinction?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would check with @mgmeier

Copy link
Contributor

@mgmeier mgmeier Nov 7, 2024

Choose a reason for hiding this comment

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

Given the optional nature of creating constitutional committee keys, and the expected number of keys being vastly lower than for instance for DReps, there's no need for a transient mode from Performance & Tracing.

@smelc smelc force-pushed the smelc/create-testnet-data-populate-committee-members branch from cd3de55 to 11ffe24 Compare November 7, 2024 09:51
@Jimbo4350 Jimbo4350 self-requested a review November 7, 2024 12:43
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

LGTM! CI is still failing.

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.

create-testnet-data: support creating committee (using conway genesis)
4 participants