feat: validator 30% of bonded tokens limit #1044
Open
danflo27 wants to merge 18 commits into
Open
Conversation
Introduce the ADR 1013 module parameter with proto, generated bindings, validation, and a dedicated sentinel error for cap violations.
Add cap checks for direct delegations and cap-aware refund routing in ReturnSlashedTokens, FeeRefund, and WithdrawTip with fallback scanning.
Project validator active-set changes and MsgUnjail re-entry so staking and authz messages are rejected when they would exceed the cap.
Set the 0.30 default during upgrade so existing chains enable the validator power cap alongside the reporter power cap.
Split bonded and unbonded refund amounts from the reporter keeper and move truncation dust to the bonded pool so mixed-origin slashes settle correctly.
Cover ante enforcement, keeper refund paths, and cap-enabled genesis fixtures; extend stake projection helpers and ICQ genesis stripping.
Small-validator devnets and shared test setup exceed 30% bonded stake, so default genesis and setup disable the cap unless tests opt back in.
Extract ValidatePowerShareParam, PowerShareEnabled, and ExceedsPowerShare so reporter and validator cap sites share one param/enforcement definition.
Replace validatorPowerCapState with explicit maxShare and projectedBondedDelta arguments and reuse shared types helpers for cap checks.
Move active-set projection and validator power share checks into a dedicated ante file and simplify unjail tracking for M2 isolation.
…uting Extract delegateToStakeAndEmit, route truncation dust in ReturnSlashedTokens, and move dust policy out of the dispute caller.
Document max_validator_power_share enforcement sites, design decisions, and module readme param coverage.
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.
Description
max_validator_power_share reporter module param (default 0.30) that blocks a single bonded validator from gaining active bonded stake above 30% of total bonded tokens in ante handler an reporter keeper
Related Issue
Fixes #
Type of Change
Testing
unit/integration/e2e
Checklist