Skip to content

Commit 2359a5e

Browse files
authored
Add gas limit schedule (EIP-8261) (#5533)
1 parent 6b5f950 commit 2359a5e

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

‎configs/mainnet.yaml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ MIN_SLOTS_FOR_INCLUSION_LISTS_REQUESTS: 1
222222
MAX_TRANSACTIONS_BYTES_PER_INCLUSION_LIST: 8192
223223

224224

225-
# Blob Scheduling
225+
# Scheduling
226226
# ---------------------------------------------------------------
227227

228228
BLOB_SCHEDULE:
@@ -231,6 +231,8 @@ BLOB_SCHEDULE:
231231
- EPOCH: 419072 # January 7, 2026, 01:01:11am UTC
232232
MAX_BLOBS_PER_BLOCK: 21
233233

234+
GAS_LIMIT_SCHEDULE: []
235+
234236
# Fast Confirmation Rule
235237
# ---------------------------------------------------------------
236238
CONFIRMATION_BYZANTINE_THRESHOLD: 25

‎configs/minimal.yaml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,13 @@ MIN_SLOTS_FOR_INCLUSION_LISTS_REQUESTS: 1
219219
MAX_TRANSACTIONS_BYTES_PER_INCLUSION_LIST: 8192
220220

221221

222-
# Blob Scheduling
222+
# Scheduling
223223
# ---------------------------------------------------------------
224224

225225
BLOB_SCHEDULE: []
226226

227+
GAS_LIMIT_SCHEDULE: []
228+
227229
# Fast Confirmation Rule
228230
# ---------------------------------------------------------------
229231
CONFIRMATION_BYZANTINE_THRESHOLD: 25

‎specs/gloas/beacon-chain.md‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
- [Configuration](#configuration)
5757
- [Validator cycle](#validator-cycle)
5858
- [Time parameters](#time-parameters)
59+
- [Gas limit schedule](#gas-limit-schedule)
5960
- [Containers](#containers)
6061
- [New containers](#new-containers)
6162
- [`Builder`](#builder)
@@ -93,6 +94,7 @@
9394
- [Misc](#misc-2)
9495
- [New `convert_builder_index_to_validator_index`](#new-convert_builder_index_to_validator_index)
9596
- [New `convert_validator_index_to_builder_index`](#new-convert_validator_index_to_builder_index)
97+
- [New `get_scheduled_gas_limit`](#new-get_scheduled_gas_limit)
9698
- [New `get_pending_balance_to_withdraw_for_builder`](#new-get_pending_balance_to_withdraw_for_builder)
9799
- [New `can_builder_cover_bid`](#new-can_builder_cover_bid)
98100
- [New `compute_balance_weighted_selection`](#new-compute_balance_weighted_selection)
@@ -171,6 +173,8 @@ Gloas is a consensus-layer upgrade containing a number of features. Including:
171173
Exclude slashed validators from proposing
172174
- [EIP-8061](https://github.com/ethereum/EIPs/blob/01f15c37c64114c478cb1136e0a6966084e4db14/EIPS/eip-8061.md):
173175
Increase exit and consolidation churn
176+
- [EIP-8261](https://github.com/ethereum/EIPs/blob/f6b4668ef37612feba85aef151303f4100b79360/EIPS/eip-8261.md):
177+
Gas Limit Schedule
174178
- [EIP-8282](https://github.com/ethereum/EIPs/blob/de4c6f02c7bec4686762c55f8ab6abcf97a77d7d/EIPS/eip-8282.md):
175179
Builder Execution Requests
176180

@@ -614,6 +618,22 @@ same `Withdrawal` container can be used for validators and builders.
614618
| ----------------------------------- | -------------------- |
615619
| `MIN_BUILDER_WITHDRAWABILITY_DELAY` | `Epoch(2**6)` (= 64) |
616620

621+
### Gas limit schedule
622+
623+
*[New in Gloas:EIP8261]* This schedule defines the default and recommended
624+
maximum gas limit for a given epoch. The field is optional: clients that do not
625+
support it ignore it, and it introduces no new validity rules.
626+
627+
There MUST NOT exist multiple gas limit schedule entries with the same epoch
628+
value. The epoch value in each entry MUST be greater than or equal to
629+
`GLOAS_FORK_EPOCH`. The gas limit schedule entries SHOULD be sorted by epoch in
630+
ascending order. The gas limit schedule MAY be empty.
631+
632+
<!-- list-of-records:gas_limit_schedule -->
633+
634+
| Epoch | Gas Limit | Date |
635+
| ----: | --------: | ---: |
636+
617637
## Containers
618638

619639
### New containers
@@ -1080,6 +1100,19 @@ def convert_validator_index_to_builder_index(validator_index: ValidatorIndex) ->
10801100
return BuilderIndex(validator_index & ~BUILDER_INDEX_FLAG)
10811101
```
10821102

1103+
#### New `get_scheduled_gas_limit`
1104+
1105+
```python
1106+
def get_scheduled_gas_limit(epoch: Epoch) -> Optional[Uint64]:
1107+
"""
1108+
Return the scheduled gas limit at a given epoch, if any.
1109+
"""
1110+
for entry in sorted(GAS_LIMIT_SCHEDULE, key=lambda e: e["EPOCH"], reverse=True):
1111+
if epoch >= entry["EPOCH"]:
1112+
return entry["GAS_LIMIT"]
1113+
return None
1114+
```
1115+
10831116
#### New `get_pending_balance_to_withdraw_for_builder`
10841117

10851118
```python

0 commit comments

Comments
 (0)