Skip to content

Commit ab9349a

Browse files
committed
Add chain and VM builder methods for Berlin
Passes all the new Berlin tests
1 parent 9c9eb17 commit ab9349a

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

eth/chains/mainnet/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from .constants import (
1414
MAINNET_CHAIN_ID,
15+
BERLIN_MAINNET_BLOCK,
1516
BYZANTIUM_MAINNET_BLOCK,
1617
PETERSBURG_MAINNET_BLOCK,
1718
ISTANBUL_MAINNET_BLOCK,
@@ -33,6 +34,7 @@
3334
)
3435
from eth.rlp.headers import BlockHeader
3536
from eth.vm.forks import (
37+
BerlinVM,
3638
ByzantiumVM,
3739
FrontierVM,
3840
HomesteadVM,
@@ -94,6 +96,7 @@ class MainnetHomesteadVM(MainnetDAOValidatorVM):
9496
PETERSBURG_MAINNET_BLOCK,
9597
ISTANBUL_MAINNET_BLOCK,
9698
MUIR_GLACIER_MAINNET_BLOCK,
99+
BERLIN_MAINNET_BLOCK,
97100
)
98101
MAINNET_VMS = (
99102
FrontierVM,
@@ -104,6 +107,7 @@ class MainnetHomesteadVM(MainnetDAOValidatorVM):
104107
PetersburgVM,
105108
IstanbulVM,
106109
MuirGlacierVM,
110+
BerlinVM,
107111
)
108112

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

eth/chains/mainnet/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,8 @@
5252
# Muir Glacier Block
5353
#
5454
MUIR_GLACIER_MAINNET_BLOCK = BlockNumber(9200000)
55+
56+
#
57+
# Berlin Block
58+
#
59+
BERLIN_MAINNET_BLOCK = BlockNumber(12244000)

eth/tools/builder/chain/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
petersburg_at,
2727
istanbul_at,
2828
muir_glacier_at,
29+
berlin_at,
2930
latest_mainnet_at,
3031
)
3132

eth/tools/builder/chain/builders.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
PetersburgVM,
7373
IstanbulVM,
7474
MuirGlacierVM,
75+
BerlinVM,
7576
)
7677

7778

@@ -235,6 +236,7 @@ def dao_fork_at(dao_fork_block_number: BlockNumber,
235236
petersburg_at = fork_at(PetersburgVM)
236237
istanbul_at = fork_at(IstanbulVM)
237238
muir_glacier_at = fork_at(MuirGlacierVM)
239+
berlin_at = fork_at(BerlinVM)
238240

239241
latest_mainnet_at = muir_glacier_at
240242

newsfragments/1977.internal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Make sure Berlin is tested across all core tests. (also patched in some missing Muir Glacier ones)

tests/core/tester/test_generate_vm_configuration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class CustomFrontierVM(FrontierVM):
3232
(
3333
tuple(),
3434
{},
35-
((0, Forks.MuirGlacier),),
35+
((0, Forks.Berlin),),
3636
),
3737
(
3838
((0, 'tangerine-whistle'), (1, 'spurious-dragon')),
@@ -132,7 +132,8 @@ class CustomFrontierVM(FrontierVM):
132132
(3, Forks.Byzantium),
133133
(5, Forks.Petersburg),
134134
(6, Forks.Istanbul),
135-
(7, Forks.Berlin),
135+
(7, Forks.MuirGlacier),
136+
(8, Forks.Berlin),
136137
),
137138
),
138139
),

0 commit comments

Comments
 (0)