diff --git a/beacon_chain/networking/network_metadata.nim b/beacon_chain/networking/network_metadata.nim index c0a0368f6..34ac104ed 100644 --- a/beacon_chain/networking/network_metadata.nim +++ b/beacon_chain/networking/network_metadata.nim @@ -86,51 +86,7 @@ type DeploymentPhase* {.pure.} = enum Mainnet func deploymentPhase*(genesisData: string): DeploymentPhase = - # SSZ processing at compile time does not work well. - # - # `BeaconState` layout: - # ``` - # - genesis_time: uint64 - # - genesis_validators_root: Eth2Digest - # - ... - # ``` - # - # Comparing the first 40 bytes covers those two fields, - # which should identify the network with high likelihood. - # ''.join('%02X'%b for b in open("network_name/genesis.ssz", "rb").read()[:40]) - if genesisData.len < 40: - return DeploymentPhase.None - - const - mainnets = [ - # Mainnet - "5730C65F000000004B363DB94E286120D76EB905340FDD4E54BFE9F06BF33FF6CF5AD27F511BFE95", - ] - testnets = [ - # Kiln - "0C572B620000000099B09FCD43E5905236C370F184056BEC6E6638CFC31A323B304FC4AA789CB4AD", - # Ropsten - "F0DB94620000000044F1E56283CA88B35C789F7F449E52339BC1FEFE3A45913A43A6D16EDCD33CF1", - # Sepolia - "607DB06200000000D8EA171F3C94AEA21EBC42A1ED61052ACF3F9209C00E4EFBAADDAC09ED9B8078", - # Goerli - "60F4596000000000043DB0D9A83813551EE2F33450D23797757D430911A9320530AD8A0EABC43EFB", - ] - devnets = [ - # Mainnet Shadow Fork 12 - "6CAB0C630000000096BBD4D72A6B5901B3E9402FF565C80D3A067D3C81A97BF65DE07129ADA6A821", - # Mainnet Shadow Fork 13 - "6C37176300000000061F583BEA1E10B0D77648E8186E05C07AD8A80892DF83B7F7D64AED43801C64", - ] - - let data = (genesisData[0 ..< 40].toHex()) - if data in mainnets: - return DeploymentPhase.Mainnet - if data in testnets: - return DeploymentPhase.Testnet - if data in devnets: - return DeploymentPhase.Devnet - DeploymentPhase.None + DeploymentPhase.Devnet const eth2NetworksDir = currentSourcePath.parentDir.replace('\\', '/') & "/../../vendor/eth2-networks"