integrity hash not needed for all ref scripts #2878
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'
toscriptWitsNeeded'
, since that function is used for supplying the script witnesses that are needed. I also added a new function calledscriptsNeeded'
which returns the scripts that are needed for evaluation (this name matches the spec and the implementation now).