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

Ensure Plutus scripts are not executed when other failures already exist #2847

Merged
merged 4 commits into from
Jun 6, 2022

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Jun 6, 2022

Fixes #2838

Expectation was that #2679 has fixed this issue, however there was a tricky oversight that did not fix it for nested rules, but only for the immediate ones. In other words if UTXOS rule whenFailureFree it will only react to predicate failure produced by that rule alone and not the one that invoked it, i.e. the UTXO rule. This PR fixes that oversight and fixes the test that discovered this issue.

It also enables this conditional execution for Babbage UTXOS rule only and not in the Alonzo, since this fix does not affect node syncing.

Jared Corduan and others added 4 commits June 3, 2022 17:12
The ValidationTagMismatch failure is unexpected since the transactions
fails phase 1 validate (MalformedScriptWitnesses).

The test can be reproduced inside
cardano-ledger/libs/cardano-ledger-test with:

TASTY_PATTERN="malformed script witness" cabal test
…e failure.

In #2679 we got an implmentation of conditional execution. The intent
was to prevent running some expensive predicate checks whenever there is
already at least one existing predicate failure. That PR did not account
for the fact that rules are executed in a recursive function and the
state that carries information about predicate failures is not shared
between each invocation. In other words, whenever one STS rule called
another (eg. UTXOW calling UTXO), the invoked STS rules would be
oblivious to previous failures.
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.

Thank you for resolving this @lehins , it looks great to me!

@lehins lehins merged commit 1cbf1fc into master Jun 6, 2022
@iohk-bors iohk-bors bot deleted the resolve-2838 branch June 6, 2022 17: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.

Well-formed script failure should prevent running phase 2 validation
2 participants