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

Make genesis creation commands era-sensitive #812

Merged

Conversation

carbolymer
Copy link
Contributor

@carbolymer carbolymer commented Jul 2, 2024

Changelog

- description: |
    Make `genesis`: `create`, `create-staked` and `create-cardano` commands accept optional era parameters.
# 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

Make genesis: create, create-staked and create-cardano commands accept optional era parameters. This is needed for decoding of Alonzo genesis. This PR requires changes from: IntersectMBO/cardano-api#564

Fixes: #801

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

@carbolymer carbolymer force-pushed the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch 7 times, most recently from 3de04f4 to bbff062 Compare July 12, 2024 13:36
@smelc
Copy link
Contributor

smelc commented Jul 15, 2024

Looking good so far 👍

@carbolymer carbolymer force-pushed the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch from 022a6e9 to 8367257 Compare July 15, 2024 13:44
@@ -0,0 +1,152 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}

Check warning

Code scanning / HLint

Unused LANGUAGE pragma Warning

cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/Common.hs:2:1-31: Warning: Unused LANGUAGE pragma
  
Found:
  {-# LANGUAGE DeriveAnyClass #-}
  
Perhaps you should remove it.
@@ -0,0 +1,152 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}

Check warning

Code scanning / HLint

Unused LANGUAGE pragma Warning

cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/Common.hs:3:1-30: Warning: Unused LANGUAGE pragma
  
Found:
  {-# LANGUAGE DeriveGeneric #-}
  
Perhaps you should remove it.
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}

Check warning

Code scanning / HLint

Unused LANGUAGE pragma Warning

cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/Common.hs:9:1-27: Warning: Unused LANGUAGE pragma
  
Found:
  {-# LANGUAGE LambdaCase #-}
  
Perhaps you should remove it.
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}

Check warning

Code scanning / HLint

Unused LANGUAGE pragma Warning

cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/Common.hs:10:1-31: Warning: Unused LANGUAGE pragma
  
Found:
  {-# LANGUAGE NamedFieldPuns #-}
  
Perhaps you should remove it.
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}

Check warning

Code scanning / HLint

Unused LANGUAGE pragma Warning

cardano-cli/src/Cardano/CLI/EraBased/Run/Genesis/Common.hs:14:1-30: Warning: Unused LANGUAGE pragma
  
Found:
  {-# LANGUAGE TypeOperators #-}
  
Perhaps you should remove it.
  
Note: may require {-# LANGUAGE ExplicitNamespaces #-} adding to the top of the file
@carbolymer carbolymer force-pushed the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch 3 times, most recently from 2a2da4f to 53ec3b7 Compare July 15, 2024 15:26
@carbolymer carbolymer changed the title Make Plutus V2 cost model era dependent Make genesis creation commands era-sensitive Jul 15, 2024
@carbolymer carbolymer force-pushed the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch from 53ec3b7 to b2b3f79 Compare July 15, 2024 15:45
@palas
Copy link
Contributor

palas commented Jul 15, 2024

@palas palas force-pushed the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch from b2b3f79 to 257d8ef Compare July 15, 2024 22:25
@palas
Copy link
Contributor

palas commented Jul 15, 2024

FYI: I have rebased your branch because we have done changes to the formatting. I have made a copy of the unrebased branch that you can find in my previous comment in this PR.

@carbolymer carbolymer force-pushed the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch 2 times, most recently from 2f7bec8 to ee6224a Compare July 16, 2024 11:35
cabal.project Outdated
@@ -57,3 +57,12 @@ write-ghc-environment-files: always
-- IMPORTANT
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

source-repository-package
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Remove SRP

Comment on lines +12 to +14
( decodeShelleyGenesisFile
, decodeAlonzoGenesisFile
, decodeConwayGenesisFile
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those are new functions, the other ones were moved as-is.

@carbolymer carbolymer marked this pull request as ready for review July 16, 2024 12:00
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!

@carbolymer carbolymer force-pushed the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch from ee6224a to e8658b0 Compare July 19, 2024 15:18
@carbolymer carbolymer force-pushed the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch from e8658b0 to bce490f Compare July 19, 2024 15:23
@carbolymer carbolymer added this pull request to the merge queue Jul 19, 2024
Merged via the queue into main with commit 403a01e Jul 19, 2024
24 checks passed
@carbolymer carbolymer deleted the mgalazyn/fix/make-plutus-v2-cost-model-era-dependent branch July 19, 2024 17:28
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.

New Plutus V2 cost model parameters are mandatory for alonzo genesis spec in map format
4 participants