Skip to content

Commit 935b73c

Browse files
committed
Activate PetersburgVM for Mainnet and Ropsten
1 parent 4922589 commit 935b73c

File tree

6 files changed

+39
-7
lines changed

6 files changed

+39
-7
lines changed

eth/chains/mainnet/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .constants import (
1414
MAINNET_CHAIN_ID,
1515
BYZANTIUM_MAINNET_BLOCK,
16-
CONSTANTINOPLE_MAINNET_BLOCK,
16+
PETERSBURG_MAINNET_BLOCK,
1717
TANGERINE_WHISTLE_MAINNET_BLOCK,
1818
HOMESTEAD_MAINNET_BLOCK,
1919
SPURIOUS_DRAGON_MAINNET_BLOCK,
@@ -29,9 +29,9 @@
2929
from eth.vm.base import BaseVM # noqa: F401
3030
from eth.vm.forks import (
3131
ByzantiumVM,
32-
ConstantinopleVM,
3332
FrontierVM,
3433
HomesteadVM,
34+
PetersburgVM,
3535
SpuriousDragonVM,
3636
TangerineWhistleVM,
3737
)
@@ -80,15 +80,15 @@ class MainnetHomesteadVM(MainnetDAOValidatorVM):
8080
TANGERINE_WHISTLE_MAINNET_BLOCK,
8181
SPURIOUS_DRAGON_MAINNET_BLOCK,
8282
BYZANTIUM_MAINNET_BLOCK,
83-
CONSTANTINOPLE_MAINNET_BLOCK,
83+
PETERSBURG_MAINNET_BLOCK,
8484
)
8585
MAINNET_VMS = (
8686
FrontierVM,
8787
MainnetHomesteadVM,
8888
TangerineWhistleVM,
8989
SpuriousDragonVM,
9090
ByzantiumVM,
91-
ConstantinopleVM,
91+
PetersburgVM,
9292
)
9393

9494
MAINNET_VM_CONFIGURATION = tuple(zip(MAINNET_FORK_BLOCKS, MAINNET_VMS))

eth/chains/mainnet/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
BYZANTIUM_MAINNET_BLOCK = BlockNumber(4370000)
4040

4141
#
42-
# Constantinople Block
42+
# Petersburg Block
4343
#
44-
CONSTANTINOPLE_MAINNET_BLOCK = BlockNumber(9876543210)
44+
PETERSBURG_MAINNET_BLOCK = BlockNumber(7280000)

eth/chains/ropsten/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .constants import (
55
BYZANTIUM_ROPSTEN_BLOCK,
66
CONSTANTINOPLE_ROPSTEN_BLOCK,
7+
PETERSBURG_ROPSTEN_BLOCK,
78
ROPSTEN_CHAIN_ID,
89
SPURIOUS_DRAGON_ROPSTEN_BLOCK,
910
TANGERINE_WHISTLE_ROPSTEN_BLOCK,
@@ -16,6 +17,7 @@
1617
from eth.vm.forks import (
1718
ByzantiumVM,
1819
ConstantinopleVM,
20+
PetersburgVM,
1921
SpuriousDragonVM,
2022
TangerineWhistleVM,
2123
)
@@ -27,6 +29,7 @@
2729
(SPURIOUS_DRAGON_ROPSTEN_BLOCK, SpuriousDragonVM),
2830
(BYZANTIUM_ROPSTEN_BLOCK, ByzantiumVM),
2931
(CONSTANTINOPLE_ROPSTEN_BLOCK, ConstantinopleVM),
32+
(PETERSBURG_ROPSTEN_BLOCK, PetersburgVM),
3033
)
3134

3235

eth/chains/ropsten/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,9 @@
4040
# Constantinople
4141
#
4242
CONSTANTINOPLE_ROPSTEN_BLOCK = BlockNumber(4230000)
43+
44+
45+
#
46+
# Petersburg
47+
#
48+
PETERSBURG_ROPSTEN_BLOCK = BlockNumber(9999999)

eth/vm/forks/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
from .constantinople import ( # noqa: F401
1717
ConstantinopleVM,
1818
)
19+
from .petersburg import ( # noqa: F401
20+
PetersburgVM,
21+
)

tests/core/tester/test_generate_vm_configuration.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Forks(enum.Enum):
1616
SpuriousDragon = 3
1717
Byzantium = 4
1818
Constantinople = 5
19+
Petersburg = 6
1920

2021

2122
class CustomFrontierVM(FrontierVM):
@@ -28,7 +29,7 @@ class CustomFrontierVM(FrontierVM):
2829
(
2930
tuple(),
3031
{},
31-
((0, Forks.Constantinople),),
32+
((0, Forks.Petersburg),),
3233
),
3334
(
3435
((0, 'tangerine-whistle'), (1, 'spurious-dragon')),
@@ -109,6 +110,23 @@ class CustomFrontierVM(FrontierVM):
109110
(3, Forks.Byzantium),
110111
),
111112
),
113+
(
114+
(
115+
(0, 'frontier'),
116+
(1, 'homestead'),
117+
(2, 'tangerine-whistle'),
118+
(3, 'byzantium'),
119+
(5, 'petersburg')
120+
),
121+
{},
122+
(
123+
(0, Forks.Frontier),
124+
(1, Forks.Homestead),
125+
(2, Forks.TangerineWhistle),
126+
(3, Forks.Byzantium),
127+
(5, Forks.Petersburg),
128+
),
129+
),
112130
),
113131
)
114132
def test_generate_vm_configuration(args, kwargs, expected):
@@ -142,6 +160,8 @@ def test_generate_vm_configuration(args, kwargs, expected):
142160
assert 'Byzantium' in left_vm.__name__
143161
elif right_vm == Forks.Constantinople:
144162
assert 'Constantinople' in left_vm.__name__
163+
elif right_vm == Forks.Petersburg:
164+
assert 'Petersburg' in left_vm.__name__
145165
elif right_vm == Forks.Custom:
146166
assert 'CustomFrontier' in left_vm.__name__
147167
else:

0 commit comments

Comments
 (0)