Skip to content
This repository was archived by the owner on Jul 1, 2021. It is now read-only.

Commit 96e8455

Browse files
committed
Add support for Muir Glacier fork
1 parent 872c4d8 commit 96e8455

File tree

8 files changed

+19
-7
lines changed

8 files changed

+19
-7
lines changed

newsfragments/1409.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade Py-EVM and add support for Muir Glacier fork

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
from setuptools import setup, find_packages
77

8-
PYEVM_DEPENDENCY = "py-evm==0.3.0a11"
8+
PYEVM_DEPENDENCY = "py-evm==0.3.0a12"
99

1010

1111
deps = {

trinity/_utils/eip1085.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
ConstantinopleVM,
5555
PetersburgVM,
5656
IstanbulVM,
57+
MuirGlacierVM,
5758
)
5859

5960

@@ -155,6 +156,8 @@ def _extract_vm_config(vm_config: Dict[str, str]) -> Iterable[VMFork]:
155156
yield hex_to_block_number(vm_config['petersburgForkBlock']), PetersburgVM
156157
if 'istanbulForkBlock' in vm_config.keys():
157158
yield hex_to_block_number(vm_config['istanbulForkBlock']), IstanbulVM
159+
if 'muirglacierForkBlock' in vm_config.keys():
160+
yield hex_to_block_number(vm_config['muirglacierForkBlock']), MuirGlacierVM
158161

159162

160163
@to_tuple
@@ -178,6 +181,7 @@ def _filter_vm_config(vm_config: VMConfiguration) -> Iterable[VMFork]:
178181
ConstantinopleVM,
179182
PetersburgVM,
180183
IstanbulVM,
184+
MuirGlacierVM,
181185
)
182186

183187

trinity/assets/eip1085.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
"type": "string",
8383
"pattern": "^0x([0-9a-fA-F])+$"
8484
},
85+
"muirglacierForkBlock": {
86+
"title": "Block number for the Muir Glacier fork",
87+
"type": "string",
88+
"pattern": "^0x([0-9a-fA-F])+$"
89+
},
8590
"chainId": {
8691
"title": "The EIP155 chain ID",
8792
"type": "string",

trinity/assets/eip1085/mainnet.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"byzantiumForkBlock":"0x42ae50",
1616
"petersburgForkBlock":"0x6f1580",
1717
"istanbulForkBlock": "0x8a61c8",
18+
"muirglacierForkBlock": "0x8c6180",
1819
"chainId":"0x1",
1920
"homesteadForkBlock":"0x118c30",
2021
"miningMethod":"ethash"

trinity/assets/eip1085/ropsten.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"constantinopleForkBlock":"0x408b70",
1717
"petersburgForkBlock":"0x4b5e82",
1818
"istanbulForkBlock":"0x62f756",
19+
"muirglacierForkBlock": "0x6c993d",
1920
"miningMethod":"ethash"
2021
},
2122
"version":"1"

trinity/components/builtin/tx_pool/component.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
from async_service import run_asyncio_service
88
from eth_utils import ValidationError
9-
from eth.chains.mainnet import PETERSBURG_MAINNET_BLOCK
10-
from eth.chains.ropsten import PETERSBURG_ROPSTEN_BLOCK
9+
from eth.chains.mainnet import ISTANBUL_MAINNET_BLOCK
10+
from eth.chains.ropsten import ISTANBUL_ROPSTEN_BLOCK
1111
from lahja import EndpointAPI
1212

1313
from trinity.boot_info import BootInfo
@@ -80,9 +80,9 @@ async def do_run(cls, boot_info: BootInfo, event_bus: EndpointAPI) -> None:
8080
chain = chain_config.full_chain_class(db)
8181

8282
if boot_info.trinity_config.network_id == MAINNET_NETWORK_ID:
83-
validator = DefaultTransactionValidator(chain, PETERSBURG_MAINNET_BLOCK)
83+
validator = DefaultTransactionValidator(chain, ISTANBUL_MAINNET_BLOCK)
8484
elif boot_info.trinity_config.network_id == ROPSTEN_NETWORK_ID:
85-
validator = DefaultTransactionValidator(chain, PETERSBURG_ROPSTEN_BLOCK)
85+
validator = DefaultTransactionValidator(chain, ISTANBUL_ROPSTEN_BLOCK)
8686
else:
8787
raise Exception("This code path should not be reachable")
8888

trinity/tools/chain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
)
55
from eth.constants import GENESIS_BLOCK_NUMBER
66
from eth.vm.forks.byzantium import ByzantiumVM
7-
from eth.vm.forks.istanbul import IstanbulVM
7+
from eth.vm.forks.muir_glacier import MuirGlacierVM
88

99
from trinity.chains.coro import AsyncChainMixin
1010
from trinity.chains.full import FullChain
@@ -27,7 +27,7 @@ class LatestTestChain(FullChain):
2727
A test chain that uses the most recent mainnet VM from block 0.
2828
That means the VM will explicitly change when a new network upgrade is locked in.
2929
"""
30-
vm_configuration = ((GENESIS_BLOCK_NUMBER, IstanbulVM),)
30+
vm_configuration = ((GENESIS_BLOCK_NUMBER, MuirGlacierVM),)
3131
network_id = 999
3232

3333

0 commit comments

Comments
 (0)