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

Committee expiration, validation and modification #3721

Merged
merged 6 commits into from
Sep 14, 2023

Conversation

teodanciu
Copy link
Contributor

@teodanciu teodanciu commented Sep 8, 2023

Description

Closes #3443

  • In Gov rule, check the NewCommittee action failing if :
    • the members to be removed are not part of the current committee (for this, the current committee from EnactState had to be added to GovEnv)
    • the expiration epoch of the new members are not exceeding the ppCommitteeTermLimitL, given the current epoch
  • Rename NewCommittee to UpdateCommittee and change its semantics to "update committee", rather than "replace committee". This means: in Enact rule: adding and removing members correctly, and in Gov rule: checking correctly the minimum committee size, considering the current committee.
  • Update CommitteeState when members get removed

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

@teodanciu teodanciu force-pushed the td/committee-improvements branch 3 times, most recently from 06c8a70 to 4d60277 Compare September 11, 2023 23:45
@teodanciu teodanciu marked this pull request as ready for review September 12, 2023 07:46
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 a very nice piece of work. Some fixes are needed, but overall looks great.

Also needs a rebase on master.

eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Enact.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs Outdated Show resolved Hide resolved
eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs Outdated Show resolved Hide resolved
@WhatisRT
Copy link
Contributor

NewCommittee shouldn't fail in GOV if the removed members aren't in the CC. The reason for this is simple: you only know the current EnactState, but not necessarily the one that this GA is actually supposed to apply to. You could argue that this logic should then go into ENACT, and I originally wanted to put it there, but I've removed it again. The reasoning is here: IntersectMBO/formal-ledger-specifications#206 (comment)

Long story short, I think we should only do this check if we keep track of in-flight GAs & validate new ones against the current state and the ones in the queue.

@lehins
Copy link
Contributor

lehins commented Sep 13, 2023

NewCommittee shouldn't fail in GOV if the removed members aren't in the CC. The reason for this is simple: you only know the current EnactState, but not necessarily the one that this GA is actually supposed to apply to.

@WhatisRT Yes, I brought up the same point here: #3721 (comment)

One more reason in favor of #3655

@teodanciu teodanciu force-pushed the td/committee-improvements branch 6 times, most recently from e996cfd to a3b1664 Compare September 14, 2023 02:38
so that we check against the relevant version of the current committe
otherwise fail with a new predicate failure
The udpated state is set both in vState and the govSnapshots of the
returned Epoch state
relative to the `committeeTermLimitL` pparam.
@teodanciu
Copy link
Contributor Author

teodanciu commented Sep 14, 2023

@lehins I think the latest covers the items that came up after the meeting yesterday, if you would like to take another look.

  • Prevent expiry epochNo less or equal to current epochNo in GOV
  • Accept expiry from the past on Enactment
  • Delay expiry that is too long
  • Prevent intersection of removed and added/updated in GOV

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.

Beautiful! 👍

@lehins lehins merged commit c3d0bea into master Sep 14, 2023
11 of 12 checks passed
@iohk-bors iohk-bors bot deleted the td/committee-improvements branch September 14, 2023 19:24
@lehins lehins changed the title Committee improvements Committee expiration, validation and modification Sep 18, 2023
lehins added a commit that referenced this pull request Oct 7, 2023
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.

Constitution Committee Member expiry
3 participants