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
CALL
andCALLCODE
gas 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
BlockchainTest
s toStateTest
s (and additionally generate correspondingBlockchainTest
s) (#368, #370).
π οΈ Framework
- β¨ Add
StateTest
fixture format generation;StateTests
now generate aStateTest
and a correspondingBlockchainTest
test fixture, previously onlyBlockchainTest
fixtures were generated (#368). - β¨ Add
StateTestOnly
fixture format is now available and its only difference withStateTest
is that it does not produce aBlockchainTest
(#368). - β¨ Add
evm_bytes_to_python
command-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.TestParameterGroup
to define test parameters as dataclasses and auto-generate test IDs (#364). - β¨ Add a
--single-fixture-per-file
flag 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
BlockException
andTransactionException
to 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-hive
flag; 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
t8n
tool 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
: ContainsBlockchainTest
formatted testsblockchain_tests_hive
: ContainsBlockchainTest
with Engine API call directives for use in hivestate_tests
: ContainsStateTest
formatted 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_tests
fixtures and their correspondingblockchain_tests_hive
fixtures now contain the named exceptionsBlockException
andTransactionException
as strings in theexpectException
andvalidationError
fields, 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
(BlockChainTest
format). - New fixture file names (all present within the release tarball):
fixtures/state_tests/frontier/opcodes/dup/dup.json
(StateTest
format).fixtures/blockchain_tests/frontier/opcodes/dup/dup.json
(BlockChainTest
format).fixtures/blockchain_tests_hive/frontier/opcodes/dup/dup.json
(a blockchain test inHiveFixture
format).
- 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