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

Predicate failure for mismatched Voter GovAction #3718

Merged

Conversation

aniketd
Copy link
Contributor

@aniketd aniketd commented Sep 8, 2023

Description

Closes #3685

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 marked this pull request as ready for review September 8, 2023 11:04
@teodanciu
Copy link
Contributor

teodanciu commented Sep 8, 2023

If you want, you could squash the first 3 commits, to have a cleaner commit history, since they are a meaningful unit together

@lehins lehins mentioned this pull request Sep 9, 2023
9 tasks
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.

Implementation looks right, but it can be improved.

eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs Outdated Show resolved Hide resolved
@aniketd aniketd requested review from lehins and teodanciu September 11, 2023 14:44
@lehins lehins force-pushed the lehins/simplify-threshold branch from c342166 to 565e8ef Compare September 11, 2023 17:19
@aniketd aniketd changed the base branch from lehins/simplify-threshold to master September 11, 2023 17:54
@aniketd aniketd force-pushed the aniketd/invalid-voter-govaction-pair-predicate-failure branch from e55a48b to 1fa37e0 Compare September 11, 2023 17:56
@aniketd aniketd requested a review from lehins September 11, 2023 17:56
@aniketd aniketd changed the base branch from master to lehins/simplify-threshold September 11, 2023 17:57
@aniketd aniketd changed the base branch from lehins/simplify-threshold to master September 11, 2023 17:58
@lehins
Copy link
Collaborator

lehins commented Sep 11, 2023

Could you please rebase on master?

@lehins lehins force-pushed the aniketd/invalid-voter-govaction-pair-predicate-failure branch from 1fa37e0 to 8188a7d Compare September 11, 2023 21:47
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.

We'll discuss this PR in more detail tomorrow

eras/conway/impl/CHANGELOG.md Outdated Show resolved Hide resolved
@aniketd aniketd force-pushed the aniketd/invalid-voter-govaction-pair-predicate-failure branch from 87f6b36 to b7e1f4f Compare September 12, 2023 08:11
@aniketd aniketd requested a review from lehins September 12, 2023 08:11
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.

👍

@aniketd aniketd force-pushed the aniketd/invalid-voter-govaction-pair-predicate-failure branch from a5837d6 to 00461b7 Compare September 12, 2023 14:32
- Fix naming in `toPrevGovActionIds{Paris}` to `Pairs`
- Add new inhabitant to `ConwayGovPredFailure`:
  - `DisallowedVoters (Map (GovActionId c) (Voter c))`

In `ConwayGOV`, we make sure to introduce new data-structures and
references most minimally, by reusing the required ones between
`noSuchGovActions` and `checkVotesAreValid` tests. This is achieved by
first preparing a `govActionIdVotes`. @lehins is the wizard behind
conjuring these important optimizations.

The `NewConstitution` proposal test in `ConwayFeatures` needed to be
reduced to only using votes from DReps, i.e. votes from SPOs have been
removed as they were incorrect to begin with.

Co-authored-by: Alexey Kuleshevich <lehins@yandex.ru>
@aniketd aniketd force-pushed the aniketd/invalid-voter-govaction-pair-predicate-failure branch from 00461b7 to e73c242 Compare September 12, 2023 14:43
@aniketd aniketd enabled auto-merge (rebase) September 12, 2023 14:44
@aniketd aniketd merged commit abb70fd into master Sep 12, 2023
@iohk-bors iohk-bors bot deleted the aniketd/invalid-voter-govaction-pair-predicate-failure branch September 12, 2023 17:04
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.

Add PredicateFailure for invalid Voter-GovAction pairs
3 participants