Description
Feature Description
For our current t8n tools inluding geth, besu & evmone, we cannot reliably create tests with invalid fields.
Possible invalid cases could include the following:
- Address fields > 20 bytes,
- Hash fields > 32 bytes,
- Unsigned 64-bit integer fields (timestamp, excessBlobGas) > 64-bits,
- Fields with null values that are required to exist.
Existing Issues
test_blob_txs.py::test_invalid_blob_tx_contract_creation
is not fill-able using our most up to date cancun geth t8n tool:
marioevz/go-ethereum@4844-devnet-6-t8n/4c0559f55
It returns the following error when filled:
Exception: failed to evaluate: ERROR(10): failed unmarshaling stdin: missing required field 'to' in transaction
Within this test case we want to generate the fixture where a type 3 blob transaction has no to
address: to=None
. The EIP-4844 spec describes this situation as invalid, and hence we want to assert that execution clients acknowledge the invalidity upon fixture consumption. Similarly, to test that they should return an expected error via the EngineAPI when consuming the fixture within the hive pyspec simulator.
Possible Solution
To allow the t8n to generate a valid fixture, we first check the validity of every field for the test case before passing alloc, txs & env to be processed by the t8n tool.
This can be a separate function validity_checker()
that checks the validity of every field, flagging the field names that are invalid, alongside there invalid values. It will also overwrite the invalid fields with an appropriate default valid field.
Now we pass the "valid" txs & env to the t8n tool, bypassing any error, and use the valid output result to only partially create the fixture. We would then use the invalid fields returned from validity_checker()
within types.py
when creating the block rlp.