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: create byron genesis #974

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Nov 19, 2024

Changelog

- description: |
    create-testnet-data: create byron genesis
# 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

How to trust this PR

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 changed the base branch from master to smelc/genesis-share-writing-code November 19, 2024 13:15
@smelc smelc mentioned this pull request Nov 19, 2024
3 tasks
Base automatically changed from smelc/genesis-share-writing-code to master November 20, 2024 10:14
@smelc smelc force-pushed the smelc/create-testnet-data-create-byron-genesis branch 2 times, most recently from 2072ac2 to b984f7a Compare November 20, 2024 14:36
@smelc smelc force-pushed the smelc/create-testnet-data-create-byron-genesis branch from b984f7a to 10f6517 Compare November 20, 2024 15:34
@smelc smelc force-pushed the smelc/create-testnet-data-create-byron-genesis branch 4 times, most recently from 757e3e6 to d0fe09b Compare November 20, 2024 16:30
@smelc smelc force-pushed the smelc/create-testnet-data-create-byron-genesis branch from dcbe34d to af8d233 Compare November 21, 2024 15:10
Comment on lines +2 to +3
byron-gen-command/genesis-keys.000.key
byron-gen-command/genesis-keys.001.key
Copy link
Contributor Author

@smelc smelc Nov 21, 2024

Choose a reason for hiding this comment

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

Those files are not used by create-testnet-data, but they are present anyway in the workspace created by create-testnet, so I've left them in the same position.

@smelc smelc marked this pull request as ready for review November 21, 2024 16:01
@smelc
Copy link
Contributor Author

smelc commented Nov 22, 2024

Waiting @Jimbo4350's approval before merging

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 but a few comments for a follow up PR.

@@ -377,7 +388,32 @@ runGenesisCreateTestNetDataCmd
stuffedUtxoAddrs
shelleyGenesis

-- Write genesis.json file to output
let byronGenesisFp = outputDir </> "byron.genesis.spec.json" -- This file is used by the performance testing team.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this default should live in the parsers.

byronPoolNumber = max 1 numPools -- byron genesis creation needs a >= 1 number of pools

-- All arbitrary values come from cardano-testnet
mkByronGenesisParameters actualNetworkWord32 byronGenesisFp shelleyGenesis =
Copy link
Contributor

@Jimbo4350 Jimbo4350 Nov 22, 2024

Choose a reason for hiding this comment

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

All of the Byron functionality should be factored out on its own as much as possible. A separate module for it would make sense.

mkByronGenesisParameters actualNetworkWord32 byronGenesisFp shelleyGenesis =
Byron.GenesisParameters{..}
where
gpStartTime = sgSystemStart shelleyGenesis
Copy link
Contributor

Choose a reason for hiding this comment

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

These needs comments or need to point to documentation that explains them.

@@ -496,6 +557,37 @@ runGenesisCreateTestNetDataCmd
desiredKeyOutputFormat :: KeyOutputFormat
desiredKeyOutputFormat = KeyOutputFormatTextEnvelope

-- | We need to pass these values to create the Byron genesis file.
-- The values here don't matter as the testnet conditions are ultimately determined
-- by the Shelley genesis.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any documentation we can point to?

@smelc
Copy link
Contributor Author

smelc commented Nov 25, 2024

@Jimbo4350> created issue to follow-up on improvements: #976

Merged via the queue into master with commit 117f509 Nov 25, 2024
27 checks passed
@smelc smelc deleted the smelc/create-testnet-data-create-byron-genesis branch November 25, 2024 11:14
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: create byron genesis
3 participants