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 to fail phase 1 validation on Byron addr #2617

Merged
merged 1 commit into from Feb 3, 2022

Conversation

JaredCorduan
Copy link
Contributor

@JaredCorduan JaredCorduan commented Jan 18, 2022

In Plutus V1, we do not pass Byron addresses to the transaction context which is passed to Plutus, they are silently omitted. This includes both transaction inputs and outputs. Starting at major protocol version 7, we want to instead cause a phase 1 validation error instead. This PR does exactly that.

Additionally, this PR introduces a policy change for the TxInfo creation code: any time it sees something it can't deal with it forces a phase 1 validation error instead of ignoring it. In particular, two new logic errors are introduced, one for unknown transaction inputs (this is a logic error since the ledger already checks this) and one for unknown redeemer pointers (also something that the ledger already checks).

Note that with the introduction of the babbage, it will probably not make sense for alonzo to have logic for Plutus V2. This is because the Plutus V2 context will probably contain a new field, namely reference inputs (as opposed to just combining them with the usual inputs). We can adapt accordingly when the time comes.

closes #2612

Copy link
Contributor

@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.

One recommendation, otherwise looks great.

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
@JaredCorduan JaredCorduan force-pushed the jc/plutus-v2-translation-errors branch from edf9776 to b27ea5a Compare February 3, 2022 18:19
@JaredCorduan
Copy link
Contributor Author

@lehins your suggestion was great, thanks!

If a byron address is present in a transaction, instead of being
silently ignored (as is done in plutus V1), it now causes a phase 1 validation
error.  There are also now phase 1 validation errors for the logic
errors in translation that we do not expect to ever happen.

This change will happen at the next hard fork, major protocol version 7,
for both plutus V1 and V2.
@JaredCorduan JaredCorduan force-pushed the jc/plutus-v2-translation-errors branch from b27ea5a to 79fb48d Compare February 3, 2022 21:13
@JaredCorduan JaredCorduan merged commit f2a783c into master Feb 3, 2022
@iohk-bors iohk-bors bot deleted the jc/plutus-v2-translation-errors branch February 3, 2022 22:25
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.

fail phase 1 validation on the presence of byron addresses
2 participants