Skip to content

Add EIP: RLP Execution Block Size Limit #9658

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

Merged
merged 17 commits into from
May 6, 2025

Conversation

Giulio2002
Copy link
Contributor

ATTENTION: ERC-RELATED PULL REQUESTS NOW OCCUR IN ETHEREUM/ERCS

--

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md

We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

@Giulio2002 Giulio2002 requested a review from eth-bot as a code owner April 17, 2025 20:46
@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-core labels Apr 17, 2025
@eth-bot
Copy link
Collaborator

eth-bot commented Apr 17, 2025

✅ All reviewers have approved.

@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels Apr 17, 2025
@eth-bot eth-bot changed the title Add limit to rlp(block) Add EIP: RLP Block Size Limit Apr 17, 2025
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Apr 17, 2025
@eth-bot eth-bot changed the title Add EIP: RLP Block Size Limit Add EIP: RLP Execution Block Size Limit Apr 17, 2025
Copy link

The commit 0d57c4e (as a parent of d8272e1) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Apr 23, 2025
Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, main one I think MiB and KiB should be used instead of MB and KB :) I also don't completely understand the 512 KiB margin, why is this added? If the block fits within the network limit it should be fine, right? Why this extra margin?

EIPS/eip-7934.md Outdated
---
eip: 7934
title: RLP Execution Block Size Limit
description: Introduce a protocol-level cap on the maximum RLP-encoded block size to 10 MB, including a 512 KB margin for beacon block size.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the correct unit to be used in this document is KiB and MiB. A MegaByte is 1e6 bytes, and a MebiByte is 2^20 = 1,048,576 bytes. See https://simple.wikipedia.org/wiki/Mebibyte (KiB = 1024 bytes, KB = 1000 bytes)

EIPS/eip-7934.md Outdated
### Block Size Cap

- Introduce constants:
- `MAX_BLOCK_SIZE` set to **10 MB (10,485,760 bytes)**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `MAX_BLOCK_SIZE` set to **10 MB (10,485,760 bytes)**
- `MAX_BLOCK_SIZE` set to **10 MiB (10,485,760 bytes)**

EIPS/eip-7934.md Outdated

- Introduce constants:
- `MAX_BLOCK_SIZE` set to **10 MB (10,485,760 bytes)**
- `MARGIN` set to **512 KB (524,288 bytes)**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `MARGIN` set to **512 KB (524,288 bytes)**
- `MARGIN` set to **512 KiB (524,288 bytes)**

EIPS/eip-7934.md Outdated
---
eip: 7934
title: RLP Execution Block Size Limit
description: Introduce a protocol-level cap on the maximum RLP-encoded block size to 10 MB, including a 512 KB margin for beacon block size.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Introduce a protocol-level cap on the maximum RLP-encoded block size to 10 MB, including a 512 KB margin for beacon block size.
description: Introduce a protocol-level cap on the maximum RLP-encoded block size to 10 MiB, including a 512 KiB margin for beacon block size.


## Motivation

Currently, Ethereum does not enforce a strict upper limit on the encoded size of blocks. This lack of constraint can result in:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should carefully define what is a "block" here. Because for EL we could pick the block header, the block itself (header + block body (so this includes transactions and withdrawals for instance)). Or would it be some serialization of whatever gets sent over engine_newPayload (so some kind of RLP serialization of ExecutionPayloadV_n?)

@benaadams
Copy link
Contributor

If the block fits within the network limit it should be fine, right? Why this extra margin?

Is only EL block the EL can reason about not the EL block with CL wrapper

@jochem-brouwer
Copy link
Member

jochem-brouwer commented Apr 25, 2025

Is only EL block the EL can reason about not the EL block with CL wrapper

Ah right, sorry, I'm a "pure EL" dev so I completely forgot that CL adds extra "fields" in order to propagate the block. Another novice question: can we prove that this safety margin (512 KiB) is sufficient enough? Or are there cases where we use all the reserved block space for the block, and the added CL fields will now grow the data packet over 10 MiB? Is there a worst case scenario where this is possible? (Is it possible to set a safe margin limit such that we can theoretically never go over the 10 MiB)

@benaadams
Copy link
Contributor

Another novice question: can we prove that this safety margin (512 KiB) is sufficient enough?

It was quoted as worst case of 128KiB in Belatrix https://github.com/ethereum/consensus-specs/blob/dev/specs/bellatrix/p2p-interface.md#gossipsub

Considering that BeaconBlock max size is on the order of 128 KiB in the worst case

Don't know what it is now; hence going for 512KiB

Also is an EL devp2p limit of 10MiB (- framing) after which peer will be disconnected if they gossip it https://github.com/ethereum/devp2p/blob/master/caps/eth.md

The practical limits for the eth protocol are lower, typically 10 MiB. If a received message is larger than the limit, the peer should be disconnected.

@g11tech
Copy link
Contributor

g11tech commented Apr 25, 2025

lemme know when good for merging since there are a good amount of open technical comments

Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
@Giulio2002
Copy link
Contributor Author

lemme know when good for merging since there are a good amount of open technical comments

I think good for merging

@changeschung
Copy link

changeschung commented Apr 25, 2025 via email

@dajuguan
Copy link

I have a naive question: with the current gas limit, block sizes typically don't exceed 3 MiB. In what scenario would a block size reach 10 MiB?

@benaadams
Copy link
Contributor

I have a naive question: with the current gas limit, block sizes typically don't exceed 3 MiB. In what scenario would a block size reach 10 MiB?

Around 100MGas block where the block was a single tx that was all zeros

@Giulio2002
Copy link
Contributor Author

@g11tech ready for merging. addressed everything

- `MAX_RLP_BLOCK_SIZE` calculated as `MAX_BLOCK_SIZE - MARGIN`
- Any RLP-encoded block exceeding `MAX_RLP_BLOCK_SIZE` must be considered invalid.

Thus add the following check to the Ethereum protocol:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be good idea to list where all these checks should be enforced unless speced out somewhere else

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a nit but still approving, see if you would want to address it in your followup PRs which shouldn't require editor's approval (if in draft)

@eth-bot eth-bot enabled auto-merge (squash) May 6, 2025 12:39
Copy link
Collaborator

@eth-bot eth-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot eth-bot merged commit 040800a into ethereum:master May 6, 2025
11 checks passed
Copy link

@noelportillo noelportillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they going for the new ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants