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

Proposal deposits in SPO voting stake #4324

Merged
merged 11 commits into from
May 13, 2024

Conversation

aniketd
Copy link
Contributor

@aniketd aniketd commented May 7, 2024

Description

Resolves #4061

  • Add tests
  • Adjust all involved code commentary
  • Address review comments

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 force-pushed the aniketd/proposal-deposits-in-spo-voting-stake branch 2 times, most recently from cbc7ebb to 97d9375 Compare May 7, 2024 16:00
@lehins lehins force-pushed the aniketd/proposal-deposits-in-spo-voting-stake branch from 97d9375 to c77828b Compare May 7, 2024 21:59
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.

The solution is solid. There are a few minor improvements that we can make, other than that this PR looks great.

@aniketd aniketd force-pushed the aniketd/proposal-deposits-in-spo-voting-stake branch from c77828b to 21f4b2b Compare May 8, 2024 12:36
@aniketd aniketd requested a review from lehins May 8, 2024 12:37
@aniketd aniketd force-pushed the aniketd/proposal-deposits-in-spo-voting-stake branch from 425a7e7 to 7a877b2 Compare May 9, 2024 12:09
@aniketd aniketd requested a review from lehins May 10, 2024 15:45
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.

PR looks great. Just one comment that we've discussed on a call

* Add individualPoolStakeCoin field to IndividualPoolStake as numerator.
* Add pdTotal field to PoolDistr as denominator.
* Change calculatePoolDistr' to include the numerator and denominator.
* Update computeDRepDistr to include updating PoolDistr numerator and
denominator with proposal-deposits.
* Update spoAcceptedRatio to calculate in terms of the numerator/
denominator pair instead of Rational.
aniketd and others added 5 commits May 13, 2024 19:57
We reset the newly added fields: individualTotalPoolStake and
pdTotalActiveStake, in the ledger state that testCHAINEXample compares
with checkTrace, so as to not interfere with the chained ledger states
in these tests.
The prop_RATIFY test revealed a bug in the current implementation of
spoAcceptedRatio that constructs a `Ratio`  out of the numerator and
denominator of the PoolDistr. We use the same method of defaulting it to
unit if it is zero.
@aniketd aniketd force-pushed the aniketd/proposal-deposits-in-spo-voting-stake branch from 196f4c1 to 00a0970 Compare May 13, 2024 14:27
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!

@aniketd aniketd force-pushed the aniketd/proposal-deposits-in-spo-voting-stake branch from 9920384 to 0a1cc62 Compare May 13, 2024 16:14
@aniketd aniketd merged commit 14c8394 into master May 13, 2024
125 checks passed
@aniketd aniketd deleted the aniketd/proposal-deposits-in-spo-voting-stake branch May 13, 2024 19:16
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.

Ensure that proposal deposit does not reduce voting power
3 participants