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

Drep registration expiration fix #4547

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Conversation

teodanciu
Copy link
Contributor

Description

Registering a drep at a time when there were dormant epochs results in the drep expiry to be set greater than expected (ppDrepActivity + currentEpoch + vsNumDormantEpochs).

This PR changes this value, by setting the expiration using the same calculation as for UpdateDrep signal, namely: ppDrepActivity + currentEpoch - vsNumDormantEpochs, since the latter value is going to be added to the computation by CERTS,if there are proposals in the transaction.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • 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)
  • 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)
  • 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

cabal.project Outdated Show resolved Hide resolved
@teodanciu teodanciu force-pushed the td/drep-registration-expiration-fix branch 3 times, most recently from ed500c0 to f3e6c09 Compare August 14, 2024 13:41
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.

Very nice catch and investigation!

@teodanciu teodanciu force-pushed the td/drep-registration-expiration-fix branch 2 times, most recently from 417f7b7 to 358575d Compare August 16, 2024 11:28
to subtract the added number of dormant epochs from the total
@teodanciu teodanciu force-pushed the td/drep-registration-expiration-fix branch from 358575d to f668f36 Compare August 16, 2024 11:29
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.

Looks great. Thank you for finding and fixing this issue!

@lehins lehins merged commit 068c7a6 into master Aug 20, 2024
154 checks passed
@lehins lehins deleted the td/drep-registration-expiration-fix branch August 20, 2024 18:48
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.

3 participants