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

Add support for Muir Glacier fork #1409

Merged
merged 1 commit into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/1409.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade Py-EVM and add support for Muir Glacier fork
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import re
from setuptools import setup, find_packages

PYEVM_DEPENDENCY = "py-evm==0.3.0a11"
PYEVM_DEPENDENCY = "py-evm==0.3.0a12"


deps = {
Expand Down
4 changes: 4 additions & 0 deletions trinity/_utils/eip1085.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
ConstantinopleVM,
PetersburgVM,
IstanbulVM,
MuirGlacierVM,
)


Expand Down Expand Up @@ -155,6 +156,8 @@ def _extract_vm_config(vm_config: Dict[str, str]) -> Iterable[VMFork]:
yield hex_to_block_number(vm_config['petersburgForkBlock']), PetersburgVM
if 'istanbulForkBlock' in vm_config.keys():
yield hex_to_block_number(vm_config['istanbulForkBlock']), IstanbulVM
if 'muirglacierForkBlock' in vm_config.keys():
yield hex_to_block_number(vm_config['muirglacierForkBlock']), MuirGlacierVM


@to_tuple
Expand All @@ -178,6 +181,7 @@ def _filter_vm_config(vm_config: VMConfiguration) -> Iterable[VMFork]:
ConstantinopleVM,
PetersburgVM,
IstanbulVM,
MuirGlacierVM,
)


Expand Down
5 changes: 5 additions & 0 deletions trinity/assets/eip1085.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
"type": "string",
"pattern": "^0x([0-9a-fA-F])+$"
},
"muirglacierForkBlock": {
"title": "Block number for the Muir Glacier fork",
"type": "string",
"pattern": "^0x([0-9a-fA-F])+$"
},
"chainId": {
"title": "The EIP155 chain ID",
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions trinity/assets/eip1085/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"byzantiumForkBlock":"0x42ae50",
"petersburgForkBlock":"0x6f1580",
"istanbulForkBlock": "0x8a61c8",
"muirglacierForkBlock": "0x8c6180",
"chainId":"0x1",
"homesteadForkBlock":"0x118c30",
"miningMethod":"ethash"
Expand Down
1 change: 1 addition & 0 deletions trinity/assets/eip1085/ropsten.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"constantinopleForkBlock":"0x408b70",
"petersburgForkBlock":"0x4b5e82",
"istanbulForkBlock":"0x62f756",
"muirglacierForkBlock": "0x6c993d",
"miningMethod":"ethash"
},
"version":"1"
Expand Down
8 changes: 4 additions & 4 deletions trinity/components/builtin/tx_pool/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from async_service import run_asyncio_service
from eth_utils import ValidationError
from eth.chains.mainnet import PETERSBURG_MAINNET_BLOCK
from eth.chains.ropsten import PETERSBURG_ROPSTEN_BLOCK
from eth.chains.mainnet import ISTANBUL_MAINNET_BLOCK
from eth.chains.ropsten import ISTANBUL_ROPSTEN_BLOCK
from lahja import EndpointAPI

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

if boot_info.trinity_config.network_id == MAINNET_NETWORK_ID:
validator = DefaultTransactionValidator(chain, PETERSBURG_MAINNET_BLOCK)
validator = DefaultTransactionValidator(chain, ISTANBUL_MAINNET_BLOCK)
elif boot_info.trinity_config.network_id == ROPSTEN_NETWORK_ID:
validator = DefaultTransactionValidator(chain, PETERSBURG_ROPSTEN_BLOCK)
validator = DefaultTransactionValidator(chain, ISTANBUL_ROPSTEN_BLOCK)
else:
raise Exception("This code path should not be reachable")

Expand Down
4 changes: 2 additions & 2 deletions trinity/tools/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
)
from eth.constants import GENESIS_BLOCK_NUMBER
from eth.vm.forks.byzantium import ByzantiumVM
from eth.vm.forks.istanbul import IstanbulVM
from eth.vm.forks.muir_glacier import MuirGlacierVM

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


Expand Down