From 4ea8213c42a56bcc7ce5433df3a0cd3d2034b48f Mon Sep 17 00:00:00 2001 From: Shane Bammel Date: Thu, 23 Mar 2023 16:00:27 -0500 Subject: [PATCH] Add v3 suffix to pulsechain-testnet --- common/paths/paths.go | 4 +-- core/genesis_write.go | 8 ++--- core/skip_analysis.go | 8 ++--- core/types/genesis.go | 6 ++-- erigon-lib/chain/networkname/network_name.go | 32 ++++++++--------- erigon-lib/chain/snapcfg/util.go | 36 +++++++++---------- go.mod | 2 +- go.sum | 4 +-- params/bootnodes.go | 14 ++++---- ...estnet.json => pulsechain-testnet-v3.json} | 2 +- params/config.go | 8 ++--- turbo/node/node.go | 4 +-- 12 files changed, 64 insertions(+), 64 deletions(-) rename params/chainspecs/{pulsechain-testnet.json => pulsechain-testnet-v3.json} (95%) diff --git a/common/paths/paths.go b/common/paths/paths.go index 93f56d7be..176edf2c1 100644 --- a/common/paths/paths.go +++ b/common/paths/paths.go @@ -102,8 +102,8 @@ func DataDirForNetwork(datadir string, network string) string { return networkDataDirCheckingLegacy(datadir, "chiado") case networkname.PulsechainChainName: return networkDataDirCheckingLegacy(datadir, "pulsechain") - case networkname.PulsechainTestnetChainName: - return networkDataDirCheckingLegacy(datadir, "pulsechain-testnet") + case networkname.PulsechainTestnetV3ChainName: + return networkDataDirCheckingLegacy(datadir, "pulsechain-testnet-v3") default: return datadir diff --git a/core/genesis_write.go b/core/genesis_write.go index 7bedea8ec..2acdd6f14 100644 --- a/core/genesis_write.go +++ b/core/genesis_write.go @@ -479,9 +479,9 @@ func PulsechainGenesisBlock() *types.Genesis { } } -func PulsechainTestnetGenesisBlock() *types.Genesis { +func PulsechainTestnetV3GenesisBlock() *types.Genesis { return &types.Genesis{ - Config: params.PulsechainTestnetChainConfig, + Config: params.PulsechainTestnetV3ChainConfig, Nonce: 66, ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"), GasLimit: 5000, @@ -720,8 +720,8 @@ func GenesisBlockByChainName(chain string) *types.Genesis { return ChiadoGenesisBlock() case networkname.PulsechainChainName: return PulsechainGenesisBlock() - case networkname.PulsechainTestnetChainName: - return PulsechainTestnetGenesisBlock() + case networkname.PulsechainTestnetV3ChainName: + return PulsechainTestnetV3GenesisBlock() case networkname.PulsechainDevnetChainName: return PulsechainDevnetGenesisBlock() default: diff --git a/core/skip_analysis.go b/core/skip_analysis.go index b767e0de8..d7c23fd5f 100644 --- a/core/skip_analysis.go +++ b/core/skip_analysis.go @@ -36,10 +36,10 @@ import ( // 0x21ab7bf7245a87eae265124aaf180d91133377e47db2b1a4866493ec4b371150 (block 13119520) var analysisBlocks = map[string][]uint64{ - networkname.MainnetChainName: {5_800_596, 6_426_298, 6_426_432, 11_079_912, 13_119_520, 15_081_051}, - networkname.BorMainnetChainName: {29_447_463}, - networkname.PulsechainChainName: {5_800_596, 6_426_298, 6_426_432, 11_079_912, 13_119_520, 15_081_051}, - networkname.PulsechainTestnetChainName: {5_800_596, 6_426_298, 6_426_432, 11_079_912, 13_119_520, 15_081_051}, + networkname.MainnetChainName: {5_800_596, 6_426_298, 6_426_432, 11_079_912, 13_119_520, 15_081_051}, + networkname.BorMainnetChainName: {29_447_463}, + networkname.PulsechainChainName: {5_800_596, 6_426_298, 6_426_432, 11_079_912, 13_119_520, 15_081_051}, + networkname.PulsechainTestnetV3ChainName: {5_800_596, 6_426_298, 6_426_432, 11_079_912, 13_119_520, 15_081_051}, } func SkipAnalysis(config *chain.Config, blockNumber uint64) bool { diff --git a/core/types/genesis.go b/core/types/genesis.go index 301e3375d..a313d2c93 100644 --- a/core/types/genesis.go +++ b/core/types/genesis.go @@ -173,12 +173,12 @@ func (g *Genesis) ConfigOrDefault(genesisHash common.Hash, chainId uint64) *chai var config *chain.Config pulseChainConfig := params.ChainConfigByChainName(networkname.PulsechainChainName) - pulseChainTestnetConfig := params.ChainConfigByChainName(networkname.PulsechainTestnetChainName) + pulseChainTestnetV3Config := params.ChainConfigByChainName(networkname.PulsechainTestnetV3ChainName) switch chainId { case pulseChainConfig.ChainID.Uint64(): config = pulseChainConfig - case pulseChainTestnetConfig.ChainID.Uint64(): - config = pulseChainTestnetConfig + case pulseChainTestnetV3Config.ChainID.Uint64(): + config = pulseChainTestnetV3Config default: config = params.ChainConfigByGenesisHash(genesisHash) } diff --git a/erigon-lib/chain/networkname/network_name.go b/erigon-lib/chain/networkname/network_name.go index 34668e378..6cbcba996 100644 --- a/erigon-lib/chain/networkname/network_name.go +++ b/erigon-lib/chain/networkname/network_name.go @@ -1,21 +1,21 @@ package networkname const ( - MainnetChainName = "mainnet" - HoleskyChainName = "holesky" - SepoliaChainName = "sepolia" - GoerliChainName = "goerli" - DevChainName = "dev" - MumbaiChainName = "mumbai" - AmoyChainName = "amoy" - BorMainnetChainName = "bor-mainnet" - BorDevnetChainName = "bor-devnet" - GnosisChainName = "gnosis" - BorE2ETestChain2ValName = "bor-e2e-test-2Val" - ChiadoChainName = "chiado" - PulsechainChainName = "pulsechain" - PulsechainDevnetChainName = "pulsechain-devnet" - PulsechainTestnetChainName = "pulsechain-testnet" + MainnetChainName = "mainnet" + HoleskyChainName = "holesky" + SepoliaChainName = "sepolia" + GoerliChainName = "goerli" + DevChainName = "dev" + MumbaiChainName = "mumbai" + AmoyChainName = "amoy" + BorMainnetChainName = "bor-mainnet" + BorDevnetChainName = "bor-devnet" + GnosisChainName = "gnosis" + BorE2ETestChain2ValName = "bor-e2e-test-2Val" + ChiadoChainName = "chiado" + PulsechainChainName = "pulsechain" + PulsechainDevnetChainName = "pulsechain-devnet" + PulsechainTestnetV3ChainName = "pulsechain-testnet-v3" ) var All = []string{ @@ -31,5 +31,5 @@ var All = []string{ ChiadoChainName, PulsechainChainName, PulsechainDevnetChainName, - PulsechainTestnetChainName, + PulsechainTestnetV3ChainName, } diff --git a/erigon-lib/chain/snapcfg/util.go b/erigon-lib/chain/snapcfg/util.go index a6f6c793f..81c8f1153 100644 --- a/erigon-lib/chain/snapcfg/util.go +++ b/erigon-lib/chain/snapcfg/util.go @@ -17,15 +17,15 @@ import ( var ( Mainnet = fromToml(snapshothashes.Mainnet) // Holesky = fromToml(snapshothashes.Holesky) - Sepolia = fromToml(snapshothashes.Sepolia) - Goerli = fromToml(snapshothashes.Goerli) - Mumbai = fromToml(snapshothashes.Mumbai) - Amoy = fromToml(snapshothashes.Amoy) - BorMainnet = fromToml(snapshothashes.BorMainnet) - Gnosis = fromToml(snapshothashes.Gnosis) - Chiado = fromToml(snapshothashes.Chiado) - PulseChainMainnet = fromToml(pulseSnapshotHashes.PulseChainMainnet) - PulseChainTestnet = fromToml(pulseSnapshotHashes.PulseChainTestnet) + Sepolia = fromToml(snapshothashes.Sepolia) + Goerli = fromToml(snapshothashes.Goerli) + Mumbai = fromToml(snapshothashes.Mumbai) + Amoy = fromToml(snapshothashes.Amoy) + BorMainnet = fromToml(snapshothashes.BorMainnet) + Gnosis = fromToml(snapshothashes.Gnosis) + Chiado = fromToml(snapshothashes.Chiado) + PulseChainMainnet = fromToml(pulseSnapshotHashes.PulseChainMainnet) + PulseChainTestnetV3 = fromToml(pulseSnapshotHashes.PulseChainTestnetV3) ) type PreverifiedItem struct { @@ -140,15 +140,15 @@ type Cfg struct { var knownPreverified = map[string]Preverified{ networkname.MainnetChainName: Mainnet, // networkname.HoleskyChainName: HoleskyChainSnapshotCfg, - networkname.SepoliaChainName: Sepolia, - networkname.GoerliChainName: Goerli, - networkname.MumbaiChainName: Mumbai, - networkname.AmoyChainName: Amoy, - networkname.BorMainnetChainName: BorMainnet, - networkname.GnosisChainName: Gnosis, - networkname.ChiadoChainName: Chiado, - networkname.PulsechainChainName: PulseChainMainnet, - networkname.PulsechainTestnetChainName: PulseChainTestnet, + networkname.SepoliaChainName: Sepolia, + networkname.GoerliChainName: Goerli, + networkname.MumbaiChainName: Mumbai, + networkname.AmoyChainName: Amoy, + networkname.BorMainnetChainName: BorMainnet, + networkname.GnosisChainName: Gnosis, + networkname.ChiadoChainName: Chiado, + networkname.PulsechainChainName: PulseChainMainnet, + networkname.PulsechainTestnetV3ChainName: PulseChainTestnetV3, } // KnownCfg return list of preverified hashes for given network, but apply whiteList filter if it's not empty diff --git a/go.mod b/go.mod index 1db9c4248..b1dd5bd69 100644 --- a/go.mod +++ b/go.mod @@ -88,7 +88,7 @@ require ( github.com/valyala/fastjson v1.6.4 github.com/vektah/gqlparser/v2 v2.5.10 github.com/xsleonard/go-merkle v1.1.0 - gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.2 + gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.3 go.uber.org/zap v1.26.0 golang.org/x/crypto v0.17.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 diff --git a/go.sum b/go.sum index 9be3e07d3..14fc539d0 100644 --- a/go.sum +++ b/go.sum @@ -928,8 +928,8 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.2 h1:M/ReqIKALiW5a56bdT8w9j9GZA7yqSEhO9joesRsWBQ= -gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.2/go.mod h1:U/W4jVFkJQ1XeXul9ng2MFGYRV2bBqTxVjSEojtm18c= +gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.3 h1:jB55xBCttoM2mxD6PCYQxf/es0WuBePQYfU+VH4v+d8= +gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.3/go.mod h1:U/W4jVFkJQ1XeXul9ng2MFGYRV2bBqTxVjSEojtm18c= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= diff --git a/params/bootnodes.go b/params/bootnodes.go index 627c9f29b..3c2cd294a 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -152,9 +152,9 @@ var PulsechainBootnodes = []string{ // Pulsechain Go Bootnodes } -// PulsechainTestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on -// the Pulsechain testnet network. -var PulsechainTestnetBootnodes = []string{ +// PulsechainTestnetV3Bootnodes are the enode URLs of the P2P bootstrap nodes running on +// the Pulsechain Testnet V3 network. +var PulsechainTestnetV3Bootnodes = []string{ "enode://5942169e5173992b2bab93e36bb2773e82b0fe91f2e70239a48232e85da6023673e2fab608f5b7fad4b8dcd2a29c4f2a6f800522aa00262a1b371fb80c7ec620@3.236.202.85:30303", // bootnode-aws-us-east-1-001 "enode://fa1420f97362e6c3e86dfcd38c3877748860b51c021de2662e46daf007d6de22c7668a838c9bf3468496fd10c2374544d16911dd2e2554aef7981e2858349952@44.202.85.131:30303", // bootnode-aws-us-east-1-002 "enode://eee9a1665c202b7fec55be2a5c1106b283f5694a426d727215d3cb0287074d3c72bc7943282b2492b0d39246daad28032d09a2adbeddd43a3e7d4da0e40fd840@174.129.96.223:30303", // bootnode-aws-us-east-1-003 @@ -168,7 +168,7 @@ func KnownDNSNetwork(genesis libcommon.Hash, networkID uint64, protocol string) var dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@" var tld = ".ethdisco.net" - if networkID == NetworkIDByChainName(networkname.PulsechainChainName) || networkID == NetworkIDByChainName(networkname.PulsechainTestnetChainName) { + if networkID == NetworkIDByChainName(networkname.PulsechainChainName) || networkID == NetworkIDByChainName(networkname.PulsechainTestnetV3ChainName) { tld = ".pulsedisco.net" dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@" } @@ -176,7 +176,7 @@ func KnownDNSNetwork(genesis libcommon.Hash, networkID uint64, protocol string) switch genesis { case MainnetGenesisHash: switch networkID { - case NetworkIDByChainName(networkname.PulsechainTestnetChainName): + case NetworkIDByChainName(networkname.PulsechainTestnetV3ChainName): net = "testnet-v3" default: net = "mainnet" @@ -213,8 +213,8 @@ func BootnodeURLsOfChain(chain string) []string { return ChiadoBootnodes case networkname.PulsechainChainName: return PulsechainBootnodes - case networkname.PulsechainTestnetChainName: - return PulsechainTestnetBootnodes + case networkname.PulsechainTestnetV3ChainName: + return PulsechainTestnetV3Bootnodes default: return []string{} } diff --git a/params/chainspecs/pulsechain-testnet.json b/params/chainspecs/pulsechain-testnet-v3.json similarity index 95% rename from params/chainspecs/pulsechain-testnet.json rename to params/chainspecs/pulsechain-testnet-v3.json index 83ce9d353..6c227db37 100644 --- a/params/chainspecs/pulsechain-testnet.json +++ b/params/chainspecs/pulsechain-testnet-v3.json @@ -1,5 +1,5 @@ { - "ChainName": "pulsechain-testnet", + "ChainName": "pulsechain-testnet-v3", "chainId": 942, "consensus": "ethash", "homesteadBlock": 1150000, diff --git a/params/config.go b/params/config.go index 4f4d50ae9..a1cc056b1 100644 --- a/params/config.go +++ b/params/config.go @@ -155,7 +155,7 @@ var ( PulsechainDevnetChainConfig = readChainSpec("chainspecs/pulsechain-devnet.json") - PulsechainTestnetChainConfig = readChainSpec("chainspecs/pulsechain-testnet.json") + PulsechainTestnetV3ChainConfig = readChainSpec("chainspecs/pulsechain-testnet-v3.json") CliqueSnapshot = NewSnapshotConfig(10, 1024, 16384, true, "") @@ -247,8 +247,8 @@ func ChainConfigByChainName(chain string) *chain.Config { return PulsechainChainConfig case networkname.PulsechainDevnetChainName: return PulsechainDevnetChainConfig - case networkname.PulsechainTestnetChainName: - return PulsechainTestnetChainConfig + case networkname.PulsechainTestnetV3ChainName: + return PulsechainTestnetV3ChainConfig default: return nil } @@ -280,7 +280,7 @@ func GenesisHashByChainName(chain string) *libcommon.Hash { return &PulsechainGenesisHash case networkname.PulsechainDevnetChainName: return &PulsechainDevnetGenesisHash - case networkname.PulsechainTestnetChainName: + case networkname.PulsechainTestnetV3ChainName: return &PulsechainTetnetGenesisHash default: return nil diff --git a/turbo/node/node.go b/turbo/node/node.go index e4476aa53..04b9de032 100644 --- a/turbo/node/node.go +++ b/turbo/node/node.go @@ -88,8 +88,8 @@ func NewNodConfigUrfave(ctx *cli.Context, logger log.Logger) *nodecfg.Config { logger.Info("Starting Erigon on PulseChain...") case networkname.PulsechainDevnetChainName: logger.Info("Starting Erigon on PulseChain Devnet...") - case networkname.PulsechainTestnetChainName: - logger.Info("Starting Erigon on PulseChain Testnet...") + case networkname.PulsechainTestnetV3ChainName: + logger.Info("Starting Erigon on PulseChain Testnet V3...") case "", networkname.MainnetChainName: if !ctx.IsSet(utils.NetworkIdFlag.Name) { logger.Info("Starting Erigon on Ethereum mainnet...")