Support Plutus V4 CBOR tag in AlonzoScript decoder#5567
Support Plutus V4 CBOR tag in AlonzoScript decoder#5567Onyinyechi46 wants to merge 1 commit intoIntersectMBO:masterfrom
Conversation
|
Could you please also update the non-Annotator version of the decoder? https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Binary/Annotator.hs#L300 Also, it would be good to have a more descriptive commit message like |
|
We probably don't want it to be decodable before protocol version 12, so there should be some guards to ensure that decoding fails in earlier versions. @lehins |
@Soupstraw There is one. It is checked for each Language/EraProtVerLow pair here: cardano-ledger/libs/cardano-ledger-core/src/Cardano/Ledger/Plutus/Language.hs Lines 583 to 591 in ab3f025 It would probably be better to pass this function the actual era and derive the protocol version this way, but for now this is ok and this PR is safe in that perspective |
Motivation
The encoder for AlonzoScript uses tag 4 for Plutus V4, but the decoder did not handle tag 4, which can cause valid Plutus V4 scripts to be rejected when decoding.
Description
Add 4 -> decodeAnnPlutus SPlutusV4 to the decodeScript function in eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs so decoding matches the encoder's tags.
Testing
No automated tests were run for this trivial decoder fix.