Skip to content

feat(2.11): burn fees#232

Open
emidev98 wants to merge 3 commits intorelease/v2.11from
feat/v2.9/burn/fees
Open

feat(2.11): burn fees#232
emidev98 wants to merge 3 commits intorelease/v2.11from
feat/v2.9/burn/fees

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.

@emidev98 emidev98 force-pushed the feat/v2.9/burn/fees branch from 12cc695 to 292c270 Compare December 15, 2023 17:20
@codecov
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Attention: Patch coverage is 66.66667% with 16 lines in your changes missing coverage. Please review.

Please upload report for BASE (release/v2.11@e95834e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
x/feeburn/post/post.go 74.35% 5 Missing and 5 partials ⚠️
app/upgrade_handler.go 0.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##             release/v2.11     #232   +/-   ##
================================================
  Coverage                 ?   70.57%           
================================================
  Files                    ?       46           
  Lines                    ?     2168           
  Branches                 ?        0           
================================================
  Hits                     ?     1530           
  Misses                   ?      463           
  Partials                 ?      175           
Files with missing lines Coverage Δ
app/app.go 77.03% <100.00%> (ø)
app/modules.go 100.00% <100.00%> (ø)
app/upgrade_handler.go 71.11% <0.00%> (ø)
x/feeburn/post/post.go 74.35% <74.35%> (ø)
---- 🚨 Try these New Features:

@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 requested a review from freeelancer as a code owner 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

Comments