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

AddedPlutusScriptAPI, evalScripts, TxInfo, valContext etc. #2192

Merged
merged 12 commits into from
Mar 29, 2021

Conversation

TimSheard
Copy link
Contributor

Added the module Cardano.Ledger.Alonzo.TxInfo
Had to add SafeToHash and HashAnnotated instances for Alonxo Tx.

This is an attempt to write the translation from Alonzo Tx to Plutus TxInfo.
There are many discontinuites between what the Ledger understands as a Tx and the information that Plutus wants included in TxInfo. This start isolates some of those differences, and is meant to start a discussion about what shoud really be in TxInfo on the Plutus side.

The next step, nce that is straightened out, is to embed TxInfo into Plutus Data.

@TimSheard TimSheard marked this pull request as draft March 20, 2021 00:47
@michaelpj
Copy link
Contributor

@j-mueller can you have a look at this too.

Copy link
Contributor

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

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

Looks good so far!

alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
P.TxInfo
transTx tx =
P.TxInfo
(map transTxIn (Set.toList allinputs))
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible non-determinism alert! I guess it's probably fine... do we guarantee that the Ord instance on inputs is stable?

alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
@TimSheard TimSheard changed the title WIP began writing transTx:: Tx era -> Plutus.TxInfo AddedPlutusScriptAPI, evalScripts, TxInfo, valContext etc. Mar 26, 2021
@TimSheard
Copy link
Contributor Author

We are past the WIP stage. I think we should merge, and workout the FakePlutus later.

@JaredCorduan JaredCorduan marked this pull request as ready for review March 26, 2021 18:45
Copy link
Contributor

@JaredCorduan JaredCorduan left a comment

Choose a reason for hiding this comment

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

other than the few things we've discussed on the call that we still want to tweak, looks good to me!

alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/PlutusScriptApi.hs Outdated Show resolved Hide resolved
alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
Added the module Cardano.Ledger.Alonzo.TxInfo
Had to add SafeToHash and HashAnnotated instances for Alonxo Tx.
This module lets us experiment with small changes to the Plutus TxINfo and associated types.
We made a few changes to make the structure more closely align with the actual Ledger code.
Got close to completion on translating a Alonzo.Tx into a FakePlutus.TxInfo. Next step
mke the changes in FakePlutus real in Plutus.
DCert, Wdrls, and others
Worked out how to actually call plutus in eval_scripts.
Renamed module Caradano.Ledger.Alonzo.RunPlutus to Caradano.Ledger.Alonzo.PlutusScriptApi.
Completed the ValidateScript instance for Alonzo, and the evalScripts function.
Cleaned up the Utxos modue, that was way over constrained.
Renamed NativeScript constructor of Script to TimelockScript.
@JaredCorduan JaredCorduan merged commit cd45d79 into master Mar 29, 2021
@iohk-bors iohk-bors bot deleted the ts-txinfo-start branch March 29, 2021 14:45
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.

4 participants