Repository navigation
Conversation
alagiz
requested review from
bashash,
metalarm10,
okhlopiachyi,
yivo and
ysv
and removed request for
a team
October 7, 2026 16:09
Contributor
|
Hi @alagiz, thanks for coming back with this and for linking it to proposal 45. We've seen that the proposal passed, and we appreciate the effort you put into the reworked implementation and the tests. The PR is now under review on our side. We've approved the CI run and will share our feedback once the review is complete. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements mainnet governance proposal 45, which passed on 2026-08-22: a governance-configurable validator voting power cap. Supersedes #108.
max_voting_powerinx/customparamsStakingParams. Range 0.01 to 1. Default 1, which disables the cap.MsgUpdateStakingParams.x/wstakingenforces it onMsgDelegate,MsgBeginRedelegate(destination),MsgCancelUnbondingDelegationandMsgCreateValidator.How it works
The wrapped handler runs the original staking handler first, then reads the target validator's actual post-state voting power. If it exceeds the cap, the handler returns an error and the message is reverted.
tokens / total bondedtokens / (total bonded + tokens), its share if it joins the bonded setChecking post-state means staking validates the message first and the check uses exact token amounts, including redelegations between bonded and non-bonded validators.
Because enforcement is in the message server, it covers every path that routes through
MsgServiceRouter: normal txs, authz, gov, ICA and CosmWasm.The cap is preventative only. It never trims existing stake and never restricts undelegations. A validator above the cap keeps its stake, it just cannot receive more.
Upgrade
The migration is registered on the module, so it runs in any upgrade handler that calls
RunMigrations, whatever the upgrade name. A network that has already executed the v8 upgrade (testnet) needs a new upgrade for the migration to run. Until it runs, staking messages on that network fail.MsgUpdateStakingParamsis now also validated at execution time, so a params proposal submitted before the upgrade (withoutmax_voting_power) fails instead of storing an invalid value.Known limits
x/pse/keeper/distribute.go), not the message server, so it is not capped. It restakes rewards into the delegations delegators already chose.Tests
min_self_delegationis unchanged.This change is