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

Increase gas price WIP #176

Merged
merged 3 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CGPs/cgp-0066/mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"contract": "GasPriceMinimum",
"function": "setGasPriceMinimumFloor",
"args": [
"2200000000000000"
]
}
]

78 changes: 78 additions & 0 deletions CGPs/cgp-0066P.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
cgp: 66
title: Increase minimum gas threshold
date-created: 2022-11-21
author: @martinvol, @product-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 0066

### 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: ["220000000000000"]
- 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