v2.0.0
πποΈ Cancun and StateTest Format Release
Contains many important framework changes, including introduction of the StateTest format, and some additional Cancun and other test coverage.
Due to changes in the framework, there is a breaking change in the directory structure in the release tarball, please see the dedicated "π₯ Breaking Changes" section below for more information.
π§ͺ Test Cases
- β¨ EIP-4844: Add
test_sufficient_balance_blob_tx()andtest_sufficient_balance_blob_tx_pre_fund_tx()(#379). - β¨ EIP-6780: Add a reentrancy suicide revert test (#372).
- β¨ EIP-1153: Add
test_run_until_out_of_gas()for transient storage opcodes (#401). - β¨ EIP-198: Add tests for the MODEXP precompile (#364).
- β¨ Tests for nested
CALLandCALLCODEgas consumption with a positive value transfer (previously lacking coverage) (#371). - π EIP-4844: Fixed
test_invalid_tx_max_fee_per_blob_gas()to account for extra gas required in the case where the account is incorrectly deduced the balance as if it had the correct block blob gas fee (#370). - π EIP-4844: Fixed
test_insufficient_balance_blob_tx()to correctly calculate the minimum balance required for the accounts (#379). - π EIP-4844: Fix and enable
test_invalid_blob_tx_contract_creation(#379). - π Convert all eligible
BlockchainTests toStateTests (and additionally generate correspondingBlockchainTests) (#368, #370).
π οΈ Framework
- β¨ Add
StateTestfixture format generation;StateTestsnow generate aStateTestand a correspondingBlockchainTesttest fixture, previously onlyBlockchainTestfixtures were generated (#368). - β¨ Add
StateTestOnlyfixture format is now available and its only difference withStateTestis that it does not produce aBlockchainTest(#368). - β¨ Add
evm_bytes_to_pythoncommand-line utility which converts EVM bytecode to Python Opcodes (#357). - β¨ Fork objects used to write tests can now be compared using the
>,>=,<,<=operators, to check for a fork being newer than, newer than or equal, older than, older than or equal, respectively when compared against other fork (#367). - β¨ Add solc 0.8.23 support (#373).
- β¨ Add framework unit tests for post state exception verification (#350).
- β¨ Add a helper class
ethereum_test_tools.TestParameterGroupto define test parameters as dataclasses and auto-generate test IDs (#364). - β¨ Add a
--single-fixture-per-fileflag to generate one fixture JSON file per test case (#331). - π Storage type iterator is now fixed (#369).
- π Fix type coercion in
FixtureHeader.join()(#398). - π Locally calculate the transactions list's root instead of using the one returned by t8n when producing BlockchainTests (#353).
- π Change custom exception classes to dataclasses to improve testability (#386).
- π Update fork name from "Merge" to "Paris" used within the framework and tests (#363).
- π₯ Replace
=with_in pytest node ids and test fixture names (#342). - π₯ The
StateTest, spec format used to write tests, is now limited to a single transaction per test (#361). - π₯ Tests must now use
BlockExceptionandTransactionExceptionto define the expected exception of a given test, which can be used to test whether the client is hitting the proper exception when processing the block or transaction (#384). - π₯
fill: Remove the--enable-hiveflag; now all test types are generated by default (#358). - π₯ Rename test fixtures names to match the corresponding pytest node ID as generated using
fill(#342).
π Misc
- β¨ Docs: Add a "Consuming Tests" section to the docs, where each test fixture format is described, along with the steps to consume them, and the description of the structures used in each format (#375).
- π Docs: Update
t8ntool branch to fill tests for development features in the readme (#338). - π Filling tool: Updated the default filling tool (
t8n) to go-ethereum@master (#368). - π Docs: Fix error banner in online docs due to mermaid syntax error (#398).
- π Docs: Fix incorrectly formatted nested lists in online doc (#403).
π₯ Breaking Changes
A concrete example of the test name renaming and change in directory structure is provided below.
-
Fixture output, including release tarballs, now contain subdirectories for different test types:
blockchain_tests: ContainsBlockchainTestformatted testsblockchain_tests_hive: ContainsBlockchainTestwith Engine API call directives for use in hivestate_tests: ContainsStateTestformatted tests
-
StateTest, spec format used to write tests, is now limited to a single transaction per test. -
In this release the pytest node ID is now used for fixture names (previously only the test parameters were used), this should not be breaking. However,
=in both node IDs (and therefore fixture names) have been replaced with_, which may break tooling that depends on the=character. -
Produced
blockchain_testsfixtures and their correspondingblockchain_tests_hivefixtures now contain the named exceptionsBlockExceptionandTransactionExceptionas strings in theexpectExceptionandvalidationErrorfields, respectively. These exceptions can be used to test whether the client is hitting the proper exception when processing an invalid block.Blockchain test:
"blocks": [ { ... "expectException": "TransactionException.INSUFFICIENT_ACCOUNT_FUNDS", ... } ... ]
Blockchain hive test:
"engineNewPayloads": [ { ... "validationError": "TransactionException.INSUFFICIENT_ACCOUNT_FUNDS", ... } ... ]
Renaming and Release Tarball Directory Structure Change Example
The fixture renaming provides a more consistent naming scheme between the pytest node ID and fixture name and allows the fixture name to be provided directly to pytest 5on the command line to execute individual tests in isolation, e.g. pytest tests/frontier/opcodes/test_dup.py::test_dup[fork_Frontier].
-
Pytest node ID example:
- Previous node ID:
tests/frontier/opcodes/test_dup.py::test_dup[fork=Frontier]. - New node ID:
tests/frontier/opcodes/test_dup.py::test_dup[fork_Frontier].
- Previous node ID:
-
Fixture name example:
- Previous fixture name:
000-fork=Frontier - New fixture name:
tests/frontier/opcodes/test_dup.py::test_dup[fork_Frontier](now the same as the pytest node ID).
- Previous fixture name:
-
Fixture JSON file name example (within the release tarball):
- Previous fixture file name:
fixtures/frontier/opcodes/dup/dup.json(BlockChainTestformat). - New fixture file names (all present within the release tarball):
fixtures/state_tests/frontier/opcodes/dup/dup.json(StateTestformat).fixtures/blockchain_tests/frontier/opcodes/dup/dup.json(BlockChainTestformat).fixtures/blockchain_tests_hive/frontier/opcodes/dup/dup.json(a blockchain test inHiveFixtureformat).
- Previous fixture file name:
New Contributors
- @jochem-brouwer made their first contribution in #364
- @MukulKolpe made their first contribution in #363
- @acolytec3 made their first contribution in #371
- @richardgreg made their first contribution in #373
Full Changelog: v1.0.6...v2.0.0