### EIP-4844 Testing Using Execution-Spec-Tests - Comprises all Execution Layer updates: - Blob Type (3) Transactions (Minimal version) - BLOBHASH opcode - ExcessDataGas, DataGasUsed header fields - Point Evaluation Precompile --- #### Blob Transactions Testing Overview - Tests all possible valid blob combinations in a given tx/block - Single transaction maxing out amount of blobs - Multiple transactions maxing out amount of blobs in a block - Test all invalid combinations up to max blobs + 1 - Single transaction blob overflow - Multiple transaction blob overflow - Test valid and invalid `max_fee_per_data_gas` in a transaction - Test intrinsically invalid blob transactions (account balance) - Versioned hash tests - Blob tx contract creation - Test all opcodes that access transaction attributes (e.g. GASPRICE) --- #### BLOBHASH Opcode Testing Overview - Test behavior on multiple valid and invalid indexes - Tests gascost on multiple indexes - Test behavior on multiple blob transactions per block - Test behavior on different contexts (CALL, DELEGATECALL, etc.) --- #### Blob Header Fields Extension Testing Overview - Test valid and invalid values in the header to verify block append and rejection - Test correct excess data gas calculation given combinations of parent blob values - Test correct data gas used values given combination of blobs in block --- #### Point Evaluation Precompile Testing Overview - --- - Python allows efficient parametrization and automatic generation of tests. - E.g. on spec changes, such as Target/Max blob changes, test combinations are automatically updated: | 2/4 Blobs |3/6 Blobs | | -- | -- | |![2/4 Blobs](https://storage.googleapis.com/ethereum-hackmd/upload_6a403572db286d6ebd33b4a8c056121f.png) | ![3/6 Blobs](https://storage.googleapis.com/ethereum-hackmd/upload_cdd2bfa1745ebab65035f7278c84571d.png) | --- ```python= @pytest.mark.parametrize( "z,y,kzg_commitment,kzg_proof,versioned_hash", [ (BLS_MODULUS, 0, INF_POINT, INF_POINT, auto), (0, BLS_MODULUS, INF_POINT, INF_POINT, auto), (Z, 0, INF_POINT, INF_POINT[:-1], auto), (Z, 0, INF_POINT, INF_POINT[0:1], auto), (Z, 0, INF_POINT, INF_POINT + bytes([0]), auto), (Z, 0, INF_POINT, INF_POINT + bytes([0] * 1023), auto), (bytes(), bytes(), bytes(), bytes(), bytes()), (0, 0, 0, 0, 0), (0, 0, 0, 0, auto), (Z, 0, INF_POINT, INF_POINT, kzg_to_versioned_hash(0xC0 << 376, 0x00)), (Z, 0, INF_POINT, INF_POINT, kzg_to_versioned_hash(0xC0 << 376, 0x02)), (Z, 0, INF_POINT, INF_POINT, kzg_to_versioned_hash(0xC0 << 376, 0xFF)), ], ids=[ "out_of_bounds_z", "out_of_bounds_y", "correct_proof_1_input_too_short", "correct_proof_1_input_too_short_2", "correct_proof_1_input_too_long", "correct_proof_1_input_extra_long", "null_inputs", "zeros_inputs", "zeros_inputs_correct_versioned_hash", "correct_proof_1_incorrect_versioned_hash_version_0x00", "correct_proof_1_incorrect_versioned_hash_version_0x02", "correct_proof_1_incorrect_versioned_hash_version_0xff", ], ) @pytest.mark.parametrize("success", [False]) @pytest.mark.valid_from("Cancun") def test_invalid_precompile_calls( blockchain_test: BlockchainTestFiller, pre: Dict, tx: Transaction, post: Dict, ): ``` ---
{"title":"ethereum/execution-spec-tests","tags":"Talk, Ethereum, Testing, ACDE","description":"python test cases & framework to generate tests for execution clients","slideOptions":{"theme":"simple"}}
    368 views