Skip to content

[Backport release/v6.x] Feat/reporter power cap#1039

Merged
brendaloya merged 1 commit into
release/v6.xfrom
backport-1033-to-release/v6.x
Jun 12, 2026
Merged

[Backport release/v6.x] Feat/reporter power cap#1039
brendaloya merged 1 commit into
release/v6.xfrom
backport-1033-to-release/v6.x

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport a9c79bc from #1033.

* fix: refund dispute fees from round 1 amount, burn later round fees

* test: clean up multi-round dispute integration tests

Dedupe the multi-round dispute test scaffolding ahead of the
multi-round fee fixes: fold the from-bond round-1 starter into a
payFromBond param, route round-1 setup through markRoundUnresolved,
add proposeRound/fundedDisputer/seedTipper helpers for the repeated
proposal and account blocks, and make setupDisputedReporter delegate
to the multi-reporter variant. Replace the tipper validator account
with a plain funded account (only its tips carry vote power), make
vote execution deterministic instead of conditional, and drop debug
prints and review-process commentary from test comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: do not track later-round dispute fees as refundable first-round stake

AddDisputeRound paid escalation-round fees with isFirstRound=true, so a
later round paid from bond appended its stake origins to the
FeePaidFromStake tracker under the dispute's shared hash id. FeeRefund
distributes the refundable round-1 fee pro-rata over that tracker, so a
later-round bond payer could siphon part of the round-1 payer's refund
(or leave a stale tracker when round 1 was account-funded). Later-round
fees are fully consumed and never refunded, so pass isFirstRound=false.

Adds regression tests covering account-funded and bond-funded round 1,
the refund split after an INVALID resolution, and max-round escalation
where every later round pays from bond.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: burn later-round fee pool when no claim-eligible voters exist

ExecuteVote reserved half of BurnAmount as a voter reward whenever any
vote group participated, including the team. CalculateReward only pays
user and reporter voters, so a dispute resolved by team vote alone
reserved an unclaimable balance in the dispute module forever; with
later-round fees now accumulating into BurnAmount, that stranded amount
grows with every escalation round.

Gate the voter reward on claim-eligible participation instead: rename
GetSumOfAllGroupVotesAllRounds to GetSumOfUserAndReporterVotesAllRounds
and drop team votes from the sum, so team-only resolutions burn the
entire consumed fee pool.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: resolve first-round fee payer in ClaimableDisputeRewards

DisputeFeePayer records are only ever written under the round-1 dispute
id, and WithdrawFeeRefund resolves PrevDisputeIds[0] before loading
them. The ClaimableDisputeRewards query looked the payer up under the
requested dispute id instead, so querying the final resolved round of a
multi-round dispute reported a zero fee refund that the transaction
path would actually pay. Resolve the first-round id in the query the
same way the transaction does.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: report previous-round voter rewards in ClaimableDisputeRewards

The query only called CalculateReward when the address had a Voter
record under the requested dispute id, but ClaimReward has no such
gate: CalculateReward scans every round via PrevDisputeIds, so an
address that voted only in an earlier round of a multi-round dispute
has a real claim that the query reported as zero. Use the final-round
Voter record solely for the RewardClaimed flag (matching where
ClaimReward stores it) and compute the reward regardless; CalculateReward
already yields zero for non-participants.

Includes a combined regression test where one address holds both a
round-1 fee refund and a previous-round-only voter reward, queried by
the final dispute id and then withdrawn through both transaction paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs: correct round-1 fee split in ADR1011 and trim blank line at EOF

Round 1's 5% does not all go to the burn pool: execution burns half and
reserves half as the voter reward, and burns all of it when no users or
reporters voted. Also remove the trailing blank line flagged by
git diff --check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: preserve previous-round voter rewards

* feat: cap reporter power below 30% of total bonded stake (ADR 1012)

Add max_reporter_power_share reporter param (default 0.30, >=1 disables)
and enforce it in the TrackStakeChangesDecorator: transactions that would
put any reporter's projected potential stake at or above the cap fraction
of total bonded tokens are rejected. Covers CreateReporter, SelectReporter,
SwitchReporter, and staking messages that grow a selector's bonded stake,
including same-tx combinations. Potential stake counts dispute-locked
selectors and pending incoming switches, and excludes selectors pending a
switch away. The v6.1.7 upgrade handler activates the default on existing
chains; small devnet/e2e fixtures disable the cap in genesis.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat: disable interchain accounts, keep interchain queries

ICA-executed messages reach module handlers through the MsgServiceRouter
without the ante chain, and mainnet's ICA host allowlist was ["*"],
letting interchain accounts bypass every ante-enforced limit: the 5%
stake tracker, the 30% delegator cap, max delegations, and the new
reporter power cap. The v6.1.7 upgrade disables the ICA host (empty
allowlist) and controller, and the app default genesis ships both
disabled so new chains start safe. The async-ICQ module serves queries
only and stays enabled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* adr note for 30% hardcode vs param

* e2e test setups

* lint, upgrade handler

* ibc branch build fix, bump heighliner go version

---------

Co-authored-by: akrem <71235284+akremstudy@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit a9c79bc)
@brendaloya brendaloya merged commit 8df186a into release/v6.x Jun 12, 2026
0 of 3 checks passed
@brendaloya brendaloya deleted the backport-1033-to-release/v6.x branch June 12, 2026 21:13
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.

2 participants