Stop using Summands from Coders for PV12+#5860
Open
aniketd wants to merge 7 commits into
Open
Conversation
7026d37 to
d66d954
Compare
d66d954 to
ecaf94a
Compare
ecaf94a to
a9c2f7e
Compare
Soupstraw
reviewed
May 29, 2026
11 tasks
There was a problem hiding this comment.
Pull request overview
This PR completes the PV12+ migration away from Coders-based Summands/SparseKeyed decoding for on-chain types (per #5718), switching to the newer plain decoder helpers while preserving pre-PV12 decoding via ifDecoderVersionAtLeast.
Changes:
- Introduce PV12+ decoders using
decodeRecordSum,decodeRecordNamed, anddecodeSparseKeyed, while keeping legacyCodersdecoding for earlier protocol versions. - Update multiple core/conway/alonzo/dijkstra decoding paths to use version-gated decoding behavior.
- Adjust testlib modules and cabal dependencies (add
cardano-base) to supportTypeNameindecodeSparseKeyed.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/cardano-ledger-core/src/Cardano/Ledger/Plutus/Data.hs | Add PV12+ Datum decoder using decodeRecordSum behind ifDecoderVersionAtLeast. |
| libs/cardano-ledger-core/src/Cardano/Ledger/DRep.hs | Add PV12+ DRep decoder via decodeRecordSum behind version gating. |
| libs/cardano-ledger-core/src/Cardano/Ledger/Credential.hs | Add PV12+ Credential decoder via decodeRecordSum behind version gating. |
| libs/cardano-ledger-core/src/Cardano/Ledger/Core/PParams.hs | Update PParamsUpdate field decoding to avoid field helper and use PV12+ decoders where applicable. |
| libs/cardano-ledger-core/src/Cardano/Ledger/BaseTypes.hs | Add PV12+ Nonce decoding via decodeRecordSum behind version gating. |
| eras/dijkstra/impl/testlib/Test/Cardano/Ledger/Dijkstra/Binary/Annotator.hs | Replace Coders SparseKeyed decoding with decodeSparseKeyed and explicit per-key decoders. |
| eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Scripts.hs | Replace Coders Summands decoding with decodeRecordSum for native scripts. |
| eras/dijkstra/impl/cardano-ledger-dijkstra.cabal | Add cardano-base dependency for testlib (TypeName). |
| eras/conway/impl/src/Cardano/Ledger/Conway/TxCert.hs | Add PV12+ Delegatee decoder via decodeRecordSum behind version gating. |
| eras/conway/impl/src/Cardano/Ledger/Conway/Governance/Procedures.hs | Add PV12+ decoders for Committee and GovAction behind version gating. |
| eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Binary/Annotator.hs | Add PV12+ record/sparse decoding paths for Alonzo tx/auxdata/wits/script decoding. |
| eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxWits.hs | Export alonzoPlutusScriptDecoder. |
| eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxAuxData.hs | Add PV12+ Shelley-token-type auxdata decoding path. |
| eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Tx.hs | Add PV12+ tx decoder using decodeRecordNamed and version gating. |
| eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs | Add PV12+ AlonzoScript decoder via decodeRecordSum behind version gating. |
| eras/alonzo/impl/CHANGELOG.md | Document the new alonzoPlutusScriptDecoder export. |
| eras/alonzo/impl/cardano-ledger-alonzo.cabal | Add cardano-base dependency for testlib (TypeName). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
50
to
55
| encodeTag, | ||
| fromPlainDecoder, | ||
| fromPlainEncoding, | ||
| ifDecoderVersionAtLeast, | ||
| natVersion, | ||
| ) |
Comment on lines
102
to
116
| import Cardano.Ledger.Binary ( | ||
| Annotator, | ||
| DecCBOR (..), | ||
| Decoder, | ||
| EncCBOR (encCBOR), | ||
| Encoding, | ||
| ToCBOR (..), | ||
| decodeNullStrictMaybe, | ||
| encodeListLen, | ||
| encodeNullStrictMaybe, | ||
| ifDecoderVersionAtLeast, | ||
| natVersion, | ||
| serialize, | ||
| serialize', | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
FieldThis is the final part to complete the addressal of #5718
Checklist
CHANGELOG.mdfiles updated for packages with externally visible changes.NOTE: New section is never added with the code changes. (See RELEASING.md).
.cabalandCHANGELOG.mdfiles when necessary, according to theversioning process.
.cabalfiles updated when necessary.NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
scripts/fourmolize.sh).scripts/cabal-format.sh).scripts/gen-cddl.sh)hie.yamlupdated (usescripts/gen-hie.sh).