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

Revert back to the group serialization for ProtVer for PParams #3440

Merged
merged 2 commits into from
May 23, 2023

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented May 23, 2023

Description

Revert back to the group serialization for ProtVer for PParams. This PR fixes the same problem with PParams serialization that was fixed in #3297, but it fixes in a slightly more backwards compatible manner. Namely it, as before #3297, unrolls ProtocolVersion into a list, except it properly adjusts the number of elements in the list.

Both Alonzo and Babbage PParams were affected and fixed in this PR.

Implementation in this PR was discussed here CardanoSolutions/ogmios#314 (comment)

Note the new version in the CHANGELOG, this is because this fix is getting backported to 1.2.1 versions in #3441

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@lehins lehins force-pushed the lehins/fix-pparams-and-ledger-state-serialization branch from ddb917e to 402a98e Compare May 23, 2023 15:19
@lehins lehins marked this pull request as ready for review May 23, 2023 15:34
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

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

LGTM

@JaredCorduan
Copy link
Contributor

JaredCorduan commented May 23, 2023

hmm, a golden test is failing in CI. There are no protocol parameters in the script context, so I'm confused.

Edit: maybe I get it, the golden test needs to deserialize the entire transaction so it can create the script context. and a transaction can have a ppup.

@lehins
Copy link
Collaborator Author

lehins commented May 23, 2023

maybe I get it, the golden test needs to deserialize the entire transaction so it can create the script context. and a transaction can have a ppup.

Nah, its not that. PParams are generated because they are needed for TxInfo translation. But they also need to be stored somewhere. This one is easy, all I need is rerun the generator for txInfo translation golden tests.

FYI, this problem does not apply to #3441

@JaredCorduan
Copy link
Contributor

Nah, its not that. PParams are generated because they are needed for TxInfo translation.

oh, you mean to get a major protocol version?

@lehins
Copy link
Collaborator Author

lehins commented May 23, 2023

oh, you mean to get a major protocol version?

Yes. Here https://github.com/input-output-hk/cardano-ledger/blob/040b3a4b3993337dc07064e28e988ce99a1aef99/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs#L532

@lehins lehins enabled auto-merge May 23, 2023 17:33
@lehins lehins merged commit d421556 into master May 23, 2023
@iohk-bors iohk-bors bot deleted the lehins/fix-pparams-and-ledger-state-serialization branch May 23, 2023 17:41
github-merge-queue bot pushed a commit to IntersectMBO/ouroboros-consensus that referenced this pull request May 24, 2023
@lehins lehins mentioned this pull request Jul 7, 2023
9 tasks
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.

2 participants