Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pallet reward inflation #277

Merged
merged 60 commits into from
Oct 31, 2023
Merged

Add pallet reward inflation #277

merged 60 commits into from
Oct 31, 2023

Conversation

librelois
Copy link
Contributor

@librelois librelois commented Sep 28, 2023

Add a new pallet reward-inflation that handle new supply issuance and distribution.

The inflation rate is a proportion of the total supply per tanssi block.
We could also create new supply per relay block or per time duration, which could help to manage multi-block correctly, but that's left for a future PR.

TODO:

  • Adapt rust staking tests to the new Credit API
  • Create rust tests in the new pallet reward-inflation
  • Add inflation integration tests at the dancebox runtime level

@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

Master coverage: 71.00%
Coverage generated "Tue Oct 31 10:19:31 UTC 2023":
https://d3gkbsry1ehhqi.cloudfront.net/tanssi-coverage/pulls/277/index.html
Pull coverage: 71.68%

@girazoki
Copy link
Collaborator

@librelois can you merge master in so that its easier to review?

Base automatically changed from jeremy-staking-rewards-distribution to master October 10, 2023 08:51
@girazoki
Copy link
Collaborator

girazoki commented Oct 10, 2023

it would be good to know:

  • what happens when we reward an invulnerable? right now we are not handling differently as fart as I can tell, and it goes through pallet-staking. But the candidate does not have any delegations nor self delegations, its not in any pool, so my guess is that the reward distribution would transfer the rewardComission to the invulnerable and then the rest would stay in the staking pot.Is this right?

  • Alternative solutions:

    • Handle the invulnerable use-case differently by transferring directly to it
    • go still through pallet-staking, but burn the non rewardComission
    • Not reward invulnerables for now (maybe the safest?)

@tmpolaczyk
Copy link
Contributor

runtime/Cargo.toml is missing "pallet-inflation-rewards/try-runtime" under "try-runtime"

@girazoki
Copy link
Collaborator

runtime/Cargo.toml is missing "pallet-inflation-rewards/try-runtime" under "try-runtime"

we will add it, thanks!

librelois and others added 4 commits October 30, 2023 15:25
* test reward distribution

* ensure it still works even with key change

* find_map + fmt

* fmt

* remove dbg!
Copy link
Contributor Author

@librelois librelois left a comment

Choose a reason for hiding this comment

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

The changes looks good to me

@girazoki girazoki merged commit 84d3d97 into master Oct 31, 2023
23 checks passed
@girazoki girazoki deleted the elois-pallet-rewards branch October 31, 2023 14:32
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.

5 participants