-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Added more tests for execution payload processing with incorrect blob commitments #4087
base: dev
Are you sure you want to change the base?
Conversation
opaque_tx, _, _, _ = get_sample_blob_tx(spec, blob_count=0, rng=Random(1111)) | ||
_, _, blob_kzg_commitments, _ = get_sample_blob_tx(spec, blob_count=2, rng=Random(1112)) |
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.
Hmm this would be an invalid blob transaction though 😅
if get_tx_type(tx) == BLOB_TX_TYPE:
# there must be at least one blob
assert len(tx.blob_versioned_hashes) > 0
See: https://eips.ethereum.org/EIPS/eip-4844#execution-layer-validation
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.
oh no, this skipped my mind sorry, i removed this test
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.
No worries at all. After looking at other tests in that file, it seems that some also have invalid transactions. So it might have been okay to keep but I think removing it is for the best. Thank you.
For example, an invalid transaction:
Lines 89 to 101 in b1c70a9
def test_incorrect_transaction_length_1_extra_byte(spec, state): | |
""" | |
The versioned hashes are wrong, but the testing ExecutionEngine returns VALID by default. | |
""" | |
execution_payload = build_empty_execution_payload(spec, state) | |
opaque_tx, _, blob_kzg_commitments, _ = get_sample_blob_tx(spec) | |
opaque_tx = opaque_tx + b'\x12' # incorrect tx length, longer | |
execution_payload.transactions = [opaque_tx] | |
execution_payload.block_hash = compute_el_block_hash(spec, execution_payload, state) | |
yield from run_execution_payload_processing(spec, state, execution_payload, blob_kzg_commitments) |
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.
haha, hawk eyes 👀! btw, i just updated the base branch right after you approved the CI, would you mind approving the CI run once again?
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.
Sure, we can add it back but with a new name. Something like this, feel free to alter:
- test_incorrect_commitments_for_no_blob
+ test_incorrect_transaction_no_blobs_but_with_commitments
Also I would add a comment (above the get_sample_blob_tx
call) about blob transactions with zero blobs being invalid. This might not be immediately obvious to CL folks 😄
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.
LGTM, thank you!
This PR expands the coverage of deneb's execution payload processing by adding the following two scenarios: