Skip to content

chore(tests|forks): add max blobs per tx limit #1884

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

spencer-tb
Copy link
Contributor

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

πŸ—’οΈ Description

Following the changes to EIP-7594: ethereum/EIPs#9981

Adds some more execute_blobs tests for PeerDAS, including tests for the new max blobs per tx limit.

Updates fork logic and EIP-4844 tests to use a new max_blobs_per_tx function.

Adds specific tests for the new change (including transition tests) within the PeerDAS EIP testing folder.

Currently filling with this eels_resolution.json:

    "Osaka": {
        "git_url": "https://github.com/spencer-tb/execution-specs.git",
        "branch": "forks/osaka",
        "commit": "07699170182691533023fa5d83086258c3edcfd3"
    }

The magic EELS commit is: ethereum/execution-specs@0769917

Requires

πŸ”— Related Issues or PRs

#1798

βœ… 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).

@spencer-tb spencer-tb added scope:forks Scope: Changes ethereum_test_forks package scope:tests Scope: Changes EL client test cases in `./tests` type:chore Type: Chore fork:osaka Osaka hardfork labels Jul 9, 2025
@spencer-tb
Copy link
Contributor Author

spencer-tb commented Jul 10, 2025

I tried to fix the coverage for this line below, in the following commit:

// Ensure the total blob gas spent is at most equal to the limit
if (*test_block.block_info.blob_gas_used > state::max_blob_gas_per_block(rev))
    return false;

@spencer-tb spencer-tb marked this pull request as ready for review July 10, 2025 18:43
Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

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

Nothing obvious stands out to me here! πŸš€

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.

Looks great! Just a couple of comments, thanks!

# This allows us to keep the creation of single transactions for Cancun/Prague where the
# MAX_BLOBS_PER_TX is not enforced, hitting coverage for block level blob gas validation
# when parent_blobs > MAX_BLOBS_PER_BLOCK.
max_blobs_per_tx = fork.max_blobs_per_tx() if fork >= Osaka else parent_blobs
Copy link
Member

Choose a reason for hiding this comment

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

We could check whether max per block != max per tx instead of checking explicitly for Osaka.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I think I had this initially but changed it to this to see if it would fix the coverage! I will revert back.

# when parent_blobs > MAX_BLOBS_PER_BLOCK.
max_blobs_per_tx = fork.max_blobs_per_tx() if fork >= Osaka else parent_blobs
blob_chunks = [
range(i, min(i + max_blobs_per_tx, parent_blobs))
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

):
if new_blobs > 0 and new_blobs > fork.max_blobs_per_tx():
Copy link
Member

Choose a reason for hiding this comment

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

It might be necessary that we change this fixture from a single tx to multiple txs to reach the amount of blobs that the test expects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be the missed coverage line. I'm crying inside. Let me change it!

@@ -43,7 +43,7 @@ def env() -> Environment: # noqa: D103
def pre_fork_blobs_per_block(fork: Fork) -> int:
"""Amount of blobs to produce with the pre-fork rules."""
if fork.supports_blobs(timestamp=0):
return fork.max_blobs_per_block(timestamp=0)
return fork.max_blobs_per_tx(timestamp=0)
Copy link
Member

Choose a reason for hiding this comment

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

Also here like in the previous comment, we still need to hit the max but it might now require many txs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fork:osaka Osaka hardfork scope:forks Scope: Changes ethereum_test_forks package scope:tests Scope: Changes EL client test cases in `./tests` type:chore Type: Chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants