-
Notifications
You must be signed in to change notification settings - Fork 77
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
Increase gas price WIP #176
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
cgp: 63 | ||
title: Increase minimum gas threshold | ||
date-created: 2022-11-21 | ||
author: Martin (@martinvol), Mathieu (@prdouct-matt) | ||
status: DRAFT | ||
discussions-to: https://forum.celo.org/t/increase-of-minimum-gas-fee/4616 | ||
governance-proposal-id: NA | ||
date-executed: NA | ||
--- | ||
## Overview | ||
|
||
CGP - Celo Governance Proposal 0063 | ||
|
||
### Definitions | ||
Let | ||
* gas_price_minimum = the minimal gas price for a given block = a function of (gas_price_minimum of last block, utilization of the last block, gas_price_minimum_(lower_bound)) | ||
* utilization of a block = (gas used in block) / (gas limit of block) | ||
* gas_price_minimum_(lower_bound) = a lower bound of the function gas_price_minimum beyond which it can never fall, even if blocks are empty | ||
* gas_price = the gas price specified by a user for a transaction | ||
* gas_used = the gas used by a transaction | ||
* base = gas of a transaction paid to community fund = gas_price_minimum * gas_used | ||
* tip = gas of a transaction paid to validators = gas_price * gas_used - base | ||
|
||
### Current Situation | ||
Currently, gas pricing on Celo roughly works as follows: | ||
* Every block a gas_price_minimum is defined (accessible through the GasPriceMinimum smart contract). If the block is full (more specifically: exceeds the density target, measured in gas), gas_price_minimum increases, if the block is empty, gas_price_minimum decreases (until gas_price_minimum_(lower_bound) is reached). These increases and decreases can be exponential, and thus the value of gas_price_minimum can change quickly. | ||
* In any given block, only transactions specifying a gas_price higher or equal than gas_price_minimum are valid | ||
* The gas paid by users is split between validators (tip, see exact definition above) and the community fund (base, see exact definition above) | ||
* A user only specifies gas_price, which then defines tip implicitly (whereas base is defined by the protocol every block) | ||
|
||
Note: this means gas on Celo behaves very similarly to gas on Ethereum, with the big difference that the tip is defined implicitly through the gas_price specified by a user and gas_price_minimum specified by the protocol. | ||
|
||
Actual gas fees are currently almost always at the gas_price_minimum_(lower_bound). They only rarely spike up from that. | ||
|
||
### Proposal Overview | ||
We propose to increase gas_price_minimum_(lower_bound) so that a simple ERC20 transaction costs around 0.1 cents or USD 0.001. | ||
|
||
Note: | ||
* This increase only impacts the base, meaning that the validator rewards from gas remain unaltered | ||
* We are confident this increase addresses the issues we discuss under _Rationale_, while at the same time the proposed fees are so low that they should not interfere with most use of the blockchain | ||
|
||
### Rationale | ||
There are three core reasons for this proposal: | ||
1) Ecosystem cost of transactions | ||
As the creator of a transaction, the main (marginal) cost of any transaction is the gas users have to pay to get it included in the blockchain. Currently, gas prices on Celo are very low, transactions are virtually free. | ||
|
||
The cost of a transaction for the wider Celo ecosystem has additional dimensions to it than the gas spent. Namely, every transaction needs to be processed by nodes and is stored forever in the Celo blockchain. Note that the processing needs to happen by _all full nodes_ and not validators only. While it does not have an effect on the blockchain today, this will have consequences in the long term. We realized we never accounted for this scenario when gas prices were calculated and proposed. | ||
|
||
Increasing the gas price would ensure that transactions which are processed achieve a higher minimum benefit (= the gas paid), which warrants the long-term cost for the overall ecosystem. | ||
|
||
2.1) Stability and security of the network 1 | ||
Low gas prices allow actors to spam the network at virtually no cost. Currently, it would take time until the gas_price_minimum increases substantially, to stop the attack. Increasing gas_price_minimum_(lower_bound) ensures that such an attack is a lot more costly from the get go, even if it is only sustained for a short period fo time. | ||
|
||
2.2) Stability and security of the network 2 | ||
An additional benefit is that higher minimum transaction fees can be leveraged to increase the health and security of the overall blockchain by linking the network token to gas spent (e.g., through a burn mechanism - see Future Changes) and, thus, render 51% or similar attacks more difficult. | ||
|
||
### Future Changes | ||
We plan to propose to burn a substantial amount of the fees collected through gas fees by the blockchain. | ||
|
||
## Proposed Changes | ||
|
||
|
||
1. Setting a new gas price minimum | ||
- Destination: GasPriceMinimum.setGasPriceMinimumFloor | ||
- Data: ["25000000000"] | ||
- Value: 0 | ||
|
||
## Verification | ||
|
||
`$ celocli governance:view --proposalID $proposalID` | ||
|
||
|
||
## Useful Links | ||
|
||
* Forum Post https://forum.celo.org/t/increase-of-minimum-gas-fee/4616 | ||
* Celo Docs: Gas Pricing https://docs.celo.org/protocol/transaction/gas-pricing | ||
* Chart: Gas price minimum on Celo https://datastudio.google.com/u/0/reporting/379ac465-6095-4e07-8648-7b3b3851a785/page/tEnnC/edit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"contract": "GasPriceMinimum", | ||
"function": "setGasPriceMinimumFloor", | ||
"args": [ | ||
"2200000000000000" | ||
] | ||
} | ||
] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.