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

Prevent state changes on phase2 failure #3633

Merged
merged 3 commits into from
Aug 10, 2023

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Aug 10, 2023

Description

This PR prevents phase1 validation and state changes when isValid = False This is necessary for correctness.

We should only validate the UTXO rules when transaction is marked as invalid, because we should only collect the collateral when phase2 is expected to fail.

There is no requirement for CERTS or GOV rule run validation if we only collect the collateral.

Also renames:

  • cgGov[L] -> cgGovActionsState[L]
  • cgRatify[L] -> cgRatifyState[L]

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

This is necessary for correctness. We should only validate the UTXO
rules when transaction is marked as invalid, because we should only
collect the collateral when phase2 is expected to fail.

There is also no requirement for `CERTS` or `GOV` rule run validation
if we only collect the collateral.
@lehins lehins force-pushed the lehins/prevent-state-changes-on-phase2-failure branch from b3e681c to 1d51541 Compare August 10, 2023 12:15
Copy link
Contributor

@Soupstraw Soupstraw left a comment

Choose a reason for hiding this comment

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

LGTM

@lehins lehins enabled auto-merge August 10, 2023 13:46
@lehins lehins merged commit b888c28 into master Aug 10, 2023
@iohk-bors iohk-bors bot deleted the lehins/prevent-state-changes-on-phase2-failure branch August 10, 2023 14:39
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