Skip to content

feat(fw): EIP-7892 BPO functionality added (related to issues #1797 , #1790) #1918

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 7 commits into
base: main
Choose a base branch
from

Conversation

felix314159
Copy link
Collaborator

@felix314159 felix314159 commented Jul 17, 2025

πŸ—’οΈ Description

Added bpo toy config + function to retrieve from it + unit test for that function. This PR is related to issues #1797 and #1790

This is still WIP

πŸ”— 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.

@felix314159 felix314159 changed the title feat(fw): EIP-7892 BPO functionality added feat(fw): EIP-7892 BPO functionality added (related to issues #1797 , #1790) Jul 17, 2025
@felix314159
Copy link
Collaborator Author

felix314159 commented Jul 25, 2025

@marioevz does test_bpo.py go into the right direction before i continue with this? Related comment

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 good so far! Left a comment to address your question about the testing approach.

Comment on lines 51 to 53
# TODO:
# for each block the client should report the current values of: max, target and base_fee_update_fraction # noqa: E501
# we need to signal to the client that the expected response is according to the bpo_schedule defined above # noqa: E501
Copy link
Member

Choose a reason for hiding this comment

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

Normally the approach here is not via extra queries to the client, rather via positive and negative testing of a valid and invalid block respectively:

  • If we increase the max-blobs-per-block from x to y at t, produce the following tests:
    • Positive test: generate a test using a valid block with timestamp=t and y blobs, and verify that the client accepts the block.
    • Negative test: generate a test using a invalid block with timestamp=t and y+1 blobs, and verify that the client rejects the block.
  • If we decrease the max-blobs-per-block from y to x at t, produce the following tests:
    • Positive test: generate a test using a valid block with timestamp=t and x blobs, and verify that the client accepts the block.
    • Negative test: generate a test using a invalid block with timestamp=t and x+1 blobs, and verify that the client rejects the block.

For negative tests examples where we exceed the blob count for the block see:

@pytest.mark.parametrize_by_fork(
"blobs_per_tx",
SpecHelpers.invalid_blob_combinations,
)
@pytest.mark.parametrize(
"tx_error",
[
[
TransactionException.TYPE_3_TX_MAX_BLOB_GAS_ALLOWANCE_EXCEEDED,
TransactionException.TYPE_3_TX_BLOB_COUNT_EXCEEDED,
]
],
ids=[""],
)
@pytest.mark.exception_test
@pytest.mark.valid_from("Cancun")
def test_invalid_block_blob_count(
blockchain_test: BlockchainTestFiller,
pre: Alloc,
env: Environment,
block: Block,
):
"""
Test all invalid blob combinations in a single block, where the sum of all blobs in a block is
at `MAX_BLOBS_PER_BLOCK + 1`.
This test is parametrized with all blob transaction combinations exceeding
`MAX_BLOBS_PER_BLOCK` by one for a given block, and
therefore if value of `MAX_BLOBS_PER_BLOCK` changes, this test is automatically updated.
"""
blockchain_test(
pre=pre,
post={},
blocks=[block],
genesis_environment=env,
)

@felix314159
Copy link
Collaborator Author

felix314159 commented Jul 29, 2025

If you now run the test with uv run fill tests/osaka/eip7892_bpo -vv -s --clean --until=Osaka you get:

FAILED tests/osaka/eip7892_bpo/test_bpo.py::test_bpo_schedule[fork_Osaka-blockchain_test] - ethereum_test_specs.helpers.UnexpectedExecutionFailError: Unexpected fail for Transaction ({'index': 0, 'nonce': 3}):
   What: Transaction unexpectedly failed!
  Error: "Failed transaction: BlobCountExceededError('Tx has 8 blobs. Max allowed: 6')"

which shows that the BPO fork i schedule (with 8 blobs) takes effect and we can continue from here. I am currently looking into how to adjust generate_block_data to have bpo overwrite the blob schedule for bpo tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants