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

Integrate latest ledger, consensus and api for 8.6.0 #385

Merged
merged 11 commits into from
Oct 27, 2023

Conversation

teodanciu
Copy link
Contributor

@teodanciu teodanciu commented Oct 18, 2023

Changelog

- description: |
    Updated cardano-ledger, ouroboros-consensus and cardano-api packages 
    Replaced  queryCommitteState with new queryCommitteeMembersState
    Added anchor to committee cold key resignation certificate command

# 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
  # - improvement    # QoL changes e.g. refactoring
  # - 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

Additional context for the PR goes here.

If the PR fixes a particular issue please provide a
link
to the issue.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • The change log section in the PR description has been filled in
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • round trip tests
    • integration tests
      See Running tests for more details
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • Self-reviewed the diff

@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch 4 times, most recently from 24b5b44 to 53a9d67 Compare October 19, 2023 11:54
@teodanciu teodanciu changed the title Integrate latest ledger, consensus and api for 8.6.0-pre - SRP Integrate latest ledger, consensus and api for 8.6.0 (based or cardano-api-8.26.0) - SRP Oct 19, 2023
s Outdated Show resolved Hide resolved
@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch from 53a9d67 to eaa2c1f Compare October 19, 2023 13:45
@teodanciu
Copy link
Contributor Author

Force-pushed to remove script added by mistake.

@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch from eaa2c1f to 71a1855 Compare October 19, 2023 17:53
@teodanciu teodanciu changed the title Integrate latest ledger, consensus and api for 8.6.0 (based or cardano-api-8.26.0) - SRP Integrate latest ledger, consensus and api for 8.6.0 (based or cardano-api-8.27.0) - SRP Oct 19, 2023
@teodanciu
Copy link
Contributor Author

Force pushed to integrate with cardano-api-27.0

@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch 3 times, most recently from 5749dfd to f95beaa Compare October 23, 2023 12:50
@teodanciu teodanciu changed the title Integrate latest ledger, consensus and api for 8.6.0 (based or cardano-api-8.27.0) - SRP Integrate latest ledger, consensus and api for 8.6.0 (based or cardano-api-8.28.0) - SRP Oct 23, 2023
@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch 3 times, most recently from f3f5745 to 7ac12a9 Compare October 24, 2023 12:54
@teodanciu
Copy link
Contributor Author

Two golden tests are failing, because of the new options in the query - trying to fix them

@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch from 7ac12a9 to 408df38 Compare October 24, 2023 15:09
@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch from 408df38 to 0f3f668 Compare October 24, 2023 16:25
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.

This is looking good, a couple minor comments

@@ -59,6 +61,7 @@ data GovernanceCommitteeCreateColdKeyResignationCertificateCmdArgs era =
GovernanceCommitteeCreateColdKeyResignationCertificateCmdArgs
{ eon :: !(ConwayEraOnwards era)
, vkeyColdKeySource :: !(VerificationKeyOrHashOrFile CommitteeColdKey)
, anchor :: !(Maybe (Ledger.Anchor (Ledger.EraCrypto (ShelleyLedgerEra era))))
Copy link
Contributor

@Jimbo4350 Jimbo4350 Oct 25, 2023

Choose a reason for hiding this comment

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

Have a look at how the governance action parsers handle anchors. E.g

data GovernanceActionCreateNoConfidenceCmdArgs era
  = GovernanceActionCreateNoConfidenceCmdArgs
      { eon                   :: !(ConwayEraOnwards era)
      , networkId             :: !Ledger.Network
      , deposit               :: !Lovelace
      , returnStakeAddress    :: !AnyStakeIdentifier
      , proposalUrl           :: !ProposalUrl
      , proposalHashSource    :: !ProposalHashSource
      , governanceActionId    :: !TxId
      , governanceActionIndex :: !Word32
      , outFile               :: !(File () Out)
      } deriving Show

In particular the proposalUrl and proposalHashSource fields.

Copy link
Contributor Author

@teodanciu teodanciu Oct 27, 2023

Choose a reason for hiding this comment

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

@Jimbo4350 So you prefer to flatten these two fields , url and hash.
But what to do about ProposalUrl and ProposalHashSource which are not accurately describing this Anchor, no - since it's not related to proposal, but to resignation.. Create new types for them?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, I don't understand exactly what the suggestion is (probably because I'm not familiar with the codebase).
Would you like me to represent Anchor in GovernanceCommitteeCreateColdKeyResignationCertificateCmdArgs as two different fields, similar to the example you gave above, so as :

   ,    resignationlUrl           :: !ProposalUrl
      , resignationHashSource    :: !ProposalHashSource

instead of the field that I have added:

, anchor            :: !(Maybe (Ledger.Anchor (Ledger.EraCrypto (ShelleyLedgerEra era))))

?

Did i understand correctly?

Copy link
Contributor

@Jimbo4350 Jimbo4350 Oct 27, 2023

Choose a reason for hiding this comment

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

Yes exactly 👍 I see what you're saying now.

Copy link
Contributor Author

@teodanciu teodanciu Oct 27, 2023

Choose a reason for hiding this comment

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

Both of them will have to be Maybe I suppose, since the field is optional. I hope it won't be too messy, if say one is there and the other one not 🤔

cardano-cli/src/Cardano/CLI/EraBased/Options/Query.hs Outdated Show resolved Hide resolved
cardano-cli/src/Cardano/CLI/Json/Friendly.hs Outdated Show resolved Hide resolved
cardano-cli/src/Cardano/CLI/Types/Errors/QueryCmdError.hs Outdated Show resolved Hide resolved
@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch 5 times, most recently from cd50a2b to 2f756fd Compare October 27, 2023 12:03
@@ -532,7 +530,6 @@ runTxBuild
<- hoistEither $ first TxCmdReturnCollateralValidationError $ validateTxReturnCollateral era mReturnCollateral
dFee <- hoistEither $ first TxCmdTxFeeValidationError $ validateTxFee era dummyFee
validatedLowerBound <- hoistEither (first TxCmdTxValidityLowerBoundValidationError (validateTxValidityLowerBound era mLowerBound))
validatedUpperBound <- hoistEither (first TxCmdTxValidityUpperBoundValidationError (validateTxValidityUpperBound era mUpperBound))
Copy link
Contributor

Choose a reason for hiding this comment

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

We no longer do validation here because by virtue of using era-sensitive types in the era-based CLI parser the values are already valid.

@teodanciu teodanciu marked this pull request as ready for review October 27, 2023 17:27
@teodanciu teodanciu force-pushed the td/ledger-consensus-and-api-for-8.6 branch from 01e98c0 to eda3544 Compare October 27, 2023 17:30
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! Just get @CarlosLopezDeLara to sign off on the new parser names.

@CarlosLopezDeLara CarlosLopezDeLara added this pull request to the merge queue Oct 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 27, 2023
@CarlosLopezDeLara CarlosLopezDeLara added this pull request to the merge queue Oct 27, 2023
Merged via the queue into main with commit 5c0897b Oct 27, 2023
19 checks passed
@CarlosLopezDeLara CarlosLopezDeLara deleted the td/ledger-consensus-and-api-for-8.6 branch October 27, 2023 20:02
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.

4 participants