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 duplicate certs and proposals #3779

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Prevent duplicate certs and proposals #3779

merged 1 commit into from
Oct 23, 2023

Conversation

aniketd
Copy link
Contributor

@aniketd aniketd commented Oct 5, 2023

Description

Closes #3541 and #3540

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

@aniketd aniketd changed the title Aniketd/unique certs Prevent duplicate certs and proposals Oct 5, 2023
@aniketd aniketd marked this pull request as ready for review October 9, 2023 12:03
Copy link
Contributor

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

I haven't looked into the PR too deeply, but overall looks like a nice initial implementation.

Let's now make it more efficient by adding a Set to the OSet

libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
Copy link
Contributor

@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 looks great, some changes are still needed though

libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/TxBody.hs Outdated Show resolved Hide resolved
libs/cardano-data/CHANGELOG.md Outdated Show resolved Hide resolved
libs/cardano-data/cardano-data.cabal Outdated Show resolved Hide resolved
@aniketd
Copy link
Contributor Author

aniketd commented Oct 13, 2023

This is still missing some tests, like CBOR round trip and for fromStrictSeqDuplicates

Make sure to add some properties for these function since current implementation is not correct, but there are no tests for it

Copy link
Contributor

@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 looking much better 🙂

libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/TxBody.hs Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Show resolved Hide resolved
Copy link
Contributor

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

Looks awesome!!! 😄

eras/conway/test-suite/cddl-files/conway.cddl Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs Outdated Show resolved Hide resolved
eras/conway/test-suite/cddl-files/mock/extras.cddl Outdated Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Show resolved Hide resolved
libs/cardano-data/src/Data/OSet/Strict.hs Outdated Show resolved Hide resolved
libs/cardano-data/cardano-data.cabal Outdated Show resolved Hide resolved
Copy link
Contributor

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

Very nice!

@lehins lehins enabled auto-merge October 23, 2023 21:05
@lehins lehins merged commit debc791 into master Oct 23, 2023
10 of 14 checks passed
@iohk-bors iohk-bors bot deleted the aniketd/unique-certs branch October 23, 2023 21:06
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.

Prevent duplicate TxCerts in certsTxBodyL
3 participants