Skip to content

test: add max block size test using access lists #1932

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 6 commits into from
Aug 5, 2025

Conversation

nerolation
Copy link
Contributor

@nerolation nerolation commented Jul 21, 2025

Add test_block_full_access_list_and_data to test maximum block size by splitting gas between access lists (60%) and calldata (40%). Uses 1 address with many storage keys to maximize block size.

🗒️ Description

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Add test_block_full_access_list_and_data to test maximum block size
by splitting gas between access lists (60%) and calldata (40%).
Uses 1 address with many storage keys to maximize block size.
@LouisTsai-Csie
Copy link
Collaborator

Nice work! I am just curious why the ratio is access lists: calldata = 60%: 40% here?

@nerolation
Copy link
Contributor Author

This is because under EIP-7623, you only hit the floor price for calldata if you use <60% of the available gas for EVM execution.
2930 access lists are interesting: One the one hand, they behave like calldata (add a lot of data to the block) but on the other hand we price them for their storage access. I have an EIP to change that: https://eips.ethereum.org/EIPS/eip-7981

Now, because we treat ALs as "storage access", they also contribute to the EVM part for calldata pricing. Thus, the max possible block size (snappy compresses) is the one I got in the test case.
Actually, we could optimize for a large size even further by using 29% of the calldata gas available for zero-bytes and the rest for non-zero bytes. This is where snappy compression does its worse job.

Added it in the last commit here.

@LouisTsai-Csie
Copy link
Collaborator

Thanks for your detailed explanation!

@nerolation
Copy link
Contributor Author

Adding this here, explaining the 29/71 ratio
70671ad2-cec9-44d6-8719-6bc1dc7715c0

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Thanks so much for the test! A couple of comments, and I'll be happy to assist in the changes if you need it to get it merged 👍

Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@marioevz marioevz merged commit 42a8a07 into ethereum:main Aug 5, 2025
16 checks passed
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.

3 participants