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

Add EIP: Add Controlled Gas Limit Increase Strategy #8933

Merged
merged 39 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
20462cc
save
Giulio2002 Oct 6, 2024
2c09c76
save
Giulio2002 Oct 6, 2024
2b0bc14
save
Giulio2002 Oct 6, 2024
eff2981
save
Giulio2002 Oct 6, 2024
e11d563
save
Giulio2002 Oct 6, 2024
19bd32d
save
Giulio2002 Oct 6, 2024
180a82a
save
Giulio2002 Oct 6, 2024
3e4d231
save
Giulio2002 Oct 6, 2024
3bde203
save
Giulio2002 Oct 6, 2024
c87de14
ops
Giulio2002 Oct 6, 2024
6304e66
ops
Giulio2002 Oct 6, 2024
5eadb64
ops
Giulio2002 Oct 6, 2024
da5bc90
ops
Giulio2002 Oct 6, 2024
13d702e
ops
Giulio2002 Oct 6, 2024
e6eafb8
fix lint
Giulio2002 Oct 6, 2024
ea0e61b
fix lint
Giulio2002 Oct 6, 2024
71f6d2a
fix lint
Giulio2002 Oct 6, 2024
2ae0f0a
fix lint
Giulio2002 Oct 6, 2024
d56d238
fix lint
Giulio2002 Oct 6, 2024
0fd9dee
fix lint
Giulio2002 Oct 6, 2024
8bea505
fix lint
Giulio2002 Oct 6, 2024
b06b52d
fix lint
Giulio2002 Oct 7, 2024
ef88692
fix
Giulio2002 Oct 7, 2024
8a18a68
save
Giulio2002 Oct 7, 2024
a3fb331
save
Giulio2002 Oct 7, 2024
b400115
save
Giulio2002 Oct 7, 2024
eb6e83c
save
Giulio2002 Oct 7, 2024
1e2b04e
save
Giulio2002 Oct 7, 2024
c2852e6
Update EIPS/eip-7783.md
Giulio2002 Oct 7, 2024
46c8143
save
Giulio2002 Oct 9, 2024
ca563f3
save
Giulio2002 Oct 9, 2024
1cdb1f9
save
Giulio2002 Oct 9, 2024
ce7ae0f
save
Giulio2002 Oct 10, 2024
30ac593
Update EIPS/eip-7783.md
Giulio2002 Oct 10, 2024
4fd3f44
Update EIPS/eip-7783.md
Giulio2002 Oct 14, 2024
13d8bae
Update EIPS/eip-7783.md
Giulio2002 Oct 14, 2024
e98e237
save
Giulio2002 Oct 14, 2024
ee9613c
save
Giulio2002 Oct 14, 2024
cc8bdb8
save
Giulio2002 Oct 14, 2024
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
92 changes: 92 additions & 0 deletions EIPS/eip-7783.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
eip: 7783
title: Add Controlled Gas Limit Increase Strategy
description: Adds a controlled gas limit increase strategy.
author: Giulio Rebuffo (@Giulio2002)
discussions-to: https://ethereum-magicians.org/t/eip-7783-add-controlled-gas-limit-increase-strategy/21282
status: Draft
type: Informational
created: 2024-10-06
---

This proposal describes the introduction in clients of a controlled gas limit increase strategy to determine the gas limit of a specific block and set as default with conservative parameters, while keeping the possibility to change it in the future to a fixed value.

## **Abstract**

The EIP proposes the introduction of a new gas limit management mechanism that automatically increases the block gas limit over time. The incremental growth is controlled by a fixed rate, ensuring predictable network scaling while preventing sudden surges in block sizes. This strategy is meant to be used as a default setting, with the option to switch to a fixed gas limit if needed (or different parameters).

## **Motivation**

### **Predictable Gas Limit Growth**

- **Current Issue:**
- The Ethereum network faces increasing demand, but changes to the gas limit are often manually adjusted by miners or validators based on their preferences, which may cause unpredictable block sizes and network performance issues.

- **Need for Change:**
- A systematic and predictable increase of the gas limit will help scale the network while giving the ecosystem time to adjust to larger block sizes, without needing to rely on ad hoc decisions by network participants.

### **Gradual Increase with Deactivation Safeguard**

- **Controlled Growth:**
- Instead of sudden or unpredictable changes, this EIP proposes incremental gas limit increases over a specified amount of time, ensuring a smooth transition to higher transaction throughput, while still keeping the governance of the gas limit in the hand of the community.

- **Automatic Deactivation:**
- A safeguard deactivation block will halt the increase after some specified time, preventing the gas Limit from growing indefinitely and allowing the community to reassess the network's needs.

## **Specification**

### **Incremental Gas Limit Increase Strategy**

Add a new "Gas Limit" selection strategy that takes in Block Number `N` and spits out the Gas Limit `GL` for that block. The strategy is as follows:

- The gas limit `GL_t` at block `t` is calculated as:

```python
def compute_gas_limit(blockNum: int, blockNumStart: int, initialGasLimit: int, r: int, gasLimitCap: int) -> int:
if blockNum < blockNumStart:
return initialGasLimit
else:
return min(gasLimitCap, initialGasLimit + r * (blockNum - blockNumStart))
```

Where:

- `blockNum` is the block number for which the gas limit is being calculated.
- `blockNumStart` is the block number at which the gas limit increase starts.
- `initialGasLimit` is the initial gas limit at block `blockNumStart`.
- `r` is the rate at which the gas limit increases per block.
- `gasLimitCap` is the maximum gas limit that can be reached.

If we set `blockNumStart` to the current block number, `initialGasLimit` to the current gas limit (`30_000_000`), `r` to 6, and `gasLimitCap` to `60_000_000`, the gas limit will increase by 6 gas per block for two years, reaching 30 million gas at the end of a $\approx$ 2 years period.
The result of `compute_gas_limit` will be the gas limit aimed by the proposer for the block `blockNum`. none of this is enforced at the protocol level, and the proposer needs to still follow protocol rules related to the gas limit.

## **Rationale**

### **Predictable Growth**

- **Systematic Adjustment:**
- The gradual increase avoids sudden surges in gas limit that could destabilize the network. Instead, it provides a smooth transition, giving the ecosystem time to adapt to larger block sizes.

### **Controlled Limit with Deactivation Block**

- **Automatic Safeguard:**
- The inclusion of a deactivation block ensures that the gas limit does not increase indefinitely, preventing potential negative impacts on network performance beyond the planned growth.


- **Community Consensus:**
- The deactivation block serves only as a checkpoint for the community to evaluate the impact of the gas limit increase, however, in the two-year period, the community can decide to halt the increase at any time and can also switch to a fixed gas limit if needed.

## **Backwards Compatibility**

**No Hard Fork Required**

## **Security Considerations**


- The controlled gas limit increase strategy is designed to prevent sudden changes that could lead to network instability or security vulnerabilities.
- The fact that validators can re-adjust the gas limit in case of a DOS attack or other issues, makes the network more secure than to just increasing the gas limit manually in a cliff-like manner.

## **Copyright**

Copyright and related rights waived via CC0 1.0 Universal.

Loading