Skip to content

Commit b663aca

Browse files
authored
Merge pull request #1971 from carver/tests-upgrade
Upgrade ethereum/tests to v7.0.1
2 parents aac86ec + 2cc581f commit b663aca

File tree

9 files changed

+40
-5
lines changed

9 files changed

+40
-5
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ jobs:
4646
- image: circleci/python:3.6
4747
environment:
4848
TOXENV: py36-benchmark
49+
py36-native-blockchain-berlin:
50+
<<: *common
51+
docker:
52+
- image: circleci/python:3.6
53+
environment:
54+
TOXENV: py36-native-blockchain-berlin
4955
py36-native-blockchain-byzantium:
5056
<<: *common
5157
docker:

eth/tools/fixtures/helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
HomesteadVM as BaseHomesteadVM,
4747
SpuriousDragonVM,
4848
IstanbulVM,
49+
BerlinVM,
4950
)
5051

5152

@@ -126,6 +127,10 @@ def chain_vm_configuration(fixture: Dict[str, Any]) -> Iterable[Tuple[int, Type[
126127
return (
127128
(0, IstanbulVM),
128129
)
130+
elif network == 'Berlin':
131+
return (
132+
(0, BerlinVM),
133+
)
129134
elif network == 'FrontierToHomesteadAt5':
130135
HomesteadVM = BaseHomesteadVM.configure(support_dao_fork=False)
131136
return (

eth/vm/forks/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@
2525
from .muir_glacier import ( # noqa: F401
2626
MuirGlacierVM,
2727
)
28+
from .berlin import ( # noqa: F401
29+
BerlinVM,
30+
)

fixtures

newsfragments/1971.internal.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Upgrade tests fixtures to v7.0.1, with Berlin tests (but not enabled in CI). Marked an Istanbul test
2+
as disabled, pending feedback from testing team. Skipped several slow tests in Istanbul. Added
3+
pytest-timeout to limit annoyance of new slow tests.

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ python_paths= .
44
xfail_strict=true
55
log_format = %(levelname)8s %(asctime)s %(filename)20s %(message)s
66
log_date_format = %m-%d %H:%M:%S
7+
timeout = 300
78

89
[pytest-watch]
910
runner= pytest --failed-first --maxfail=1

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"pytest>=5.1.3,<6",
3636
"pytest-asyncio>=0.10.0,<0.11",
3737
"pytest-cov==2.5.1",
38+
"pytest-timeout>=1.4.2,<2",
3839
"pytest-watch>=4.1.0,<5",
3940
"pytest-xdist==1.31.0",
4041
],

tests/json-fixtures/test_blockchain.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@
141141
('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_ConstantinopleFix'), # noqa: E501
142142
('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Homestead'), # noqa: E501
143143
('ValidBlocks/bcStateTests/randomStatetest94.json', 'randomStatetest94_Istanbul'), # noqa: E501
144+
('ValidBlocks/VMTests/vmPerformance/loop-add-10M.json', 'loop-add-10M_Istanbul'),
145+
('ValidBlocks/VMTests/vmPerformance/loop-divadd-10M.json', 'loop-divadd-10M_Istanbul'),
146+
('ValidBlocks/VMTests/vmPerformance/loop-divadd-unr100-10M.json', 'loop-divadd-unr100-10M_Istanbul'), # noqa: E501
147+
('ValidBlocks/VMTests/vmPerformance/loop-exp-16b-100k.json', 'loop-exp-16b-100k_Istanbul'),
148+
('ValidBlocks/VMTests/vmPerformance/loop-exp-1b-1M.json', 'loop-exp-1b-1M_Istanbul'),
149+
('ValidBlocks/VMTests/vmPerformance/loop-exp-32b-100k.json', 'loop-exp-32b-100k_Istanbul'),
150+
('ValidBlocks/VMTests/vmPerformance/loop-exp-nop-1M.json', 'loop-exp-nop-1M_Istanbul'),
151+
('ValidBlocks/VMTests/vmPerformance/loop-mul.json', 'loop-mul_Istanbul'),
152+
('ValidBlocks/VMTests/vmPerformance/loop-mulmod-2M.json', 'loop-mulmod-2M_Istanbul'),
144153
}
145154

146155

@@ -181,12 +190,18 @@
181190
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d0g0v0_Istanbul'), # noqa: E501
182191
# Perhaps even stranger, d2 starts failing again after fixing a long-hidden consensus bug
183192
# but not in Constantinople, only in Istanbul.
184-
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d2g0v0_Istanbul'), # noqa: E501
185-
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d1g0v0_Istanbul'), # noqa: E501
193+
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d2g0v0_Istanbul'),
194+
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d1g0v0_Istanbul'),
186195
# The d2 variant started failing again after fixing a long-hidden consensus bug
187196
# but only in Istanbul, not in Constantinople.
188-
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d2g0v0_Istanbul'), # noqa: E501
189-
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d3g0v0_Istanbul'), # noqa: E501
197+
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d2g0v0_Istanbul'),
198+
('GeneralStateTests/stSStoreTest/InitCollision.json', 'InitCollision_d3g0v0_Istanbul'),
199+
# It's not clear how or why this test changed. It doesn't make sense that it only tests Istanbul
200+
# either. See: https://github.com/ethereum/tests/issues/787
201+
# The test seems to claim to test what happens if the uncle timestamp is the same as
202+
# the block, but the RLP doesn't encode a matching timestamp.
203+
('InvalidBlocks/bcUncleHeaderValidity/incorrectUncleTimestamp.json', 'incorrectUncleTimestamp_Istanbul'), # noqa: E501
204+
('InvalidBlocks/bcUncleHeaderValidity/incorrectUncleTimestamp.json', 'incorrectUncleTimestamp_Berlin'), # noqa: E501
190205
}
191206

192207

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ commands=
3434
native-blockchain-constantinople: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Constantinople}
3535
native-blockchain-petersburg: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork ConstantinopleFix}
3636
native-blockchain-istanbul: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Istanbul}
37+
native-blockchain-berlin: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Berlin}
3738
native-blockchain-metropolis: pytest {posargs:tests/json-fixtures/test_blockchain.py --fork Metropolis}
3839
native-blockchain-transition: pytest {posargs:tests/json-fixtures/test_blockchain.py -k BlockchainTests/TransitionTests}
3940
lint: flake8 {toxinidir}/eth {toxinidir}/tests {toxinidir}/scripts

0 commit comments

Comments
 (0)