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

Gensis: Use proper inflation config and eligiblity ratio #960

Merged
merged 5 commits into from
Feb 2, 2023

Conversation

sea212
Copy link
Member

@sea212 sea212 commented Jan 30, 2023

Applies proper configuration for parachain-staking at genesis.
The inflation config initialization is adjusted in respect to one pr from moonbeam and the latest state of the code. The new code properly derives per-round inflation based on annual inflation and expected staking amounts. The total inflation based on expected staking amounts now looks like that:

  1. If 5% or less of the total supply are staked, the inflation caused by collation and delegation rewards is 2%
  2. Between 5% and 15%, the inflation [...] is 3.5%
  3. For more than 15%, the inflation [...] is 5%

The changes allow allow to configure different InflationConfig for each network. This won't affect the running networks and can be readjusted once a new network is about to be spawned.

Besides that, the EligibilityRatio is set to 1, meaning that only one collator is selected per block (unless he timeouts). Anything else can lead to network congestion.

@sea212 sea212 added the s:review-needed The pull request requires reviews label Jan 30, 2023
@sea212 sea212 self-assigned this Jan 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2023

Codecov Report

Merging #960 (aae9064) into main (4c7817e) will decrease coverage by 0.13%.
The diff coverage is 88.26%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #960      +/-   ##
==========================================
- Coverage   94.51%   94.39%   -0.13%     
==========================================
  Files          93       93              
  Lines       21148    21060      -88     
==========================================
- Hits        19989    19880     -109     
- Misses       1159     1180      +21     
Flag Coverage Δ
tests 94.39% <88.26%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
primitives/src/constants.rs 0.00% <ø> (ø)
zrml/court/src/tests.rs 99.20% <ø> (ø)
zrml/market-commons/src/lib.rs 93.42% <ø> (ø)
zrml/market-commons/src/tests.rs 100.00% <ø> (ø)
zrml/prediction-markets/src/mock.rs 78.98% <ø> (ø)
zrml/simple-disputes/src/tests.rs 100.00% <ø> (ø)
zrml/prediction-markets/src/lib.rs 90.47% <68.79%> (-1.90%) ⬇️
zrml/prediction-markets/src/migrations.rs 87.30% <96.11%> (-3.38%) ⬇️
primitives/src/market.rs 71.42% <100.00%> (+1.26%) ⬆️
zrml/prediction-markets/src/tests.rs 99.31% <100.00%> (+0.01%) ⬆️
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@vivekvpandya
Copy link
Contributor

Apart from few questions rest looks good.

sea212 and others added 2 commits January 31, 2023 11:40
vivekvpandya
vivekvpandya previously approved these changes Jan 31, 2023
@sea212 sea212 requested a review from Chralt98 January 31, 2023 11:31
@sea212
Copy link
Member Author

sea212 commented Jan 31, 2023

@Chralt98 seems like our CodeCov token is expired. Can you add a new one?

@Chralt98
Copy link
Member

Chralt98 commented Jan 31, 2023

I never added a CodeCov token. According to this https://docs.codecov.com/docs/frequently-asked-questions#where-is-the-repository-upload-token-found the token should not be required for public repositories.

https://github.com/codecov/codecov-action#usage

Unable to locate build via Github Actions API .. So it seems like that CodeCov is unable to find the Public Repository of Zeitgeist. Yeah a token would solve the problem. I try to add a secret token.

Added PR #962

Copy link
Member

@Chralt98 Chralt98 left a comment

Choose a reason for hiding this comment

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

Ok, this seems like a useful genesis config for the parachain-staking pallet (especially if we want to migrate over to Polkadot).

Currently this is the staking rate on Zeitgeist:

staking_rate = staking_amount / total_issuance

  • staking_amount: query from parachainStaking -> total
  • total_issuance: query from balances -> totalIssuance

staking_rate = 172185525432272240 / 1021933231948330118 approx. = 16,85%

So with the current inflation plan, we would get an annual inflation of 5% currently.

Although I am personally not a big fan of inflating a currency at all. But it is what it is.

node/src/chain_spec/mod.rs Show resolved Hide resolved
primitives/src/constants/ztg.rs Show resolved Hide resolved
Co-authored-by: Chralt <chralt.developer@gmail.com>
@sea212 sea212 added this to the v0.3.9 milestone Feb 1, 2023
@vivekvpandya vivekvpandya added s:accepted This pull request is ready for merge and removed s:review-needed The pull request requires reviews labels Feb 2, 2023
@vivekvpandya vivekvpandya merged commit d058605 into main Feb 2, 2023
@vivekvpandya vivekvpandya deleted the sea212-properly-initialize-parachain-staking branch February 2, 2023 05:16
@sea212 sea212 changed the title Gensis: User proper inflation config and eligiblity ratio Gensis: Use proper inflation config and eligiblity ratio Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:accepted This pull request is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants