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

Voting procedure map #3579

Merged
merged 4 commits into from
Jul 27, 2023
Merged

Voting procedure map #3579

merged 4 commits into from
Jul 27, 2023

Conversation

lehins
Copy link
Contributor

@lehins lehins commented Jul 26, 2023

Description

Fixes #3542

The fix is slightly different than in the ticket. The votingProceduresTxBodyL field is switched to a nested Map that is enforced to not have any empty Maps on the second level by the decoder. Arbitrary instance also reflects this invariant.

This approach reduced transaction size significantly when there many votes for the same Voter, which is expected to be a common case. Also simplifies rules in logic a bit.

Also bumps up versions for small-steps-test and cardano-ledger-shelley-test, since those provide support for GHC-9.6, but haven't been released yet.

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

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

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.

LGTM! 🙌

@lehins lehins force-pushed the lehins/voting-procedure-map branch 2 times, most recently from 9439aaa to 0e592d3 Compare July 27, 2023 18:54
This change is necessary in order to enforce uniqueness of votes per
transaction. It also simplifies the rules logic somewhat and
significantly reduces the size of transaction when there are many votes
by the same voter
@lehins lehins force-pushed the lehins/voting-procedure-map branch from 0e592d3 to d0989f0 Compare July 27, 2023 19:04
@lehins lehins merged commit b9754a1 into master Jul 27, 2023
11 of 12 checks passed
@iohk-bors iohk-bors bot deleted the lehins/voting-procedure-map branch July 27, 2023 21:56
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.

Convert votingProceduresTxBodyL to a Map
3 participants