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

Fix burning tokens predicate failure #4288

Merged
merged 7 commits into from
Apr 24, 2024

Conversation

lehins
Copy link
Collaborator

@lehins lehins commented Apr 23, 2024

Description

Problem description

When transaction does not balance out in presence of burning the user submitting the transaction will get DeserialiseFailure 56 "expected word" deserialization failure instead of ValueNotConservedUTxO predicate failure

Fixes in this PR

  • ValueNotConservedUTxO cannot handle negative values, therefore we need to fix how this failure is being reported. Instead of reporting negative values for burned tokens in consumed, we change it to report it as positive in the produced.

  • Ensure every predicate failure produced in the Imp test is also tested for serialization issues.

  • Reorganize a bit how Imp tests are being invoked. This PR changes it in such a way that current era is responsible for calling imp tests from the previous era. This ensures that we are not gonna forget to run tests from some previous era in a new era.

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

@lehins lehins force-pushed the lehins/fix-burning-tokens-predicate-failure branch 2 times, most recently from d362b95 to bf44e79 Compare April 24, 2024 01:34
@lehins lehins marked this pull request as ready for review April 24, 2024 02:01
@lehins lehins requested review from teodanciu and aniketd April 24, 2024 02:01
Copy link
Contributor

@aniketd aniketd left a comment

Choose a reason for hiding this comment

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

Excellent! 🙇 🙌

@lehins lehins force-pushed the lehins/fix-burning-tokens-predicate-failure branch 3 times, most recently from f0095b9 to df47dc4 Compare April 24, 2024 19:51
@lehins lehins enabled auto-merge April 24, 2024 19:52
@lehins lehins force-pushed the lehins/fix-burning-tokens-predicate-failure branch 2 times, most recently from c7341ef to eb1616a Compare April 24, 2024 19:53
lehins added 7 commits April 24, 2024 15:22
Reorganize a bit how Imp tests are being invoked.
This PR changes it in such a way that current era is responsible
for calling imp tests from the previous era. This ensures that
we are not gonna forget to run tests from some previous era in a new era.
`ValueNotConservedUTxO` cannot handle negative values, therefore
we need to fix how this failure is being reported. Instead of
reporting negative values for burned tokens in consumed, we
change it to report it as positive in the produced.

In order to implement above fix optional mapping, filtering
and pruning for MultiAsset has been added as well.
@lehins lehins force-pushed the lehins/fix-burning-tokens-predicate-failure branch from eb1616a to 7d55419 Compare April 24, 2024 21:22
@lehins lehins merged commit 5e00951 into master Apr 24, 2024
16 checks passed
@lehins lehins deleted the lehins/fix-burning-tokens-predicate-failure branch April 24, 2024 23:34
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.

2 participants