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

Disallow decoding a 0-value MultiAsset #3241

Merged
merged 5 commits into from
Feb 14, 2023

Conversation

aniketd
Copy link
Contributor

@aniketd aniketd commented Jan 9, 2023

Description

Closes #3240

Checklist

  • Commit sequence broadly makes sense
  • Commits have useful messages
  • New tests are added if needed and existing tests are updated
  • Any changes are noted in the changelog
  • Code is formatted with fourmolu (which can be run with scripts/fourmolize.sh
  • Self-reviewed the diff

@aniketd aniketd marked this pull request as ready for review January 9, 2023 18:26
@aniketd aniketd requested review from lehins and JaredCorduan January 9, 2023 18:28
@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch from 044102f to 67451da Compare January 9, 2023 19:28
@aniketd aniketd changed the title Prune 0-value multiassets before encoding Disallow decoding a 0-value MultiAsset Jan 9, 2023
@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch 4 times, most recently from c0f0187 to 46ed98a Compare January 11, 2023 14:29
@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch 2 times, most recently from 49f6d0c to 243a45a Compare January 12, 2023 13:41
Copy link
Collaborator

@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.

Here are my fly by comments on the testing

CHANGELOG.md Outdated Show resolved Hide resolved
@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch from 243a45a to 53206d5 Compare January 13, 2023 13:40
Copy link
Collaborator

@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.

Bunch of suggestions

@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch from 0c34a5d to 63c0794 Compare February 7, 2023 12:00
@aniketd aniketd requested a review from lehins February 7, 2023 12:01
Copy link
Collaborator

@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.

Beautiful

@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch 3 times, most recently from 4c97be1 to 711f0a3 Compare February 9, 2023 13:18
@JaredCorduan JaredCorduan force-pushed the aniketd/zero-quantity-assets-in-block-data branch from 711f0a3 to beee429 Compare February 9, 2023 22:04
Copy link
Collaborator

@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.

This is all good, however there is still a problem with OOM. We need to get to the bottom of it. It is too dangerous to merge a PR that has flaky tests like that. For all we know it could be the decoder that is doing something bad, although it is pretty unlikely.

@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch from c4e5dae to a3c299d Compare February 10, 2023 07:01
@aniketd aniketd requested a review from lehins February 10, 2023 07:01
@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch 2 times, most recently from c7391f3 to 3085a65 Compare February 10, 2023 10:33
@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch from 3085a65 to 21551bb Compare February 13, 2023 08:35
@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch from 21551bb to 7442412 Compare February 13, 2023 09:44
Copy link
Collaborator

@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.

Recent changes made generator from generating a lot to generating no multiassets for TxOuts at all. I do recommend trying out in ghci and see the affects of any changes to any generator you are doing. It is very easy to mess it up and cause poor generators to mask bugs in implementation

@aniketd aniketd force-pushed the aniketd/zero-quantity-assets-in-block-data branch from a2c4c57 to 2eb43d4 Compare February 14, 2023 17:32
@aniketd aniketd requested a review from lehins February 14, 2023 17:33
Copy link
Collaborator

@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.

One last change is needed otherwise this is great.

Awesome work @aniketd!

…erialisation/Generators.hs

Co-authored-by: Alexey Kuleshevich <alexey.kuleshevich@iohk.io>
@aniketd aniketd enabled auto-merge (squash) February 14, 2023 17:49
@aniketd aniketd disabled auto-merge February 14, 2023 18:01
@aniketd aniketd enabled auto-merge (squash) February 14, 2023 18:05
@aniketd aniketd merged commit b3ac435 into master Feb 14, 2023
@iohk-bors iohk-bors bot deleted the aniketd/zero-quantity-assets-in-block-data branch February 14, 2023 20:09
@JaredCorduan
Copy link
Contributor

yep, thanks again for all this work @aniketd ! it turned out to be much stickier than I would have guessed!

🙌

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.

Zero-Quantity Assets in Block Data
4 participants