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(2.11): burn fees #232

Open
wants to merge 3 commits into
base: release/v2.11
Choose a base branch
from
Open

feat(2.11): burn fees #232

wants to merge 3 commits into from

Conversation

emidev98
Copy link
Contributor

@emidev98 emidev98 commented Dec 14, 2023

This pull request, introduce a new module named x/feeburn with very specific scope: the proportional amount of gas fees that are not used by the validator to comput the transaction will be burn. The module also has a parameter which defines if the burning mechanism is enabled or disabled.

In the x/feeburn post handler it will check if the module is enabled, if the transaction fees are defined, if there is a limit for the gas and will use the gas meter to calculate what is the proportional amount of tokens to be burned with the following formula:

unusedFees = truncate((remainingGas / gasLimit) * amountOfFeeTokens) 

this formula applies to all the tokens from the transaction fee

The reasoning behind this implementation is that the user already paid for the full gas (gas_limit) but the validator didn't consumed all the gas to reach the limit, which makes it unfair to give the full amount of tokens to the validators.

At the same time will make it unfair to give the tokens back to the user because the user was already willing to spend that amount of tokens and by giving them back none will be responsible with the gas_limit, everyone will have the incentive to chose the maximum gas limit since the non-used gas-fee will be returned to them.

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (release/v2.10@e95834e). Click here to learn what that means.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##             release/v2.10     #232   +/-   ##
================================================
  Coverage                 ?   70.57%           
================================================
  Files                    ?       46           
  Lines                    ?     2168           
  Branches                 ?        0           
================================================
  Hits                     ?     1530           
  Misses                   ?      463           
  Partials                 ?      175           

@emidev98 emidev98 changed the title feat(v2.9): burn fees feat(v2.10): burn fees Jan 5, 2024
@emidev98 emidev98 changed the base branch from release/v2.9 to release/v2.10 January 5, 2024 08:14
@emidev98 emidev98 changed the base branch from release/v2.10 to release/v2.11 March 6, 2024 14:24
@emidev98 emidev98 changed the title feat(v2.10): burn fees feat(2.11): burn fees Mar 6, 2024
@delta185

This comment was marked as spam.

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.

4 participants