Skip to content

EIP-7934 #3376

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

EIP-7934 #3376

wants to merge 5 commits into from

Conversation

advaita-saha
Copy link
Contributor

No description provided.

@jangko
Copy link
Contributor

jangko commented Jun 11, 2025

The same validation if applied to txpool can be tricky.

@advaita-saha advaita-saha mentioned this pull request Jun 11, 2025
6 tasks
@@ -159,9 +159,13 @@ proc assembleBlock*(
blobsBundle = BlobsBundle(
wrapperVersion: getWrapperVersion(com, blk.header.timestamp)
)
currentRlpSize = rlp.getEncodedLength(blk.header) + rlp.getEncodedLength(blk.withdrawals)
Copy link
Contributor

Choose a reason for hiding this comment

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

blk.withdrawals = Opt.some(xp.withdrawals)

withdrawals are fork dependant.


for item in pst.packedTxs:
let tx = item.pooledTx
if currentRlpSize > MAX_RLP_BLOCK_SIZE:
break
currentRlpSize = currentRlpSize + rlp.getEncodedLength(tx.tx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Calculating the rlp length like this might works to some extent. But considering how rlp algorithm works, there are and there will be edge cases where this calculation will produce invalid result. To produce a reliable result for all cases, we need a specially crafted getEncodedLength or we make a compromise to never exceeds the dangerous limit.

And that dangerous limit is MAX_RLP_BLOCK_SIZE - 5. The 5 represent the maximum number of bytes might be produced by the rlp for the length prefix which is 3 bytes for 10 MiB, and additional 2 bytes to compensate for missing rlp list marker when we skip the body. (This is my rough calculation, I may missed something), but you got the point.

And also a break from that loop must be executed before currentRlpSize exceeds MAX_RLP_BLOCK_SIZE - X.

@advaita-saha advaita-saha mentioned this pull request Jun 14, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants