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

integrity hash not needed for all ref scripts #2878

Merged
merged 2 commits into from Jun 20, 2022

Conversation

JaredCorduan
Copy link
Contributor

This fixes a bug found by @james-iohk. See IntersectMBO/cardano-node#4057 (comment)

If a reference script is not actually going to be run, we do not need to demand the corresponding language be a part of the script integrity hash. The problem stems from the txscripts function, which is almost never the function one wants (it gives you all the scripts associated with a tx, not the ones that are going to be evaluated).

This commit fixes the implementation, we must also fix the spec (cc @WhatisRT , when we fix this, we should definitely add @james-iohk to the list of contributors!).

Note that I renamed an era-generic helper function used in the property tests. I renamed scriptsNeeded' to scriptWitsNeeded', since that function is used for supplying the script witnesses that are needed. I also added a new function called scriptsNeeded' which returns the scripts that are needed for evaluation (this name matches the spec and the implementation now).

If a reference script is not actually going to be run, we do not need to
demand the corresponding langugae be a part of the script integrity
hash.

This commit fixes the implementation, we must also fix the spec.
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.

Looks good. Just one suggestion.

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxInfo.hs Outdated Show resolved Hide resolved
Co-authored-by: Alexey Kuleshevich <alexey.kuleshevich@iohk.io>
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.

None yet

2 participants