From 160d69b52b4f20891ffee91c51a346937e8eb78c Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 28 Jul 2022 18:06:54 +0800 Subject: [PATCH 1/3] Update chain settings 1. Add Goerli, which is an alias of Prater 2. Remove Kintsugi --- staking_deposit/settings.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 61de6a08..61045d3e 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -10,30 +10,30 @@ class BaseChainSetting(NamedTuple): MAINNET = 'mainnet' +ROPSTEN = 'ropsten' +GOERLI = 'goerli' PRATER = 'prater' -KINTSUGI = 'kintsugi' KILN = 'kiln' -ROPSTEN = 'ropsten' # Mainnet setting MainnetSetting = BaseChainSetting(NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000')) # Ropsten setting RopstenSetting = BaseChainSetting(NETWORK_NAME=ROPSTEN, GENESIS_FORK_VERSION=bytes.fromhex('80000069')) -# Testnet (spec v1.0.1) -PraterSetting = BaseChainSetting(NETWORK_NAME=PRATER, GENESIS_FORK_VERSION=bytes.fromhex('00001020')) -# Merge Testnet (spec v1.1.4) -KintsugiSetting = BaseChainSetting(NETWORK_NAME=KINTSUGI, GENESIS_FORK_VERSION=bytes.fromhex('60000069')) +# GOERLI (PRATER is alias) +_GOERLI_GENESIS_FORK_VERSION = bytes.fromhex('00001020') +GoerliSetting = BaseChainSetting(NETWORK_NAME=GOERLI, GENESIS_FORK_VERSION=_GOERLI_GENESIS_FORK_VERSION) +PraterSetting = BaseChainSetting(NETWORK_NAME=PRATER, GENESIS_FORK_VERSION=_GOERLI_GENESIS_FORK_VERSION) # Merge Testnet (spec v1.1.9) KilnSetting = BaseChainSetting(NETWORK_NAME=KILN, GENESIS_FORK_VERSION=bytes.fromhex('70000069')) ALL_CHAINS: Dict[str, BaseChainSetting] = { MAINNET: MainnetSetting, + ROPSTEN: RopstenSetting, + GOERLI: GoerliSetting, PRATER: PraterSetting, - KINTSUGI: KintsugiSetting, KILN: KilnSetting, - ROPSTEN: RopstenSetting, } From a57373be16f90c37b39b34ff3b155dce23614b59 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 28 Jul 2022 18:09:48 +0800 Subject: [PATCH 2/3] Use Goerli as the "main name". Do not show Prater in prompt message --- staking_deposit/cli/generate_keys.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/staking_deposit/cli/generate_keys.py b/staking_deposit/cli/generate_keys.py index 5d8aa582..4caa3b7b 100644 --- a/staking_deposit/cli/generate_keys.py +++ b/staking_deposit/cli/generate_keys.py @@ -34,6 +34,7 @@ from staking_deposit.settings import ( ALL_CHAINS, MAINNET, + PRATER, get_chain_setting, ) @@ -87,7 +88,8 @@ def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[ param_decls='--chain', prompt=choice_prompt_func( lambda: load_text(['chain', 'prompt'], func='generate_keys_arguments_decorator'), - list(ALL_CHAINS.keys()) + # Since `prater` is alias of `goerli`, do not show `prater` in the prompt message. + list(key for key in ALL_CHAINS.keys() if key != PRATER) ), ), jit_option( From 6d69439034903053d8dc26253dab411ec1a978d7 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Sat, 30 Jul 2022 14:02:38 +0800 Subject: [PATCH 3/3] PR feedback from @CarlBeek --- staking_deposit/settings.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 61045d3e..491ca4e6 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -20,10 +20,8 @@ class BaseChainSetting(NamedTuple): MainnetSetting = BaseChainSetting(NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000')) # Ropsten setting RopstenSetting = BaseChainSetting(NETWORK_NAME=ROPSTEN, GENESIS_FORK_VERSION=bytes.fromhex('80000069')) -# GOERLI (PRATER is alias) -_GOERLI_GENESIS_FORK_VERSION = bytes.fromhex('00001020') -GoerliSetting = BaseChainSetting(NETWORK_NAME=GOERLI, GENESIS_FORK_VERSION=_GOERLI_GENESIS_FORK_VERSION) -PraterSetting = BaseChainSetting(NETWORK_NAME=PRATER, GENESIS_FORK_VERSION=_GOERLI_GENESIS_FORK_VERSION) +# Goreli setting +GoerliSetting = BaseChainSetting(NETWORK_NAME=GOERLI, GENESIS_FORK_VERSION=bytes.fromhex('00001020')) # Merge Testnet (spec v1.1.9) KilnSetting = BaseChainSetting(NETWORK_NAME=KILN, GENESIS_FORK_VERSION=bytes.fromhex('70000069')) @@ -32,7 +30,7 @@ class BaseChainSetting(NamedTuple): MAINNET: MainnetSetting, ROPSTEN: RopstenSetting, GOERLI: GoerliSetting, - PRATER: PraterSetting, + PRATER: GoerliSetting, # Prater is the old name of the Prater/Goerli testnet KILN: KilnSetting, }