Skip to content

feat(tests): EIP-7934 - block rlp size limit test cases #1730

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
Jun 19, 2025
Merged

Conversation

spencer-tb
Copy link
Contributor

@spencer-tb spencer-tb commented Jun 9, 2025

🗒️ Description

Creates the initial set of test cases for EIP-7934 and the new exception type BlockException.RLP_BLOCK_LIMIT_EXCEEDED.

Currently there are only 2 simple tests cases:

  • test_block_exceeds_rlp_size_limit, this send a single tx that "should" exceed the block rlp size.
  • test_multiple_transactions_exceed_limit, this sends 5 txs where the last should push the block rlp over the limit.

Note that currently assume that 10_000 extra calldata bytes of a tx will exceed the limit of 8_388_608 RLP encoded bytes. Note we use the precise limit:

MAX_BLOCK_SIZE - SAFETY_MARGIN = MAX_RLP_BLOCK_SIZE
10_485_760 (10 MiB) - 2_097_152 (2MiB) = 8_388_608

Client specific exceptions will need to be added in a follow up PR, or in this PR one they are ready.

🔗 Related Issues

N/A

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.

@spencer-tb spencer-tb added scope:tests Scope: Changes EL client test cases in `./tests` type:feat type: Feature fork:osaka Osaka hardfork labels Jun 9, 2025
@spencer-tb spencer-tb self-assigned this Jun 9, 2025
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.

Some comments, it's a nice first approach, thanks for putting this together 👍

@spencer-tb
Copy link
Contributor Author

Tagging this change: ethereum/EIPs@0e2559f

@fselmo fselmo force-pushed the eip-7934 branch 2 times, most recently from db56756 to e4ea26d Compare June 11, 2025 21:40
@spencer-tb spencer-tb force-pushed the eip-7934 branch 2 times, most recently from 5f294b5 to aca15e9 Compare June 11, 2025 22:43
@spencer-tb spencer-tb changed the title feat(tests): add intial eip-7934 test cases feat(tests): block rlp size limit eip-7934 test cases Jun 11, 2025
@fselmo fselmo force-pushed the eip-7934 branch 3 times, most recently from 6d20b73 to 693acb5 Compare June 13, 2025 13:41
@marioevz
Copy link
Member

Insane precision:

(ethereum-execution-spec-tests) ➜  execution-spec-tests git:(eip-7934) ✗ cat fixtures/blockchain_tests/osaka/eip7934_block_rlp_limit/max_block_rlp_size/block_at_rlp_size_limit_boundary.json | jq '."tests/osaka/eip7934_block_rlp_limit/test_max_block_rlp_size.py::test_block_at_rlp_size_limit_boundary[fork_Osaka-blockchain_test-max_rlp_size]".blocks[0].rlp' -r | xxd -r -p > raw_block.rlp
(ethereum-execution-spec-tests) ➜  execution-spec-tests git:(eip-7934) ✗ ls -l ./raw_block.rlp
-rw-r--r-- 1 marioevz sudo 8388608 Jun 18 16:01 ./raw_block.rlp

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, the precision is amazing.

I pushed a tiny change that renames a couple of variables and test IDs.

Also created an issue to follow up on cases I think are missing: #1772

@spencer-tb
Copy link
Contributor Author

LGTM!

@marioevz marioevz changed the title feat(tests): block rlp size limit eip-7934 test cases feat(tests): EIP-7934 - block rlp size limit test cases Jun 19, 2025
@marioevz marioevz merged commit 876ea0c into main Jun 19, 2025
27 checks passed
@marioevz marioevz deleted the eip-7934 branch June 19, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fork:osaka Osaka hardfork scope:tests Scope: Changes EL client test cases in `./tests` type:feat type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants