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

fix!: balance bonding/unbonding module pools #122

Merged
merged 16 commits into from
Feb 22, 2024

Conversation

Reecepbcups
Copy link
Member

@Reecepbcups Reecepbcups commented Feb 20, 2024

issue:

  • When removing validators, tokens are moved to the notBondedPool, thus dropping the stakingkeeper.BondedRatio(). Consensus continues to be at 100%, but the app's calculation of it is off for BondedRatio.
  • This ONLY affects modules that use the BondedRatio, which would be used for economics & Governance if they are an admin

fix:

  • Re-calulate the bonded amount every time
  • Slash the validator 100% so the not_bonded pool does not get ANY tokens

@Reecepbcups Reecepbcups changed the title modify bonding/unbonding module pool values fix: balance bonding/unbonding module pools Feb 22, 2024
@Reecepbcups Reecepbcups changed the title fix: balance bonding/unbonding module pools fix!: balance bonding/unbonding module pools Feb 22, 2024
@Reecepbcups Reecepbcups marked this pull request as ready for review February 22, 2024 04:54
@@ -122,3 +132,47 @@ func (k Keeper) IsSenderValidator(ctx context.Context, sender string, expectedVa
func (k Keeper) Logger() log.Logger {
return k.logger
}

// updateBondedPoolPower updates the bonded pool to the correct power for the network.
func (k Keeper) UpdateBondedPoolPower(ctx context.Context) error {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably call this function more than needed. Only is called on a change to the validator set, so see this as fine given sets will be mostly static

@Reecepbcups Reecepbcups merged commit 1412ff8 into main Feb 22, 2024
6 checks passed
@Reecepbcups Reecepbcups deleted the reece/modify-bonding-pools-data branch February 22, 2024 15:37
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.

1 participant