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

Plutus V2 in the Babbage Era #2661

Merged
merged 2 commits into from
Feb 24, 2022
Merged

Conversation

JaredCorduan
Copy link
Contributor

@JaredCorduan JaredCorduan commented Feb 18, 2022

The use of Plutus V2 is no longer tied to the protocol major version 7, but instead the Babbage era. Moreover, the transaction context for Plutus V2 now includes Babbage specific data, and V2 is now forbidden in the Alonzo era.

The txInfo function from the Alonzo era is now a class method, enabling different eras to have different behavior.

closes #2663

@@ -93,8 +93,6 @@ instance FromCBOR (Annotator Plutus.Data) where
instance ToCBOR Plutus.Data where
toCBOR = Cborg.encode

deriving anyclass instance NoThunks Plutus.BuiltinByteString
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems Plutus.BuiltinByteString no longer has a Generic instance to make this work. But it also does not appear to be needed anymore.

| TranslationLogicErrorDoubleDatum
| LanguageNotSupported
| InlineDatumsNotSupported
| ReferenceScriptsNotSupported
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that there is no worry of breaking predicate failure serialization here in the node-to-client protocol since these errors are never raised in the Alonzo era.

PlutusV1
(txEx unknownInput shelleyOutput emptyRedeemers)
TranslationLogicErrorInput
silentlyIgnore (txEx unknownInput shelleyOutput)
],
testGroup
"Plutus V2"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will need a new collection of tests in the Babbage era to replace these tests, but first we need the Babbage rules to be completed.

@JaredCorduan JaredCorduan force-pushed the jc/plutus-v2-now-exclusively-babbage branch from eb34593 to 2b6c79b Compare February 18, 2022 21:29
@JaredCorduan JaredCorduan force-pushed the jc/plutus-v2-now-exclusively-babbage branch 2 times, most recently from 826f420 to 3603038 Compare February 23, 2022 13:12
The use of Plutus V2 is no longer tied to the protocol major version 7,
but instead the Babbage era. Moreover, the transaction context for
Plutus V2 now includes Babbage specific data, and V2 is now forbidden in
the Alonzo era.

The txInfo function from the Alonzo era is now a class method, enabling
different eras to have different behavior.
@JaredCorduan JaredCorduan force-pushed the jc/plutus-v2-now-exclusively-babbage branch from 3603038 to efaca54 Compare February 23, 2022 20:54
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Couple minor suggestions, otherwise looks great

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Tools.hs Outdated Show resolved Hide resolved
eras/babbage/impl/src/Cardano/Ledger/Babbage/TxBody.hs Outdated Show resolved Hide resolved
Co-authored-by: Alexey Kuleshevich <alexey.kuleshevich@iohk.io>
@JaredCorduan JaredCorduan merged commit 7aae0d9 into master Feb 24, 2022
@iohk-bors iohk-bors bot deleted the jc/plutus-v2-now-exclusively-babbage branch February 24, 2022 01:48
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.

Adapt TxInfo to handle Babbage
2 participants