From 18d415a6ae459fb535c1996e7a0cc2e6f3378bc7 Mon Sep 17 00:00:00 2001 From: voith Date: Thu, 19 Sep 2019 04:03:23 +0530 Subject: [PATCH 01/21] update upstream tests for Istanbul --- eth/chains/mainnet/__init__.py | 4 ++++ eth/chains/mainnet/constants.py | 6 ++++++ eth/tools/fixtures/helpers.py | 5 +++++ fixtures | 2 +- tests/core/chain-object/test_contract_call.py | 11 +++++++++++ tests/core/tester/test_generate_vm_configuration.py | 7 +++++-- tests/json-fixtures/test_transactions.py | 4 ++-- tox.ini | 3 ++- 8 files changed, 36 insertions(+), 6 deletions(-) diff --git a/eth/chains/mainnet/__init__.py b/eth/chains/mainnet/__init__.py index 60aa5d499c..ad0871502b 100644 --- a/eth/chains/mainnet/__init__.py +++ b/eth/chains/mainnet/__init__.py @@ -14,6 +14,7 @@ MAINNET_CHAIN_ID, BYZANTIUM_MAINNET_BLOCK, PETERSBURG_MAINNET_BLOCK, + ISTANBUL_MAINNET_BLOCK, TANGERINE_WHISTLE_MAINNET_BLOCK, HOMESTEAD_MAINNET_BLOCK, SPURIOUS_DRAGON_MAINNET_BLOCK, @@ -34,6 +35,7 @@ ByzantiumVM, FrontierVM, HomesteadVM, + IstanbulVM, PetersburgVM, SpuriousDragonVM, TangerineWhistleVM, @@ -80,6 +82,7 @@ class MainnetHomesteadVM(MainnetDAOValidatorVM): SPURIOUS_DRAGON_MAINNET_BLOCK, BYZANTIUM_MAINNET_BLOCK, PETERSBURG_MAINNET_BLOCK, + ISTANBUL_MAINNET_BLOCK, ) MAINNET_VMS = ( FrontierVM, @@ -88,6 +91,7 @@ class MainnetHomesteadVM(MainnetDAOValidatorVM): SpuriousDragonVM, ByzantiumVM, PetersburgVM, + IstanbulVM, ) MAINNET_VM_CONFIGURATION = tuple(zip(MAINNET_FORK_BLOCKS, MAINNET_VMS)) diff --git a/eth/chains/mainnet/constants.py b/eth/chains/mainnet/constants.py index 669d895ca9..bc6b7bc964 100644 --- a/eth/chains/mainnet/constants.py +++ b/eth/chains/mainnet/constants.py @@ -42,3 +42,9 @@ # Petersburg Block # PETERSBURG_MAINNET_BLOCK = BlockNumber(7280000) + +# +# Istanbul Block +# +# FIXME: Replace this with the correct blocknumber when it's decided +ISTANBUL_MAINNET_BLOCK = BlockNumber(7280728) diff --git a/eth/tools/fixtures/helpers.py b/eth/tools/fixtures/helpers.py index 2acae38756..461d8a8be7 100644 --- a/eth/tools/fixtures/helpers.py +++ b/eth/tools/fixtures/helpers.py @@ -45,6 +45,7 @@ FrontierVM, HomesteadVM as BaseHomesteadVM, SpuriousDragonVM, + IstanbulVM, ) @@ -121,6 +122,10 @@ def chain_vm_configuration(fixture: Dict[str, Any]) -> Iterable[Tuple[int, Type[ return ( (0, PetersburgVM), ) + elif network == 'Istanbul': + return ( + (0, IstanbulVM), + ) elif network == 'FrontierToHomesteadAt5': HomesteadVM = BaseHomesteadVM.configure(support_dao_fork=False) return ( diff --git a/fixtures b/fixtures index 6b85703b56..d4f86ecf4a 160000 --- a/fixtures +++ b/fixtures @@ -1 +1 @@ -Subproject commit 6b85703b568f4456582a00665d8a3e5c3b20b484 +Subproject commit d4f86ecf4aa7c44a40bc0c972fd3e25d63ef5d92 diff --git a/tests/core/chain-object/test_contract_call.py b/tests/core/chain-object/test_contract_call.py index f7178c2ec5..42f97764ac 100644 --- a/tests/core/chain-object/test_contract_call.py +++ b/tests/core/chain-object/test_contract_call.py @@ -26,6 +26,7 @@ ByzantiumVM, ConstantinopleVM, PetersburgVM, + IstanbulVM, ) @@ -212,6 +213,16 @@ def test_get_transaction_result( 'useLotsOfGas()', OutOfGas, ), + ( + IstanbulVM, + 'doRevert()', + Revert, + ), + ( + IstanbulVM, + 'useLotsOfGas()', + OutOfGas, + ), ), ) def test_get_transaction_result_revert( diff --git a/tests/core/tester/test_generate_vm_configuration.py b/tests/core/tester/test_generate_vm_configuration.py index 57ef011a5f..f59567e9ae 100644 --- a/tests/core/tester/test_generate_vm_configuration.py +++ b/tests/core/tester/test_generate_vm_configuration.py @@ -17,6 +17,7 @@ class Forks(enum.Enum): Byzantium = 'Byzantium' Constantinople = 'Constantinople' Petersburg = 'Petersburg' + Istanbul = 'Istanbul' class CustomFrontierVM(FrontierVM): @@ -29,7 +30,7 @@ class CustomFrontierVM(FrontierVM): ( tuple(), {}, - ((0, Forks.Petersburg),), + ((0, Forks.Istanbul),), ), ( ((0, 'tangerine-whistle'), (1, 'spurious-dragon')), @@ -116,7 +117,8 @@ class CustomFrontierVM(FrontierVM): (1, 'homestead'), (2, 'tangerine-whistle'), (3, 'byzantium'), - (5, 'petersburg') + (5, 'petersburg'), + (6, 'istanbul'), ), {}, ( @@ -125,6 +127,7 @@ class CustomFrontierVM(FrontierVM): (2, Forks.TangerineWhistle), (3, Forks.Byzantium), (5, Forks.Petersburg), + (6, Forks.Istanbul) ), ), ), diff --git a/tests/json-fixtures/test_transactions.py b/tests/json-fixtures/test_transactions.py index a7437fa483..c32571e0ae 100644 --- a/tests/json-fixtures/test_transactions.py +++ b/tests/json-fixtures/test_transactions.py @@ -102,9 +102,9 @@ def fixture_transaction_class(fixture_data): return ByzantiumTransaction elif fork_name == ForkName.Constantinople: return ConstantinopleTransaction - elif fork_name == "Petersburg": + elif fork_name == "ConstantinopleFix": return PetersburgTransaction - elif fork_name == ForkName.Istanbul: + elif fork_name == "Istanbul": return IstanbulTransaction elif fork_name == ForkName.Metropolis: pytest.skip("Metropolis Transaction class has not been implemented") diff --git a/tox.ini b/tox.ini index df6c5651bb..457a62af46 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist= py{36,37}-{core,database,transactions,vm} py36-benchmark - py36-native-blockchain-{frontier,homestead,tangerine_whistle,spurious_dragon,byzantium,constantinople,petersburg,metropolis,transition} + py36-native-blockchain-{frontier,homestead,tangerine_whistle,spurious_dragon,byzantium,constantinople,petersburg,istanbul,metropolis,transition} py{36,37}-lint py36-docs @@ -28,6 +28,7 @@ commands= native-blockchain-byzantium: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Byzantium} native-blockchain-constantinople: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Constantinople} native-blockchain-petersburg: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork ConstantinopleFix} + native-blockchain-istanbul: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Istanbul} native-blockchain-metropolis: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Metropolis} native-blockchain-transition: pytest {posargs:tests/json-fixtures/test_blockchain.py -k BlockchainTests/TransitionTests} lint: flake8 {toxinidir}/eth {toxinidir}/tests {toxinidir}/scripts From 0ff7cc01585b3d011caa0f0aaefe5b282cee1753 Mon Sep 17 00:00:00 2001 From: voith Date: Sun, 22 Sep 2019 20:40:24 +0530 Subject: [PATCH 02/21] updated fixtures and handle case when postState is a string --- eth/tools/_utils/normalization.py | 31 +++++++++++++++++++------------ fixtures | 2 +- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/eth/tools/_utils/normalization.py b/eth/tools/_utils/normalization.py index e24dc6c2dd..d808d82bf1 100644 --- a/eth/tools/_utils/normalization.py +++ b/eth/tools/_utils/normalization.py @@ -360,18 +360,25 @@ def normalize_unsigned_transaction(transaction: TransactionDict, FixtureAccountState = Dict[Address, FixtureAccountDetails] -def normalize_account_state(account_state: FixtureAccountState) -> AccountState: - return { - to_canonical_address(address): { - 'balance': to_int(state['balance']), - 'code': decode_hex(state['code']), - 'nonce': to_int(state['nonce']), - 'storage': { - to_int(slot): big_endian_to_int(decode_hex(value)) - for slot, value in state['storage'].items() - }, - } for address, state in account_state.items() - } +def normalize_account_state(account_state: FixtureAccountState) -> Union[AccountState, str]: + if isinstance(account_state, dict): + return { + to_canonical_address(address): { + 'balance': to_int(state['balance']), + 'code': decode_hex(state['code']), + 'nonce': to_int(state['nonce']), + 'storage': { + to_int(slot): big_endian_to_int(decode_hex(value)) + for slot, value in state['storage'].items() + }, + } for address, state in account_state.items() + } + elif isinstance(account_state, str): + # https://github.com/ethereum/tests/issues/637#issuecomment-532234905 + # some fixtures have postState as a string instead of map + return account_state + else: + raise Exception('Invariant') @to_dict diff --git a/fixtures b/fixtures index d4f86ecf4a..52d5247fe4 160000 --- a/fixtures +++ b/fixtures @@ -1 +1 @@ -Subproject commit d4f86ecf4aa7c44a40bc0c972fd3e25d63ef5d92 +Subproject commit 52d5247fe41f489c274e4254b151520bc3f20cc7 From 9ce8a9a967e002ed62053c4c4dc677323e11a0f1 Mon Sep 17 00:00:00 2001 From: voith Date: Sun, 22 Sep 2019 21:22:50 +0530 Subject: [PATCH 03/21] add more gas for sstore_uint64 tests --- scripts/benchmark/checks/deploy_dos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/benchmark/checks/deploy_dos.py b/scripts/benchmark/checks/deploy_dos.py index f04b1acc01..b25c1750c8 100644 --- a/scripts/benchmark/checks/deploy_dos.py +++ b/scripts/benchmark/checks/deploy_dos.py @@ -44,7 +44,7 @@ ) FIRST_TX_GAS_LIMIT = 367724 -SECOND_TX_GAS_LIMIT = 62050 +SECOND_TX_GAS_LIMIT = 63042 THIRD_TX_GAS_LIMIT = 104789 FORTH_TX_GAS_LIMIT = 21272 FIFTH_TX_GAS_LIMIT = 21272 From 7194e9d776d4277f06ef577d4e671a8c7418fdb6 Mon Sep 17 00:00:00 2001 From: voith Date: Sun, 22 Sep 2019 21:25:25 +0530 Subject: [PATCH 04/21] change ByzantiumToConstantinopleAt5 to ByzantiumToConstantinopleFixAt5 --- eth/tools/fixtures/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/tools/fixtures/helpers.py b/eth/tools/fixtures/helpers.py index 461d8a8be7..8dfc1466b8 100644 --- a/eth/tools/fixtures/helpers.py +++ b/eth/tools/fixtures/helpers.py @@ -151,7 +151,7 @@ def chain_vm_configuration(fixture: Dict[str, Any]) -> Iterable[Tuple[int, Type[ (0, SpuriousDragonVM), (5, ByzantiumVM), ) - elif network == 'ByzantiumToConstantinopleAt5': + elif network == 'ByzantiumToConstantinopleFixAt5': return ( (0, ByzantiumVM), (5, ConstantinopleVM), From e5cea085668fe0cde6ce33a4820bcecda96a8cfa Mon Sep 17 00:00:00 2001 From: voith Date: Sun, 22 Sep 2019 21:38:21 +0530 Subject: [PATCH 05/21] update gas for create_empty_contract --- scripts/benchmark/checks/deploy_dos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/benchmark/checks/deploy_dos.py b/scripts/benchmark/checks/deploy_dos.py index b25c1750c8..b7aeb0139c 100644 --- a/scripts/benchmark/checks/deploy_dos.py +++ b/scripts/benchmark/checks/deploy_dos.py @@ -45,7 +45,7 @@ FIRST_TX_GAS_LIMIT = 367724 SECOND_TX_GAS_LIMIT = 63042 -THIRD_TX_GAS_LIMIT = 104789 +THIRD_TX_GAS_LIMIT = 105781 FORTH_TX_GAS_LIMIT = 21272 FIFTH_TX_GAS_LIMIT = 21272 From a96d9c61e08c208a3b008108f32f451b761ddfc5 Mon Sep 17 00:00:00 2001 From: voith Date: Mon, 23 Sep 2019 12:40:53 +0530 Subject: [PATCH 06/21] mark randomStatetest94 as slow tests --- tests/json-fixtures/test_blockchain.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/json-fixtures/test_blockchain.py b/tests/json-fixtures/test_blockchain.py index fe3156b961..cf88ee7789 100644 --- a/tests/json-fixtures/test_blockchain.py +++ b/tests/json-fixtures/test_blockchain.py @@ -167,6 +167,10 @@ ('GeneralStateTests/stStaticCall/static_Return50000_2_d0g0v0.json', 'static_Return50000_2_d0g0v0_ConstantinopleFix'), # noqa: E501 ('GeneralStateTests/stSystemOperationsTest/CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0.json', 'CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0_Frontier'), # noqa: E501 ('GeneralStateTests/stSystemOperationsTest/CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0.json', 'CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0_Homestead'), # noqa: E501 + ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Homestead'), # noqa: E501 + ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Byzantium'), # noqa: E501 + ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Constantinople'), # noqa: E501 + ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_ConstantinopleFix'), # noqa: E501 } From 427c0f5d8b3d21881b2730f3f4b419cca6ed4e5f Mon Sep 17 00:00:00 2001 From: voith Date: Mon, 23 Sep 2019 13:18:35 +0530 Subject: [PATCH 07/21] add istanbul blockchain tests to CI fix copy/paste --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf83d502ea..5df3f2bc3e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,6 +70,12 @@ jobs: - image: circleci/python:3.6 environment: TOXENV: py36-native-blockchain-homestead + py36-native-blockchain-istanbul: + <<: *common + docker: + - image: circleci/python:3.6 + environment: + TOXENV: py36-native-blockchain-istanbul py36-native-blockchain-petersburg: <<: *common docker: @@ -171,6 +177,7 @@ workflows: - py36-native-blockchain-constantinople - py36-native-blockchain-frontier - py36-native-blockchain-homestead + - py36-native-blockchain-istanbul - py36-native-blockchain-petersburg - py36-native-blockchain-tangerine_whistle - py36-native-blockchain-spurious_dragon From d6c61c65db876a939483953015d1046df46cee62 Mon Sep 17 00:00:00 2001 From: voith Date: Thu, 26 Sep 2019 14:49:18 +0530 Subject: [PATCH 08/21] Some fixtures do not have post state. Added a normalizer `normalize_post_stae` to handle this case. renamed existing method `normalize_post_state` to `normalize_post_state_hash` --- eth/tools/_utils/normalization.py | 44 ++++++++++++++++--------------- fixtures | 2 +- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/eth/tools/_utils/normalization.py b/eth/tools/_utils/normalization.py index d808d82bf1..76c8871fdc 100644 --- a/eth/tools/_utils/normalization.py +++ b/eth/tools/_utils/normalization.py @@ -360,29 +360,31 @@ def normalize_unsigned_transaction(transaction: TransactionDict, FixtureAccountState = Dict[Address, FixtureAccountDetails] -def normalize_account_state(account_state: FixtureAccountState) -> Union[AccountState, str]: - if isinstance(account_state, dict): - return { - to_canonical_address(address): { - 'balance': to_int(state['balance']), - 'code': decode_hex(state['code']), - 'nonce': to_int(state['nonce']), - 'storage': { - to_int(slot): big_endian_to_int(decode_hex(value)) - for slot, value in state['storage'].items() - }, - } for address, state in account_state.items() - } - elif isinstance(account_state, str): - # https://github.com/ethereum/tests/issues/637#issuecomment-532234905 - # some fixtures have postState as a string instead of map - return account_state +def normalize_account_state(account_state: FixtureAccountState) -> AccountState: + return { + to_canonical_address(address): { + 'balance': to_int(state['balance']), + 'code': decode_hex(state['code']), + 'nonce': to_int(state['nonce']), + 'storage': { + to_int(slot): big_endian_to_int(decode_hex(value)) + for slot, value in state['storage'].items() + }, + } for address, state in account_state.items() + } + + +def normalize_post_state(postate: FixtureAccountState) -> AccountState: + # poststate might not be present in some fixtures + # https://github.com/ethereum/tests/issues/637#issuecomment-534072897 + if postate is None: + return {} else: - raise Exception('Invariant') + return normalize_account_state(postate) @to_dict -def normalize_post_state(post_state: Dict[str, Any]) -> Iterable[Tuple[str, bytes]]: +def normalize_post_state_hash(post_state: Dict[str, Any]) -> Iterable[Tuple[str, bytes]]: yield 'hash', decode_hex(post_state['hash']) if 'logs' in post_state: yield 'logs', decode_hex(post_state['logs']) @@ -398,7 +400,7 @@ def normalize_statetest_fixture(fixture: Dict[str, Any], normalized_fixture = { 'env': normalize_environment(fixture['env']), 'pre': normalize_account_state(fixture['pre']), - 'post': normalize_post_state(post_state), + 'post': normalize_post_state_hash(post_state), 'transaction': normalize_unsigned_transaction( fixture['transaction'], post_state['indexes'], @@ -545,7 +547,7 @@ def normalize_blockchain_fixtures(fixture: Dict[str, Any]) -> Dict[str, Any]: 'genesisBlockHeader': normalize_block_header(fixture['genesisBlockHeader']), 'lastblockhash': decode_hex(fixture['lastblockhash']), 'pre': normalize_account_state(fixture['pre']), - 'postState': normalize_account_state(fixture['postState']), + 'postState': normalize_post_state(fixture.get('postState')), 'network': fixture['network'], } diff --git a/fixtures b/fixtures index 52d5247fe4..b5eb9900ee 160000 --- a/fixtures +++ b/fixtures @@ -1 +1 @@ -Subproject commit 52d5247fe41f489c274e4254b151520bc3f20cc7 +Subproject commit b5eb9900ee2147b40d3e681fe86efa4fd693959a From 01deb50cdb8b02220d63e390751c38342e4863a7 Mon Sep 17 00:00:00 2001 From: voith Date: Wed, 2 Oct 2019 13:51:00 +0530 Subject: [PATCH 09/21] mark some tests as incorrect --- tests/json-fixtures/test_blockchain.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/json-fixtures/test_blockchain.py b/tests/json-fixtures/test_blockchain.py index cf88ee7789..e8f2b9cd1a 100644 --- a/tests/json-fixtures/test_blockchain.py +++ b/tests/json-fixtures/test_blockchain.py @@ -187,12 +187,14 @@ ('GeneralStateTests/stRevertTest/RevertInCreateInInit_d0g0v0.json', 'RevertInCreateInInit_d0g0v0_Byzantium'), # noqa: E501 ('GeneralStateTests/stRevertTest/RevertInCreateInInit_d0g0v0.json', 'RevertInCreateInInit_d0g0v0_Constantinople'), # noqa: E501 ('GeneralStateTests/stRevertTest/RevertInCreateInInit_d0g0v0.json', 'RevertInCreateInInit_d0g0v0_ConstantinopleFix'), # noqa: E501 + ('GeneralStateTests/stRevertTest/RevertInCreateInInit.json', 'RevertInCreateInInit_d0g0v0_Istanbul'), # noqa: E501 # The CREATE2 variant seems to have been derived from the one above - it, too, # has a "synthetic" state, on which py-evm flips. # * https://github.com/ethereum/py-evm/pull/1181#issuecomment-446330609 ('GeneralStateTests/stCreate2/RevertInCreateInInitCreate2_d0g0v0.json', 'RevertInCreateInInitCreate2_d0g0v0_Constantinople'), # noqa: E501 ('GeneralStateTests/stCreate2/RevertInCreateInInitCreate2_d0g0v0.json', 'RevertInCreateInInitCreate2_d0g0v0_ConstantinopleFix'), # noqa: E501 + ('GeneralStateTests/stCreate2/RevertInCreateInInitCreate2.json', 'RevertInCreateInInitCreate2_d0g0v0_Istanbul'), # noqa: E501 # Four variants have been specifically added to test a collision type # like the above; therefore, they fail in the same manner. @@ -206,6 +208,9 @@ ('GeneralStateTests/stSStoreTest/InitCollision_d0g0v0.json', 'InitCollision_d0g0v0_ConstantinopleFix'), # noqa: E501 ('GeneralStateTests/stSStoreTest/InitCollision_d1g0v0.json', 'InitCollision_d1g0v0_ConstantinopleFix'), # noqa: E501 ('GeneralStateTests/stSStoreTest/InitCollision_d3g0v0.json', 'InitCollision_d3g0v0_ConstantinopleFix'), # noqa: E501 + ('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d3g0v0_Istanbul'), # noqa: E501 } From b62018f2ed35a027dc3bb08f33b7462d520c45ed Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Fri, 4 Oct 2019 15:50:10 +0300 Subject: [PATCH 10/21] fixtures: switch to tag v7.0.0-beta.1. --- fixtures | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fixtures b/fixtures index b5eb9900ee..cfbcd15f91 160000 --- a/fixtures +++ b/fixtures @@ -1 +1 @@ -Subproject commit b5eb9900ee2147b40d3e681fe86efa4fd693959a +Subproject commit cfbcd15f91d4d6e1785d9cae5c5c37f47e8bad46 From 1bb3f2d930a6e3b9c7a665f018d6c56dbb340664 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Fri, 4 Oct 2019 16:46:55 +0300 Subject: [PATCH 11/21] EIP-161 collect_touched_accounts(): relax to geth's level. Since geth is now filling the tests, we have to do it like geth: Walk the entire computation tree, including branches that errored out (got REVERTed, OOGed, etc.), looking for wabbit RIPEMD160, _always_ collecting it. Skip everything else on errored branches. SQUASHED: tests: fix import when DEBUG2 logging. Logging utilities have moved to separate package, eth_utils. --- eth/vm/forks/spurious_dragon/_utils.py | 35 +++++++++++++++----------- tests/conftest.py | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/eth/vm/forks/spurious_dragon/_utils.py b/eth/vm/forks/spurious_dragon/_utils.py index 1a059a43b3..ac85371dbb 100644 --- a/eth/vm/forks/spurious_dragon/_utils.py +++ b/eth/vm/forks/spurious_dragon/_utils.py @@ -17,7 +17,8 @@ @to_set -def collect_touched_accounts(computation: BaseComputation) -> Iterable[Address]: +def collect_touched_accounts(computation: BaseComputation, + ancestor_had_error: bool = False) -> Iterable[Address]: """ Collect all of the accounts that *may* need to be deleted based on `EIP-161 `_. @@ -32,26 +33,30 @@ def collect_touched_accounts(computation: BaseComputation) -> Iterable[Address]: # collect those explicitly marked for deletion ("beneficiary" is of SELFDESTRUCT) for beneficiary in sorted(set(computation.accounts_to_delete.values())): - if computation.is_error and computation.is_origin_computation: - # Special case to account for geth+parity bug - # https://github.com/ethereum/EIPs/issues/716 - if beneficiary == THREE: - yield beneficiary + # Special case to account for geth+parity bug + # https://github.com/ethereum/EIPs/issues/716 + if beneficiary == THREE: + yield beneficiary + continue + if (computation.is_error and computation.is_origin_computation) or ancestor_had_error: continue else: yield beneficiary # collect account directly addressed if computation.msg.to != constants.CREATE_CONTRACT_ADDRESS: - if computation.is_error and computation.is_origin_computation: - # Special case to account for geth+parity bug - # https://github.com/ethereum/EIPs/issues/716 - if computation.msg.to == THREE: - yield computation.msg.to + if (computation.is_error and computation.is_origin_computation) or ancestor_had_error: + pass else: yield computation.msg.to - # recurse into nested computations if this one was successful - if not computation.is_error: - for child in computation.children: - yield from collect_touched_accounts(child) + # collect RIPEMD160 precompile even if ancestor computation had error, since we'll be + # skipping collection from children of errored-out computation otherwise + if computation.msg.to == THREE and (computation.is_error or ancestor_had_error): + yield computation.msg.to + + # recurse into nested computations + for child in computation.children: + yield from collect_touched_accounts( + child, + ancestor_had_error=(computation.is_error or ancestor_had_error)) diff --git a/tests/conftest.py b/tests/conftest.py index 87b8981e09..6f07d70a9e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -43,7 +43,7 @@ import datetime import logging import os -from eth.tools.logging import DEBUG2_LEVEL_NUM +from eth_utils.logging import DEBUG2_LEVEL_NUM @pytest.yield_fixture(autouse=True) def _file_logging(request): From aa86fc33658c86da5f557de80ab0db5ac5fc4021 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Sat, 5 Oct 2019 17:42:45 +0300 Subject: [PATCH 12/21] EIP-161: don't collect if nested computation errored. In the general non-RIPEMD160 case, if the computation errored, it would still be collected, because of the computation.is_origin_computation condition. --- eth/vm/forks/spurious_dragon/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/vm/forks/spurious_dragon/_utils.py b/eth/vm/forks/spurious_dragon/_utils.py index ac85371dbb..6d5d456af7 100644 --- a/eth/vm/forks/spurious_dragon/_utils.py +++ b/eth/vm/forks/spurious_dragon/_utils.py @@ -45,7 +45,7 @@ def collect_touched_accounts(computation: BaseComputation, # collect account directly addressed if computation.msg.to != constants.CREATE_CONTRACT_ADDRESS: - if (computation.is_error and computation.is_origin_computation) or ancestor_had_error: + if computation.is_error or ancestor_had_error: pass else: yield computation.msg.to From 86524e1fddebf75a9bfd27e2cf19164ca1340ed6 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Sat, 5 Oct 2019 18:14:10 +0300 Subject: [PATCH 13/21] EIP-161 collect_touched_accounts(): clean up. Now that `computation.is_origin_computation` no longer needs to be considered, it's fine to move the RIPEMD160 special-casing back into the `if` clause, because the condition is the same. --- eth/vm/forks/spurious_dragon/_utils.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/eth/vm/forks/spurious_dragon/_utils.py b/eth/vm/forks/spurious_dragon/_utils.py index 6d5d456af7..838c369b76 100644 --- a/eth/vm/forks/spurious_dragon/_utils.py +++ b/eth/vm/forks/spurious_dragon/_utils.py @@ -46,16 +46,15 @@ def collect_touched_accounts(computation: BaseComputation, # collect account directly addressed if computation.msg.to != constants.CREATE_CONTRACT_ADDRESS: if computation.is_error or ancestor_had_error: - pass + # collect RIPEMD160 precompile even if ancestor computation had error; + # otherwise, skip collection from children of errored-out computations; + # if there were no special-casing for RIPEMD160, we'd simply `pass` here + if computation.msg.to == THREE: + yield computation.msg.to else: yield computation.msg.to - # collect RIPEMD160 precompile even if ancestor computation had error, since we'll be - # skipping collection from children of errored-out computation otherwise - if computation.msg.to == THREE and (computation.is_error or ancestor_had_error): - yield computation.msg.to - - # recurse into nested computations + # recurse into nested computations (even errored ones, since looking for RIPEMD160) for child in computation.children: yield from collect_touched_accounts( child, From 414a7e2fc4d755c0e908353490f0a1d2acaad36f Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Sat, 5 Oct 2019 18:16:22 +0300 Subject: [PATCH 14/21] EIP-161 collect_touched_accounts(): remove computation.is_origin_computation when considering SELFDESTRUCT beneficiaries + refactor. `computation.is_origin_computation` has been present since the file was first introduced by @pipermerriam: https://github.com/ethereum/py-evm/commit/69a8385476983b4a060f307061ab258027b64eff#diff-28f7a9ef4182d19a95f4cccb1c073ef3 However, whether it's present or not has no effect on the tests passing. (Possibly, this is due to the case not being covered in the tests...) I can't find a place which explicitly states that beneficiary collection should only be skipped if the error happened in the origin computation. From the fact that having a `computation.is_origin_computation` in the next if-clause (`if computation.msg.to != constants.CREATE_CONTRACT_ADDRESS`) caused an error in a RevertPrecompiledTouchExactOOG test, it would seem that upstream (geth v1.9.6) does not consider this a necessary condition. Therefore, removing the condition here, too; and re-working the if-else clauses to look like they did previously (moving the RIPEMD160 special-casing as a sub-clause of the main clause). --- eth/vm/forks/spurious_dragon/_utils.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/eth/vm/forks/spurious_dragon/_utils.py b/eth/vm/forks/spurious_dragon/_utils.py index 838c369b76..d4684c014d 100644 --- a/eth/vm/forks/spurious_dragon/_utils.py +++ b/eth/vm/forks/spurious_dragon/_utils.py @@ -33,12 +33,11 @@ def collect_touched_accounts(computation: BaseComputation, # collect those explicitly marked for deletion ("beneficiary" is of SELFDESTRUCT) for beneficiary in sorted(set(computation.accounts_to_delete.values())): - # Special case to account for geth+parity bug - # https://github.com/ethereum/EIPs/issues/716 - if beneficiary == THREE: - yield beneficiary - continue - if (computation.is_error and computation.is_origin_computation) or ancestor_had_error: + if computation.is_error or ancestor_had_error: + # Special case to account for geth+parity bug + # https://github.com/ethereum/EIPs/issues/716 + if beneficiary == THREE: + yield beneficiary continue else: yield beneficiary From 758554dd80a5473fcfcb7e3c2e06660a303d0d3a Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Thu, 3 Oct 2019 22:44:26 +0300 Subject: [PATCH 15/21] tests: regenerate SLOWEST_TESTS. Used these napkin-quality scripts: https://gist.github.com/veox/02336c518f049cb749608657622d127f SQUASHED: tests: add Istanbul variants to existing SLOWEST_TESTS + CALLBlake2f_MaxRounds. GeneralStateTests/stTimeConsuming/CALLBlake2f_MaxRounds.json takes an awful long time - I was never able to run it fully. Beyond that, file names for some previous slow tests have changed, losing a `_dXgYvZ` qualifier. Not all have been reviewed! Just enough for the BlockchainTests to run Istanbul within half an hour on my workstation. tests: mark `randomStatetest94` as slow for Istanbul, too. Test passes, takes 22 seconds to run in py-evm (checked for Istanbul only), and indeed causes a +3 GiB memory use peak on my workstation - similar to `geth`, as reported here: https://gitter.im/ethereum/tests?at=5d8c6d25b38cc849bf1402fe (Not as time-consuming as some other tests, though.) --- tests/json-fixtures/test_blockchain.py | 224 +++++++++++-------------- 1 file changed, 97 insertions(+), 127 deletions(-) diff --git a/tests/json-fixtures/test_blockchain.py b/tests/json-fixtures/test_blockchain.py index e8f2b9cd1a..ee379f0817 100644 --- a/tests/json-fixtures/test_blockchain.py +++ b/tests/json-fixtures/test_blockchain.py @@ -41,136 +41,106 @@ # several runs, using top N percentile to populate the list incrementally. # Then sort alphabetically, to reduce churn (lines just being pushed up/down). SLOWEST_TESTS = { - ('GeneralStateTests/stAttackTest/ContractCreationSpam_d0g0v0.json', 'ContractCreationSpam_d0g0v0_Frontier'), # noqa: E501 - ('GeneralStateTests/stAttackTest/ContractCreationSpam_d0g0v0.json', 'ContractCreationSpam_d0g0v0_Homestead'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Call1024OOG_d0g0v0.json', 'Call1024OOG_d0g0v0_Frontier'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Callcode1024BalanceTooLow_d0g0v0.json', 'Callcode1024BalanceTooLow_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Callcode1024BalanceTooLow_d0g0v0.json', 'Callcode1024BalanceTooLow_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Callcode1024BalanceTooLow_d0g0v0.json', 'Callcode1024BalanceTooLow_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/Callcode1024OOG_d0g0v0.json', 'Callcode1024OOG_d0g0v0_Frontier'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/CallRecursiveBombPreCall_d0g0v0.json', 'CallRecursiveBombPreCall_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/CallRecursiveBombPreCall_d0g0v0.json', 'CallRecursiveBombPreCall_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/CallRecursiveBombPreCall_d0g0v0.json', 'CallRecursiveBombPreCall_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stCallCreateCallCodeTest/CallRecursiveBombPreCall_d0g0v0.json', 'CallRecursiveBombPreCall_d0g0v0_Frontier'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_EIP150'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_EIP150'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Callcode1024BalanceTooLow_d0g0v0.json', 'Callcode1024BalanceTooLow_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Callcode1024BalanceTooLow_d0g0v0.json', 'Callcode1024BalanceTooLow_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Callcode1024BalanceTooLow_d0g0v0.json', 'Callcode1024BalanceTooLow_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stChangedEIP150/Callcode1024BalanceTooLow_d0g0v0.json', 'Callcode1024BalanceTooLow_d0g0v0_EIP150'), # noqa: E501 - ('GeneralStateTests/stCreate2/Create2Recursive_d0g0v0.json', 'Create2Recursive_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stCreate2/Create2Recursive_d0g0v0.json', 'Create2Recursive_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stCreate2/Create2Recursive_d0g1v0.json', 'Create2Recursive_d0g1v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stCreate2/Create2Recursive_d0g1v0.json', 'Create2Recursive_d0g1v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Call1024BalanceTooLow_d0g0v0.json', 'Call1024BalanceTooLow_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Call1024OOG_d0g0v0.json', 'Call1024OOG_d0g0v0_Homestead'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Call1024PreCalls_d0g0v0.json', 'Call1024PreCalls_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/CallRecursiveBombPreCall_d0g0v0.json', 'CallRecursiveBombPreCall_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/CallRecursiveBombPreCall_d0g0v0.json', 'CallRecursiveBombPreCall_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/CallRecursiveBombPreCall_d0g0v0.json', 'CallRecursiveBombPreCall_d0g0v0_Homestead'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Delegatecall1024_d0g0v0.json', 'Delegatecall1024_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Delegatecall1024_d0g0v0.json', 'Delegatecall1024_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Delegatecall1024_d0g0v0.json', 'Delegatecall1024_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Delegatecall1024_d0g0v0.json', 'Delegatecall1024_d0g0v0_EIP150'), # noqa: E501 - ('GeneralStateTests/stDelegatecallTestHomestead/Delegatecall1024OOG_d0g0v0.json', 'Delegatecall1024OOG_d0g0v0_Homestead'), # noqa: E501 - ('GeneralStateTests/stRecursiveCreate/recursiveCreateReturnValue_d0g0v0.json', 'recursiveCreateReturnValue_d0g0v0_Homestead'), # noqa: E501 - ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert2_d0g0v0.json', 'LoopCallsDepthThenRevert2_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert2_d0g0v0.json', 'LoopCallsDepthThenRevert2_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert2_d0g0v0.json', 'LoopCallsDepthThenRevert2_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert3_d0g0v0.json', 'LoopCallsDepthThenRevert3_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert3_d0g0v0.json', 'LoopCallsDepthThenRevert3_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert3_d0g0v0.json', 'LoopCallsDepthThenRevert3_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert3_d0g0v0.json', 'LoopCallsDepthThenRevert3_d0g0v0_EIP158'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024BalanceTooLow2_d1g0v0.json', 'static_Call1024BalanceTooLow2_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024BalanceTooLow2_d1g0v0.json', 'static_Call1024BalanceTooLow2_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls2_d0g0v0.json', 'static_Call1024PreCalls2_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls2_d0g0v0.json', 'static_Call1024PreCalls2_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls2_d0g0v0.json', 'static_Call1024PreCalls2_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls2_d1g0v0.json', 'static_Call1024PreCalls2_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls2_d1g0v0.json', 'static_Call1024PreCalls2_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls2_d1g0v0.json', 'static_Call1024PreCalls2_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls3_d1g0v0.json', 'static_Call1024PreCalls3_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls3_d1g0v0.json', 'static_Call1024PreCalls3_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls3_d1g0v0.json', 'static_Call1024PreCalls3_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls_d1g0v0.json', 'static_Call1024PreCalls_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls_d1g0v0.json', 'static_Call1024PreCalls_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1024PreCalls_d1g0v0.json', 'static_Call1024PreCalls_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1MB1024Calldepth_d1g0v0.json', 'static_Call1MB1024Calldepth_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1MB1024Calldepth_d1g0v0.json', 'static_Call1MB1024Calldepth_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call1MB1024Calldepth_d1g0v0.json', 'static_Call1MB1024Calldepth_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_1_d1g0v0.json', 'static_Call50000bytesContract50_1_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_1_d1g0v0.json', 'static_Call50000bytesContract50_1_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_1_d1g0v0.json', 'static_Call50000bytesContract50_1_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_2_d1g0v0.json', 'static_Call50000bytesContract50_2_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_2_d1g0v0.json', 'static_Call50000bytesContract50_2_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_2_d1g0v0.json', 'static_Call50000bytesContract50_2_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_d0g0v0.json', 'static_Call50000_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_d0g0v0.json', 'static_Call50000_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_d0g0v0.json', 'static_Call50000_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_d1g0v0.json', 'static_Call50000_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_d1g0v0.json', 'static_Call50000_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_d1g0v0.json', 'static_Call50000_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_ecrec_d0g0v0.json', 'static_Call50000_ecrec_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_ecrec_d0g0v0.json', 'static_Call50000_ecrec_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_ecrec_d0g0v0.json', 'static_Call50000_ecrec_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_ecrec_d1g0v0.json', 'static_Call50000_ecrec_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_ecrec_d1g0v0.json', 'static_Call50000_ecrec_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_ecrec_d1g0v0.json', 'static_Call50000_ecrec_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity2_d0g0v0.json', 'static_Call50000_identity2_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity2_d0g0v0.json', 'static_Call50000_identity2_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity2_d0g0v0.json', 'static_Call50000_identity2_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity2_d1g0v0.json', 'static_Call50000_identity2_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity2_d1g0v0.json', 'static_Call50000_identity2_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity2_d1g0v0.json', 'static_Call50000_identity2_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity_d0g0v0.json', 'static_Call50000_identity_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity_d0g0v0.json', 'static_Call50000_identity_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity_d0g0v0.json', 'static_Call50000_identity_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity_d1g0v0.json', 'static_Call50000_identity_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity_d1g0v0.json', 'static_Call50000_identity_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_identity_d1g0v0.json', 'static_Call50000_identity_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_rip160_d0g0v0.json', 'static_Call50000_rip160_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_rip160_d0g0v0.json', 'static_Call50000_rip160_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_rip160_d0g0v0.json', 'static_Call50000_rip160_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_rip160_d1g0v0.json', 'static_Call50000_rip160_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_rip160_d1g0v0.json', 'static_Call50000_rip160_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_rip160_d1g0v0.json', 'static_Call50000_rip160_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_sha256_d0g0v0.json', 'static_Call50000_sha256_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_sha256_d0g0v0.json', 'static_Call50000_sha256_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_sha256_d0g0v0.json', 'static_Call50000_sha256_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_sha256_d1g0v0.json', 'static_Call50000_sha256_d1g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_sha256_d1g0v0.json', 'static_Call50000_sha256_d1g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Call50000_sha256_d1g0v0.json', 'static_Call50000_sha256_d1g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_LoopCallsThenRevert_d0g0v0.json', 'static_LoopCallsThenRevert_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_LoopCallsThenRevert_d0g0v0.json', 'static_LoopCallsThenRevert_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_LoopCallsThenRevert_d0g0v0.json', 'static_LoopCallsThenRevert_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_LoopCallsThenRevert_d0g1v0.json', 'static_LoopCallsThenRevert_d0g1v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_LoopCallsThenRevert_d0g1v0.json', 'static_LoopCallsThenRevert_d0g1v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_LoopCallsThenRevert_d0g1v0.json', 'static_LoopCallsThenRevert_d0g1v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Return50000_2_d0g0v0.json', 'static_Return50000_2_d0g0v0_Byzantium'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Return50000_2_d0g0v0.json', 'static_Return50000_2_d0g0v0_Constantinople'), # noqa: E501 - ('GeneralStateTests/stStaticCall/static_Return50000_2_d0g0v0.json', 'static_Return50000_2_d0g0v0_ConstantinopleFix'), # noqa: E501 - ('GeneralStateTests/stSystemOperationsTest/CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0.json', 'CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0_Frontier'), # noqa: E501 - ('GeneralStateTests/stSystemOperationsTest/CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0.json', 'CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0_Homestead'), # noqa: E501 - ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Homestead'), # noqa: E501 + ('GeneralStateTests/stAttackTest/ContractCreationSpam.json', 'ContractCreationSpam_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stCallCreateCallCodeTest/Call1024BalanceTooLow.json', 'Call1024BalanceTooLow_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stCallCreateCallCodeTest/Call1024PreCalls.json', 'Call1024PreCalls_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stCallCreateCallCodeTest/Call1024PreCalls.json', 'Call1024PreCalls_d0g1v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stCallCreateCallCodeTest/CallRecursiveBombPreCall.json', 'CallRecursiveBombPreCall_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stCallCreateCallCodeTest/Callcode1024BalanceTooLow.json', 'Callcode1024BalanceTooLow_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stChangedEIP150/Call1024BalanceTooLow.json', 'Call1024BalanceTooLow_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stChangedEIP150/Call1024PreCalls.json', 'Call1024PreCalls_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stChangedEIP150/Call1024PreCalls.json', 'Call1024PreCalls_d0g1v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stChangedEIP150/Callcode1024BalanceTooLow.json', 'Callcode1024BalanceTooLow_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stCreate2/Create2OnDepth1024.json', 'Create2OnDepth1024_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stCreate2/Create2Recursive.json', 'Create2Recursive_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stCreate2/Create2Recursive.json', 'Create2Recursive_d0g1v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stDelegatecallTestHomestead/Call1024BalanceTooLow.json', 'Call1024BalanceTooLow_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stDelegatecallTestHomestead/Call1024PreCalls.json', 'Call1024PreCalls_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stDelegatecallTestHomestead/Call1024PreCalls.json', 'Call1024PreCalls_d0g1v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stDelegatecallTestHomestead/Delegatecall1024.json', 'Delegatecall1024_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRandom/randomStatetest48.json', 'randomStatetest48_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRandom2/randomStatetest458.json', 'randomStatetest458_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRandom2/randomStatetest467.json', 'randomStatetest467_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRandom2/randomStatetest636.json', 'randomStatetest636_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRandom2/randomStatetest639.json', 'randomStatetest639_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRecursiveCreate/recursiveCreateReturnValue.json', 'recursiveCreateReturnValue_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert2.json', 'LoopCallsDepthThenRevert2_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRevertTest/LoopCallsDepthThenRevert3.json', 'LoopCallsDepthThenRevert3_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRevertTest/LoopCallsThenRevert.json', 'LoopCallsThenRevert_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stRevertTest/LoopCallsThenRevert.json', 'LoopCallsThenRevert_d0g1v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stShift/shiftCombinations.json', 'shiftCombinations_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call1024BalanceTooLow.json', 'static_Call1024BalanceTooLow_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call1024BalanceTooLow2.json', 'static_Call1024BalanceTooLow2_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call1024PreCalls.json', 'static_Call1024PreCalls_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call1024PreCalls2.json', 'static_Call1024PreCalls2_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call1024PreCalls2.json', 'static_Call1024PreCalls2_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call1024PreCalls3.json', 'static_Call1024PreCalls3_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call1MB1024Calldepth.json', 'static_Call1MB1024Calldepth_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000.json', 'static_Call50000_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000.json', 'static_Call50000_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000_ecrec.json', 'static_Call50000_ecrec_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000_ecrec.json', 'static_Call50000_ecrec_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000_identity.json', 'static_Call50000_identity_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000_identity.json', 'static_Call50000_identity_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000_identity2.json', 'static_Call50000_identity2_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000_identity2.json', 'static_Call50000_identity2_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000_rip160.json', 'static_Call50000_rip160_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000_rip160.json', 'static_Call50000_rip160_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_1.json', 'static_Call50000bytesContract50_1_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_1.json', 'static_Call50000bytesContract50_1_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_2.json', 'static_Call50000bytesContract50_2_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Call50000bytesContract50_2.json', 'static_Call50000bytesContract50_2_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_LoopCallsDepthThenRevert2.json', 'static_LoopCallsDepthThenRevert2_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_LoopCallsDepthThenRevert3.json', 'static_LoopCallsDepthThenRevert3_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_LoopCallsThenRevert.json', 'static_LoopCallsThenRevert_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_LoopCallsThenRevert.json', 'static_LoopCallsThenRevert_d0g1v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stStaticCall/static_Return50000_2.json', 'static_Return50000_2_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stSystemOperationsTest/CallRecursiveBomb0_OOG_atMaxCallDepth.json', 'CallRecursiveBomb0_OOG_atMaxCallDepth_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stTimeConsuming/CALLBlake2f_MaxRounds.json', 'CALLBlake2f_MaxRounds_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stTimeConsuming/static_Call50000_sha256.json', 'static_Call50000_sha256_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stTimeConsuming/static_Call50000_sha256.json', 'static_Call50000_sha256_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_one_point_fail.json', 'ecpairing_one_point_fail_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_three_point_fail_1.json', 'ecpairing_three_point_fail_1_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_three_point_match_1.json', 'ecpairing_three_point_match_1_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_three_point_match_1.json', 'ecpairing_three_point_match_1_d0g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_fail_1.json', 'ecpairing_two_point_fail_1_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_fail_2.json', 'ecpairing_two_point_fail_2_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_match_1.json', 'ecpairing_two_point_match_1_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_match_2.json', 'ecpairing_two_point_match_2_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_match_2.json', 'ecpairing_two_point_match_2_d0g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_match_3.json', 'ecpairing_two_point_match_3_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_match_3.json', 'ecpairing_two_point_match_3_d0g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_match_4.json', 'ecpairing_two_point_match_4_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_match_4.json', 'ecpairing_two_point_match_4_d0g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_oog.json', 'ecpairing_two_point_oog_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_point_oog.json', 'ecpairing_two_point_oog_d0g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_points_with_one_g2_zero.json', 'ecpairing_two_points_with_one_g2_zero_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/ecpairing_two_points_with_one_g2_zero.json', 'ecpairing_two_points_with_one_g2_zero_d0g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d0g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d0g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d1g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d1g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d2g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d2g3v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d3g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d4g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d5g0v0_Istanbul'), # noqa: E501 + ('GeneralStateTests/stZeroKnowledge/pairingTest.json', 'pairingTest_d5g3v0_Istanbul'), # noqa: E501 + ('InvalidBlocks/bcForgedTest/bcForkBlockTest.json', 'BlockWrongResetGas'), # noqa: E501 + ('InvalidBlocks/bcForgedTest/bcInvalidRLPTest.json', 'BLOCK_difficulty_TooLarge'), # noqa: E501 + ('InvalidBlocks/bcMultiChainTest/UncleFromSideChain.json', 'UncleFromSideChain_Constantinople'), # noqa: E501 + ('TransitionTests/bcHomesteadToDao/DaoTransactions.json', 'DaoTransactions'), # noqa: E501 + ('TransitionTests/bcHomesteadToDao/DaoTransactions_UncleExtradata.json', 'DaoTransactions_UncleExtradata'), # noqa: E501 + ('ValidBlocks/bcGasPricerTest/RPC_API_Test.json', 'RPC_API_Test_EIP150'), # noqa: E501 + ('ValidBlocks/bcGasPricerTest/RPC_API_Test.json', 'RPC_API_Test_EIP158'), # noqa: E501 + ('ValidBlocks/bcGasPricerTest/RPC_API_Test.json', 'RPC_API_Test_Frontier'), # noqa: E501 + ('ValidBlocks/bcGasPricerTest/RPC_API_Test.json', 'RPC_API_Test_Homestead'), # noqa: E501 + ('ValidBlocks/bcRandomBlockhashTest/randomStatetest284BC.json', 'randomStatetest284BC_Byzantium'), # noqa: E501 ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Byzantium'), # noqa: E501 ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Constantinople'), # noqa: E501 ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_ConstantinopleFix'), # noqa: E501 + ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Homestead'), # noqa: E501 + ('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Istanbul'), # noqa: E501 } From 6f6ec2ccd1cd02d65434b6ae66feff76fbbfd0d0 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Wed, 9 Oct 2019 17:15:11 +0300 Subject: [PATCH 16/21] misc: add "newsfragment". --- newsfragments/1858.misc.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 newsfragments/1858.misc.rst diff --git a/newsfragments/1858.misc.rst b/newsfragments/1858.misc.rst new file mode 100644 index 0000000000..3d3b71d024 --- /dev/null +++ b/newsfragments/1858.misc.rst @@ -0,0 +1,2 @@ +Update the upstream tests to `v7.0.0 beta.1 `_ +and address the two arising disagreements. From d55b1b8d918c2ca34b54d3db950ce50712539492 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Thu, 17 Oct 2019 15:26:20 +0300 Subject: [PATCH 17/21] tests: transition to correct VM (Petersburg, not Constantinople) in helper. --- eth/tools/fixtures/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/tools/fixtures/helpers.py b/eth/tools/fixtures/helpers.py index 8dfc1466b8..af3433400f 100644 --- a/eth/tools/fixtures/helpers.py +++ b/eth/tools/fixtures/helpers.py @@ -154,7 +154,7 @@ def chain_vm_configuration(fixture: Dict[str, Any]) -> Iterable[Tuple[int, Type[ elif network == 'ByzantiumToConstantinopleFixAt5': return ( (0, ByzantiumVM), - (5, ConstantinopleVM), + (5, PetersburgVM), ) else: raise ValueError(f"Network {network} does not match any known VM rules") From 376e4ffb890d1b96034bd8a1361befeaf91999ea Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Thu, 31 Oct 2019 14:07:00 +0200 Subject: [PATCH 18/21] setup,tests: use eth-typing v2.2.0 and fork definitions from it. --- setup.py | 2 +- tests/json-fixtures/test_transactions.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index b7486ce219..bf77d19ed5 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ "cached-property>=1.5.1,<2", "eth-bloom>=1.0.3,<2.0.0", "eth-keys>=0.2.1,<0.3.0", - "eth-typing>=2.0.0,<3.0.0", + "eth-typing>=2.2.0,<3.0.0", "eth-utils>=1.7.0,<2.0.0", "lru-dict>=1.1.6", "mypy_extensions>=0.4.1,<1.0.0", diff --git a/tests/json-fixtures/test_transactions.py b/tests/json-fixtures/test_transactions.py index c32571e0ae..37a2fa5c95 100644 --- a/tests/json-fixtures/test_transactions.py +++ b/tests/json-fixtures/test_transactions.py @@ -102,9 +102,9 @@ def fixture_transaction_class(fixture_data): return ByzantiumTransaction elif fork_name == ForkName.Constantinople: return ConstantinopleTransaction - elif fork_name == "ConstantinopleFix": + elif fork_name == ForkName.ConstantinopleFix: return PetersburgTransaction - elif fork_name == "Istanbul": + elif fork_name == ForkName.Istanbul: return IstanbulTransaction elif fork_name == ForkName.Metropolis: pytest.skip("Metropolis Transaction class has not been implemented") From 913b2a2f7749dccdda6de863efca67e0a5ab06f8 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Mon, 4 Nov 2019 15:12:15 +0200 Subject: [PATCH 19/21] eth/chains: set Istanbul mainnet block number to proper value. See Istanbul's hardfork meta: https://eips.ethereum.org/EIPS/eip-1679#activation --- eth/chains/mainnet/constants.py | 3 +-- newsfragments/1858.misc.rst | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/chains/mainnet/constants.py b/eth/chains/mainnet/constants.py index bc6b7bc964..dafe3c0305 100644 --- a/eth/chains/mainnet/constants.py +++ b/eth/chains/mainnet/constants.py @@ -46,5 +46,4 @@ # # Istanbul Block # -# FIXME: Replace this with the correct blocknumber when it's decided -ISTANBUL_MAINNET_BLOCK = BlockNumber(7280728) +ISTANBUL_MAINNET_BLOCK = BlockNumber(9069000) diff --git a/newsfragments/1858.misc.rst b/newsfragments/1858.misc.rst index 3d3b71d024..d30ada8e96 100644 --- a/newsfragments/1858.misc.rst +++ b/newsfragments/1858.misc.rst @@ -1,2 +1,3 @@ Update the upstream tests to `v7.0.0 beta.1 `_ and address the two arising disagreements. +Set Istanbul block for mainnet to 9069000. From 70bfec01eae388a66f420386ad46ecb8db501840 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Mon, 4 Nov 2019 15:36:05 +0200 Subject: [PATCH 20/21] misc: move "newsfragment" to `bugfix` section + update it. `towncrier --draft` shows that newsfragments in the `misc` category don't get their contents displayed, they just get listed with a link in the "Miscellaneous internal" section. This is unacceptable! Move to `bugfix` section instead. --- newsfragments/1858.bugfix.rst | 5 +++++ newsfragments/1858.misc.rst | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 newsfragments/1858.bugfix.rst delete mode 100644 newsfragments/1858.misc.rst diff --git a/newsfragments/1858.bugfix.rst b/newsfragments/1858.bugfix.rst new file mode 100644 index 0000000000..56e608e490 --- /dev/null +++ b/newsfragments/1858.bugfix.rst @@ -0,0 +1,5 @@ +Update the upstream tests to `v7.0.0 beta.1 `_ +and address the two arising disagreements on what accounts should be collected for state trie clearing (as per +`EIP-161 `_) if a nested call frame had an error. +Also, set Istanbul block for mainnet to 9069000, as per `EIP-1679 `_; +it was previously set to a placeholder value. diff --git a/newsfragments/1858.misc.rst b/newsfragments/1858.misc.rst deleted file mode 100644 index d30ada8e96..0000000000 --- a/newsfragments/1858.misc.rst +++ /dev/null @@ -1,3 +0,0 @@ -Update the upstream tests to `v7.0.0 beta.1 `_ -and address the two arising disagreements. -Set Istanbul block for mainnet to 9069000. From f1651af463780413f96fc53b1251f7ecf6a38067 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Mon, 4 Nov 2019 15:43:31 +0200 Subject: [PATCH 21/21] eth/chains: add Goerli Istanbul block number. --- eth/chains/goerli/constants.py | 5 +++++ newsfragments/1858.bugfix.rst | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/eth/chains/goerli/constants.py b/eth/chains/goerli/constants.py index 036b645e2c..cd73543fa2 100644 --- a/eth/chains/goerli/constants.py +++ b/eth/chains/goerli/constants.py @@ -9,3 +9,8 @@ # Petersburg # PETERSBURG_GOERLI_BLOCK = BlockNumber(0) + +# +# Istanbul +# +ISTANBUL_GOERLI_BLOCK = BlockNumber(1561651) diff --git a/newsfragments/1858.bugfix.rst b/newsfragments/1858.bugfix.rst index 56e608e490..3426d48bc1 100644 --- a/newsfragments/1858.bugfix.rst +++ b/newsfragments/1858.bugfix.rst @@ -1,5 +1,5 @@ -Update the upstream tests to `v7.0.0 beta.1 `_ +Update upstream test fixtures to `v7.0.0 beta.1 `_ and address the two arising disagreements on what accounts should be collected for state trie clearing (as per `EIP-161 `_) if a nested call frame had an error. -Also, set Istanbul block for mainnet to 9069000, as per `EIP-1679 `_; -it was previously set to a placeholder value. +Also, set Istanbul block number for mainnet to 9069000, and for Görli to 1561651, as per +`EIP-1679 `_.