Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADR - untranslatable data in script context
- Loading branch information
Jared Corduan
committed
Dec 2, 2022
1 parent
289e1a3
commit 4dab4ac
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
docs/adr/2022-12-05_004-untranslatable-data-in-script-context.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
slug: 4 | ||
title: | | ||
4. Untranslatable data in script context | ||
authors: [Jared Corduan] | ||
tags: [Accepted] | ||
--- | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
Sometimes there is data in a transaction which a Plutus script author might | ||
expect to be present in the script context, but which we do not want to translate. | ||
One example is the legacy Byron addresses. | ||
Another example is the features which were added to the Babbage ledger era | ||
(such as inline datums) which are not a part of the Plutus V1 script context since they did not | ||
exist when Plutus V1 was released. | ||
|
||
|
||
There are basically two options for dealing with such information: | ||
1. Silently ignore parts of the relevant script context during the translation. | ||
2. Force a phase 1 validation error. | ||
|
||
## Decision | ||
|
||
We chose option 2, since option 1 could lead to surprising and unfortunate mistakes by | ||
script authors. | ||
|
||
## Consequences | ||
|
||
Scripts will fail phase 1 validation if used in a transaction that contains data not available | ||
for the corresponding script context. | ||
For example, one cannot spend a Plutus V1 output and pay to a Plutus V2 output with | ||
inline datum at the same time. | ||
|
||
See this test suite for the list of untranslatable data at the time of the creation of this ADR: | ||
|
||
https://github.com/input-output-hk/cardano-ledger/blob/064acb8e7ab7b2aeef138ec0c821f8c5f1402621/eras/babbage/test-suite/test/Test/Cardano/Ledger/Babbage/TxInfo.hs#L190-L193 |