execution-spec-tests icon indicating copy to clipboard operation
execution-spec-tests copied to clipboard

feat(tests,execute): expand 4844 test suite to use real blobs in execute mode

Open marioevz opened this issue 9 months ago • 1 comments

          > test suite that sends blob txs to ELs, then we call `get_blobs` to validate the response. This feels suited towards an extension in `execute`.

This could even replace most of hive simulator tests if possible. The main issue right now is that most of the time we don't have full blobs in our tests but we only put the versioned hashes in the transaction. But perhaps we could put full blobs in the test transactions if we are running in execute mode (we could create a "mode" fixture that is populated with "fill" or "execute" depending on the pytest plugin).

Originally posted by @marioevz in https://github.com/ethereum/execution-spec-tests/issues/1510#issuecomment-2840421319

marioevz avatar Apr 30 '25 16:04 marioevz

Just to expand on this, I think we need to generate some real blobs using random data and then use ckzg to generate real proofs as @jtraglia suggested.

In the 4844 tests we simply use a hash with all zeros and a number at the end in place of real versioned blob hashes: https://github.com/ethereum/execution-spec-tests/blob/b33ed116e215f9814df372becd30f8c8d5950cfb/tests/cancun/eip4844_blobs/test_blob_txs.py#L103-L116

This is ok for filled tests because the transactions in the blocks that are verified by these tests never contain the full blobs, so it does not matter that the versioned hashes do not correctly map to a real blob.

For execute we actually skip tests that use type-3 transactions because of this reason.

If we generate the tests with full blobs, even if the full blob never makes it into the filled test, we could use this full blob during execute and validate using getBlobs.

We have also to take into consideration this file: https://github.com/ethereum/execution-spec-tests/blob/main/tests/cancun/eip4844_blobs/test_blob_txs_full.py

And this definition: https://github.com/ethereum/execution-spec-tests/blob/b33ed116e215f9814df372becd30f8c8d5950cfb/src/ethereum_test_types/types.py#L1073-L1094

Maybe moving blobs, blob_kzg_commitments and blob_kzg_proofs from NetworkWrappedTransaction back to Transaction so they are always accessible, and then execute (and https://github.com/ethereum/execution-spec-tests/blob/main/tests/cancun/eip4844_blobs/test_blob_txs_full.py) wrap the tx in NetworkWrappedTransactionfor their respective purposes.

@felix314159 @spencer-tb

marioevz avatar Apr 30 '25 16:04 marioevz

Solved by #1614

felix314159 avatar Aug 11 '25 09:08 felix314159