fix: make reward share payouts non-dilutive (treasury-based, not minted) - #8
Merged
Merged
Conversation
mintRewardShares() minted new shares against nothing on every payout, diluting PPS for all holders — a direct violation of the README's PPS monotonicity invariant. Unlike force-exit penalty and perf-fee (both capped on-chain), it had no cap at all. Renamed to payRewardShares() and switched from _mint() to transferring from a pre-funded rewardsTreasury, so payouts are non-dilutive by construction instead of just being an accepted exception. Reverts on an unset or underfunded treasury rather than falling back to minting. Also closes a seal-time gap this introduced: SystemSealer now requires rewardsTreasury to be set whenever rewardsPayoutManager is deployed. setRewardsTreasury() is blocked once the vault is sealed, so an unset treasury at seal time would otherwise be permanently unfixable.
…c seal-guard gap setRewardsTreasury existed on AdminModule but was never registered in SelectorLib/SelectorRegistry or IAdminModule, so the vault's delegatecall router had no route to it — the treasury could never actually be set, and payRewardShares() reverted "treasury=0" on every call. Separately, SystemSealer's pre-seal check trusted the caller-supplied config.rewardsTreasury struct field instead of the vault's real storage, so a proposer could pass a plausible non-zero address at seal time while the on-chain value stayed address(0) — permanently locking payRewardShares() since setRewardsTreasury() is blocked post-seal. Added a rewardsTreasury() getter on CoreVault and pointed both verifyAndSeal() and canSeal() at it. The existing "both set" seal POC test only set the config field, never the real value, so it was a false-positive proof of this exact gap; fixed it to call the real setter and added a regression test that fails without the getter fix.
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.
mintRewardShares() minted new shares against nothing on every payout, diluting PPS for all holders — a direct violation of the README's PPS monotonicity invariant. Unlike force-exit penalty and perf-fee (both capped on-chain), it had no cap at all.
Renamed to payRewardShares() and switched from _mint() to transferring from a pre-funded rewardsTreasury, so payouts are non-dilutive by construction instead of just being an accepted exception. Reverts on an unset or underfunded treasury rather than falling back to minting.
Also closes a seal-time gap this introduced: SystemSealer now requires rewardsTreasury to be set whenever rewardsPayoutManager is deployed. setRewardsTreasury() is blocked once the vault is sealed, so an unset treasury at seal time would otherwise be permanently unfixable.