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 #757

Closed

Conversation

valeriyr
Copy link
Contributor

@valeriyr valeriyr commented Jun 19, 2024

Description of change

Changed

  • IOTA conservation checks were adapted to not apply to genesis and epoch change transactions, since those mint/burn tokens.

Outstanding TODOs Post-PR

  • Investigate whether to keep, change or remove IOTA Conservation checks in AuthorityState.
  • Consider emitting the minted or burned tokens from the IOTA supply in SystemEpochInfoEvent for informational purposes.
  • Check if we have to add additional checks in Builder::validate_output (in genesis-builder) for newly introduced fields.
  • IndexedEpochInfo still has stake subsidy related fields.
  • Remove stake subsidy related parameters from GenesisCeremonyParameters.
  • Fix calculate APY apis.

Outstanding PR tasks

  • Consider adding total supply check with changed distribution schedule,
    // unless already in place. Check distribution is correct
  • v0 has validator_target_reward: 0 set by default.

Open Questions

  • Do we have to modify iota-execution v0 analogously in addition to latest?

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

TODO

@valeriyr valeriyr added the sc-platform Issues related to the Smart Contract Platform group. label Jun 19, 2024
@valeriyr valeriyr self-assigned this Jun 19, 2024
@valeriyr valeriyr force-pushed the l1sc/issue-153-staking-reward-through-inflation branch from 426c484 to 9f2b264 Compare June 20, 2024 09:32
@valeriyr valeriyr force-pushed the l1sc/issue-153-staking-reward-through-inflation branch from 0486b8d to 55cd94c Compare June 21, 2024 08:33
PhilippGackstatter and others added 21 commits June 25, 2024 15:44
// Stake Subsidy parameters
pub stake_subsidy_start_epoch: u64,
pub stake_subsidy_initial_distribution_amount: u64,
pub stake_subsidy_period_length: u64,
pub stake_subsidy_decrease_rate: u16,

// Validator committee parameters
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could it be an easier option instead of removing the stake_subsidy related stuff, just to configure it not to generate rewards?

Choose a reason for hiding this comment

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

I don't think we intend to reuse the stake subsidy fund at any point in the future. So I think removing it is the best option, otherwise it becomes technical debt immediately. Or am I missing your point?

Copy link
Contributor Author

@valeriyr valeriyr Jul 1, 2024

Choose a reason for hiding this comment

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

I think you are right, we do not need it.

Removing this entity affects a lot of code and seems like it can be disabled, so I thought that it was better to remove it later as a separate task when we have inflation tests ready.

We also need to clean GenesisCeremonyParameters from the subsidy stuff.

Choose a reason for hiding this comment

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

Yeah, by now I already removed a lot of subsidy related stuff, but not all. If the current state works without removing more, we can remove the rest later - I already mentioned this in the PR description as a later task for which we should create issues.

Comment on lines -482 to +475
pub stake_subsidy_fund_nanos: u64,
pub funds_to_burn: u64,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Theoretically, we can get rid of this variable if we mint all token allocations on the Move layer.

The flow could be:

  1. "Burn" all migrated IOTA tokens that need to be allocated to validators/addresses.
  2. Initialize the IOTA TreasuryCap supply with something like this: TOTAL_SUPPLY - TOKEN_ALLOCATIONS.
  3. Mint allocations in the genesis::create function.

In the case of clean/vanilla genesis just mint tokens without initial supply.

@@ -79,7 +73,8 @@ module iota_system::genesis {
/// all the information we need in the system.
fun create(
iota_system_state_id: UID,
mut iota_supply: Balance<IOTA>,
iota_treasury_cap: TreasuryCap<IOTA>,
iota_supply: Balance<IOTA>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This balance also could be removed if we just mint the required tokens.

@valeriyr valeriyr closed this Jul 8, 2024
@valeriyr valeriyr deleted the l1sc/issue-153-staking-reward-through-inflation branch October 9, 2024 08:03
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
4 participants