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

Mint mining rewards token on self repair #402

Conversation

Neylix
Copy link
Member

@Neylix Neylix commented Jun 24, 2022

Description

This PR create a new scheduler for minting NFT rewards.
During self repair, all nodes store calculate and store the amount of burned fees during the past summary.
Then the scheduler trigger a node to create a mint rewards transaction.
The transaction is created with the amount of burned fees stored.
To avoid any corruption, we control during mining that the supply match the last burned feed amount and that there is no mint reward transaction since last schedule

Fixes #380

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tested on mutliple node to match the election.
Every minute at 30 sec a new transaction is generated with the good supply amount.
If trying to create a malicious transaction using the network pool seed, it returns an error

Add these test in test files

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Neylix Neylix marked this pull request as draft June 24, 2022 09:57
@Neylix Neylix force-pushed the Mint-mining-rewards-token-on-self-repair branch from 2684129 to ad8e6f3 Compare June 24, 2022 12:14
@ghost ghost marked this pull request as ready for review June 24, 2022 14:35
lib/archethic/reward.ex Outdated Show resolved Hide resolved
@ghost ghost added feature New feature request self repair Involve SelfRepair mechanism Fee labels Jun 27, 2022
@Neylix Neylix force-pushed the Mint-mining-rewards-token-on-self-repair branch from 9eef2eb to e0468bf Compare June 28, 2022 12:00
@Neylix Neylix force-pushed the Mint-mining-rewards-token-on-self-repair branch from c646fb1 to cd9a47c Compare July 25, 2022 10:41
@Neylix Neylix merged commit aaeeebd into archethic-foundation:develop Jul 26, 2022
@Neylix Neylix deleted the Mint-mining-rewards-token-on-self-repair branch July 26, 2022 07:27
@samuelmanzanera samuelmanzanera mentioned this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request Fee self repair Involve SelfRepair mechanism
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant