diff --git a/newsfragments/1409.feature.rst b/newsfragments/1409.feature.rst new file mode 100644 index 0000000000..26bed23715 --- /dev/null +++ b/newsfragments/1409.feature.rst @@ -0,0 +1 @@ +Upgrade Py-EVM and add support for Muir Glacier fork \ No newline at end of file diff --git a/setup.py b/setup.py index dc279abef2..ae78605aa7 100644 --- a/setup.py +++ b/setup.py @@ -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 = { diff --git a/trinity/_utils/eip1085.py b/trinity/_utils/eip1085.py index 002ed15c18..ef637a9f88 100644 --- a/trinity/_utils/eip1085.py +++ b/trinity/_utils/eip1085.py @@ -54,6 +54,7 @@ ConstantinopleVM, PetersburgVM, IstanbulVM, + MuirGlacierVM, ) @@ -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 @@ -178,6 +181,7 @@ def _filter_vm_config(vm_config: VMConfiguration) -> Iterable[VMFork]: ConstantinopleVM, PetersburgVM, IstanbulVM, + MuirGlacierVM, ) diff --git a/trinity/assets/eip1085.schema.json b/trinity/assets/eip1085.schema.json index a6cf18e49c..bb6a6c44d3 100644 --- a/trinity/assets/eip1085.schema.json +++ b/trinity/assets/eip1085.schema.json @@ -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", diff --git a/trinity/assets/eip1085/mainnet.json b/trinity/assets/eip1085/mainnet.json index 719a7862c6..358680d9d7 100644 --- a/trinity/assets/eip1085/mainnet.json +++ b/trinity/assets/eip1085/mainnet.json @@ -15,6 +15,7 @@ "byzantiumForkBlock":"0x42ae50", "petersburgForkBlock":"0x6f1580", "istanbulForkBlock": "0x8a61c8", + "muirglacierForkBlock": "0x8c6180", "chainId":"0x1", "homesteadForkBlock":"0x118c30", "miningMethod":"ethash" diff --git a/trinity/assets/eip1085/ropsten.json b/trinity/assets/eip1085/ropsten.json index d242125bd5..c16b5bba10 100644 --- a/trinity/assets/eip1085/ropsten.json +++ b/trinity/assets/eip1085/ropsten.json @@ -16,6 +16,7 @@ "constantinopleForkBlock":"0x408b70", "petersburgForkBlock":"0x4b5e82", "istanbulForkBlock":"0x62f756", + "muirglacierForkBlock": "0x6c993d", "miningMethod":"ethash" }, "version":"1" diff --git a/trinity/components/builtin/tx_pool/component.py b/trinity/components/builtin/tx_pool/component.py index f653285ce8..0d9a1e17c5 100644 --- a/trinity/components/builtin/tx_pool/component.py +++ b/trinity/components/builtin/tx_pool/component.py @@ -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 @@ -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") diff --git a/trinity/tools/chain.py b/trinity/tools/chain.py index 7f45ae26bb..14d938553b 100644 --- a/trinity/tools/chain.py +++ b/trinity/tools/chain.py @@ -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 @@ -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