Skip to content

staking inflation rewards test#150

Merged
ipapandinas merged 4 commits intomasterfrom
feat/staking-inflation-rewards
Sep 26, 2025
Merged

staking inflation rewards test#150
ipapandinas merged 4 commits intomasterfrom
feat/staking-inflation-rewards

Conversation

@ipapandinas
Copy link
Contributor

This PR adds a minimal test to ensure that staking reward payouts, if any exist, are correctly distributed based on the new decay factor introduced in AstarNetwork/Astar#1536

Copy link
Contributor

@PierreOssun PierreOssun left a comment

Choose a reason for hiding this comment

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

LGTM

@ipapandinas ipapandinas merged commit ae83311 into master Sep 26, 2025
1 check passed
@ipapandinas ipapandinas deleted the feat/staking-inflation-rewards branch September 26, 2025 07:50
Comment on lines +24 to +33
const inflationConfig = (await astar.api.query.inflation.activeInflationConfig()).toJSON() as Record<string, any>
const noRewardsConfig = {
...inflationConfig,
collatorRewardPerBlock: 0n,
treasuryRewardPerBlock: 0n,
dappRewardPoolPerEra: 0n,
baseStakerRewardPoolPerEra: 0n,
adjustableStakerRewardPoolPerEra: 0n,
bonusRewardPoolPerPeriod: 0n,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@ipapandinas what's the point of this modification?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make snapshots more deterministic. Advancing to the next era emits rewards, which affects total issuance and the tier thresholds. With potential future decayed emissions, this would vary more and make snapshots unpredictable. I am controlling the inputs to isolate and test the tier threshold calculations directly. Another option is to make the assertions more lenient for tier thresholds.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, I see.
To keep it same as it was before decay, only the decay could be configured to be 1.00 instead.

Personally, I don't prefer this since it is not a scenario you'd expect in the wild, and this is an e2e test. But ok.

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.

3 participants