-
Notifications
You must be signed in to change notification settings - Fork 167
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
base: main
Are you sure you want to change the base?
Conversation
@marioevz does |
There was a problem hiding this 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.
tests/osaka/eip7892_bpo/test_bpo.py
Outdated
# 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 |
There was a problem hiding this comment.
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
toy
att
, produce the following tests:- Positive test: generate a test using a valid block with
timestamp=t
andy
blobs, and verify that the client accepts the block. - Negative test: generate a test using a invalid block with
timestamp=t
andy+1
blobs, and verify that the client rejects the block.
- Positive test: generate a test using a valid block with
- If we decrease the max-blobs-per-block from
y
tox
att
, produce the following tests:- Positive test: generate a test using a valid block with
timestamp=t
andx
blobs, and verify that the client accepts the block. - Negative test: generate a test using a invalid block with
timestamp=t
andx+1
blobs, and verify that the client rejects the block.
- Positive test: generate a test using a valid block with
For negative tests examples where we exceed the blob count for the block see:
execution-spec-tests/tests/cancun/eip4844_blobs/test_blob_txs.py
Lines 569 to 604 in ae95b1b
@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, | |
) |
If you now run the test with
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 |
ποΈ 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
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
type(scope):
.mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_from
marker.