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

feat: Staking reward generation through inflation #1052

Merged
merged 94 commits into from
Jul 23, 2024
Merged

Conversation

valeriyr
Copy link
Contributor

@valeriyr valeriyr commented Jul 8, 2024

Description of change

This PR introduces a staking reward generation mechanism based on IOTA inflation/deflation.

The following changes were made:

  1. IotaTreasuryCap was introduced to protect the IOTA token from being minted/burnt by an unauthorized address. It is placed in the IotaSystemStateInnerV2 structure and can be used only by the system address in the iota_system::iota_system_state_inner module. Also, changed the executor conservation checks to make it possible to mint/burn tokens during epoch change transactions.
  2. The config parameters for staking were changed according to the table.
  3. Stake subsidy was disabled by changing the related parameters. Created an additional issue [Task (SC-Platform)]: Get rid of stake subsidies in Rust #1001.
  4. Disabled the storage fund reinvestment rate in iota-protocol-config. The logic is partially removed from the Move framework. Created an additional issue [Task (SC-Platform)]: Get rid of reinvestment in the codebase #1005.
  5. The storage_rebate_rate protocol parameter was set to 100%.
  6. The staking rewards leftovers are burnt instead of to be stored in storage_fund.
  7. Removed the part of the validator reward that was calculated based on the storage_fund balance.
  8. Introduced a constant target reward rate per epoch for validators and burn/ mint new tokens depending on computation_reward.
  9. Integrated the inflation changes with the genesis builder.

Links to any relevant issues

fixes #153

Type of change

Choose a type of change, and delete any options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How the change has been tested

Autotests.

valeriyr and others added 30 commits July 2, 2024 17:43
…iota-treasury-cap

[Task (SC-Platform)]: Retain the TreasuryCap of the IOTA token from genesis and place it into the system object.
…-parameters

feat(iota-types): staking params were changed according new requirements
…easury-cap

feat: implemented IotaTreasuryCap
* feat: Set disabling params for stake subsidies

* feat: Never pay out rewards from stake subsidies

* fix: Remove stake subsidy start epoch overwrite completely
…fund_reinvest_rate

feat(iota-protocol-config): disabling storage_fund_reinvest_rate
@lzpap
Copy link
Member

lzpap commented Jul 18, 2024

Blocked by #1173

valeriyr and others added 2 commits July 19, 2024 00:47
* fix(iota-core): fixing non_refundable_storage_fee related tests
cargo clippy fixes
cargo fmt
broken tests ignoring
@valeriyr
Copy link
Contributor Author

Looks good to me! We shall test if we can run iota-test-validator with the test snapshot coming from #1182.

Checked, the test validator works.

@valeriyr valeriyr requested review from miker83z and lzpap July 22, 2024 11:23
lzpap
lzpap previously approved these changes Jul 22, 2024
miker83z
miker83z previously approved these changes Jul 22, 2024
@valeriyr valeriyr dismissed stale reviews from miker83z and lzpap via 9f570e5 July 22, 2024 14:49
@valeriyr valeriyr requested review from lzpap and miker83z July 23, 2024 03:30
Copy link
Member

@lzpap lzpap left a comment

Choose a reason for hiding this comment

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

It was a big feature, thanks for coordinating it @valeriyr!

@lzpap lzpap merged commit d7da3bd into develop Jul 23, 2024
77 of 85 checks passed
@lzpap lzpap deleted the sc-platform/issue-153 branch July 23, 2024 07:59
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
feat: Staking reward generation through inflation
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
feat: Staking reward generation through inflation
alexsporn pushed a commit that referenced this pull request Sep 6, 2024
feat: Staking reward generation through inflation
alexsporn pushed a commit that referenced this pull request Sep 9, 2024
feat: Staking reward generation through inflation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task (L1SC)]: Staking reward generation through inflation
5 participants