-
Notifications
You must be signed in to change notification settings - Fork 21.3k
core,miner: implement EIP-7934 - RLP Execution Block Size Limit #31990
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
Conversation
miner/worker.go
Outdated
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.
Please add a comment.
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.
Also, the block body size is also influenced by other things, such as withdrawals. So we need to add a bit of buffer into the size limit here. For the withdrawals, we may be able to add their true size into env.size
before adding transactions.
miner/worker.go
Outdated
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.
From the CL team:
potuz — 2025/6/10 21:11
This makes the payload invalid
Technically it will make the consensus block that contains that payload invalid.
Probably we need to put a note here, at least adding a warning log that a part of withdrawals specified by the CL are discarded due to the size restriction. In practice, it's impossible to occur.
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.
This happens before we fill the block with txs. Also, max block withdrawal count is capped by the protocol.
I have made two changes:
|
…ts and constant deduplication.
…if we would hit the size cap when filling it with txs
…ribute to the RLP-encoded block
…t to add when creating a block
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.
LGTM
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.
LGTM!
// The tx had a sidecar before, so we need to subtract it from the size. | ||
scSize := rlp.ListSize(blobtx.Sidecar.encodedSize()) | ||
cpy.size.Store(size - scSize) | ||
} |
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.
I've been verifying this, and this part is correct, but the Size
method has some issues related with the new sidecar v2. I was thinking about fixing it in this PR before merging, but will separate this out.
…reum#31990) This PR adds a block validation check for the maximum block size, as required by EIP-7934, and also applies a slightly lower size limit during block building. --------- Co-authored-by: spencer-tb <[email protected]> Co-authored-by: Felix Lange <[email protected]> Co-authored-by: Gary Rong <[email protected]>
…reum#31990) This PR adds a block validation check for the maximum block size, as required by EIP-7934, and also applies a slightly lower size limit during block building. --------- Co-authored-by: spencer-tb <[email protected]> Co-authored-by: Felix Lange <[email protected]> Co-authored-by: Gary Rong <[email protected]>
This PR adds a check against the maximum block size, as required by EIP-7934, and also applies a slightly lower
size limit during block building.