Add v3 suffix to pulsechain-testnet

This commit is contained in:
Shane Bammel 2023-03-23 16:00:27 -05:00
parent ed87d4b665
commit 4ea8213c42
12 changed files with 64 additions and 64 deletions

View File

@ -102,8 +102,8 @@ func DataDirForNetwork(datadir string, network string) string {
return networkDataDirCheckingLegacy(datadir, "chiado") return networkDataDirCheckingLegacy(datadir, "chiado")
case networkname.PulsechainChainName: case networkname.PulsechainChainName:
return networkDataDirCheckingLegacy(datadir, "pulsechain") return networkDataDirCheckingLegacy(datadir, "pulsechain")
case networkname.PulsechainTestnetChainName: case networkname.PulsechainTestnetV3ChainName:
return networkDataDirCheckingLegacy(datadir, "pulsechain-testnet") return networkDataDirCheckingLegacy(datadir, "pulsechain-testnet-v3")
default: default:
return datadir return datadir

View File

@ -479,9 +479,9 @@ func PulsechainGenesisBlock() *types.Genesis {
} }
} }
func PulsechainTestnetGenesisBlock() *types.Genesis { func PulsechainTestnetV3GenesisBlock() *types.Genesis {
return &types.Genesis{ return &types.Genesis{
Config: params.PulsechainTestnetChainConfig, Config: params.PulsechainTestnetV3ChainConfig,
Nonce: 66, Nonce: 66,
ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"), ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"),
GasLimit: 5000, GasLimit: 5000,
@ -720,8 +720,8 @@ func GenesisBlockByChainName(chain string) *types.Genesis {
return ChiadoGenesisBlock() return ChiadoGenesisBlock()
case networkname.PulsechainChainName: case networkname.PulsechainChainName:
return PulsechainGenesisBlock() return PulsechainGenesisBlock()
case networkname.PulsechainTestnetChainName: case networkname.PulsechainTestnetV3ChainName:
return PulsechainTestnetGenesisBlock() return PulsechainTestnetV3GenesisBlock()
case networkname.PulsechainDevnetChainName: case networkname.PulsechainDevnetChainName:
return PulsechainDevnetGenesisBlock() return PulsechainDevnetGenesisBlock()
default: default:

View File

@ -36,10 +36,10 @@ import (
// 0x21ab7bf7245a87eae265124aaf180d91133377e47db2b1a4866493ec4b371150 (block 13119520) // 0x21ab7bf7245a87eae265124aaf180d91133377e47db2b1a4866493ec4b371150 (block 13119520)
var analysisBlocks = map[string][]uint64{ 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.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.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.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.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 { func SkipAnalysis(config *chain.Config, blockNumber uint64) bool {

View File

@ -173,12 +173,12 @@ func (g *Genesis) ConfigOrDefault(genesisHash common.Hash, chainId uint64) *chai
var config *chain.Config var config *chain.Config
pulseChainConfig := params.ChainConfigByChainName(networkname.PulsechainChainName) pulseChainConfig := params.ChainConfigByChainName(networkname.PulsechainChainName)
pulseChainTestnetConfig := params.ChainConfigByChainName(networkname.PulsechainTestnetChainName) pulseChainTestnetV3Config := params.ChainConfigByChainName(networkname.PulsechainTestnetV3ChainName)
switch chainId { switch chainId {
case pulseChainConfig.ChainID.Uint64(): case pulseChainConfig.ChainID.Uint64():
config = pulseChainConfig config = pulseChainConfig
case pulseChainTestnetConfig.ChainID.Uint64(): case pulseChainTestnetV3Config.ChainID.Uint64():
config = pulseChainTestnetConfig config = pulseChainTestnetV3Config
default: default:
config = params.ChainConfigByGenesisHash(genesisHash) config = params.ChainConfigByGenesisHash(genesisHash)
} }

View File

@ -1,21 +1,21 @@
package networkname package networkname
const ( const (
MainnetChainName = "mainnet" MainnetChainName = "mainnet"
HoleskyChainName = "holesky" HoleskyChainName = "holesky"
SepoliaChainName = "sepolia" SepoliaChainName = "sepolia"
GoerliChainName = "goerli" GoerliChainName = "goerli"
DevChainName = "dev" DevChainName = "dev"
MumbaiChainName = "mumbai" MumbaiChainName = "mumbai"
AmoyChainName = "amoy" AmoyChainName = "amoy"
BorMainnetChainName = "bor-mainnet" BorMainnetChainName = "bor-mainnet"
BorDevnetChainName = "bor-devnet" BorDevnetChainName = "bor-devnet"
GnosisChainName = "gnosis" GnosisChainName = "gnosis"
BorE2ETestChain2ValName = "bor-e2e-test-2Val" BorE2ETestChain2ValName = "bor-e2e-test-2Val"
ChiadoChainName = "chiado" ChiadoChainName = "chiado"
PulsechainChainName = "pulsechain" PulsechainChainName = "pulsechain"
PulsechainDevnetChainName = "pulsechain-devnet" PulsechainDevnetChainName = "pulsechain-devnet"
PulsechainTestnetChainName = "pulsechain-testnet" PulsechainTestnetV3ChainName = "pulsechain-testnet-v3"
) )
var All = []string{ var All = []string{
@ -31,5 +31,5 @@ var All = []string{
ChiadoChainName, ChiadoChainName,
PulsechainChainName, PulsechainChainName,
PulsechainDevnetChainName, PulsechainDevnetChainName,
PulsechainTestnetChainName, PulsechainTestnetV3ChainName,
} }

View File

@ -17,15 +17,15 @@ import (
var ( var (
Mainnet = fromToml(snapshothashes.Mainnet) Mainnet = fromToml(snapshothashes.Mainnet)
// Holesky = fromToml(snapshothashes.Holesky) // Holesky = fromToml(snapshothashes.Holesky)
Sepolia = fromToml(snapshothashes.Sepolia) Sepolia = fromToml(snapshothashes.Sepolia)
Goerli = fromToml(snapshothashes.Goerli) Goerli = fromToml(snapshothashes.Goerli)
Mumbai = fromToml(snapshothashes.Mumbai) Mumbai = fromToml(snapshothashes.Mumbai)
Amoy = fromToml(snapshothashes.Amoy) Amoy = fromToml(snapshothashes.Amoy)
BorMainnet = fromToml(snapshothashes.BorMainnet) BorMainnet = fromToml(snapshothashes.BorMainnet)
Gnosis = fromToml(snapshothashes.Gnosis) Gnosis = fromToml(snapshothashes.Gnosis)
Chiado = fromToml(snapshothashes.Chiado) Chiado = fromToml(snapshothashes.Chiado)
PulseChainMainnet = fromToml(pulseSnapshotHashes.PulseChainMainnet) PulseChainMainnet = fromToml(pulseSnapshotHashes.PulseChainMainnet)
PulseChainTestnet = fromToml(pulseSnapshotHashes.PulseChainTestnet) PulseChainTestnetV3 = fromToml(pulseSnapshotHashes.PulseChainTestnetV3)
) )
type PreverifiedItem struct { type PreverifiedItem struct {
@ -140,15 +140,15 @@ type Cfg struct {
var knownPreverified = map[string]Preverified{ var knownPreverified = map[string]Preverified{
networkname.MainnetChainName: Mainnet, networkname.MainnetChainName: Mainnet,
// networkname.HoleskyChainName: HoleskyChainSnapshotCfg, // networkname.HoleskyChainName: HoleskyChainSnapshotCfg,
networkname.SepoliaChainName: Sepolia, networkname.SepoliaChainName: Sepolia,
networkname.GoerliChainName: Goerli, networkname.GoerliChainName: Goerli,
networkname.MumbaiChainName: Mumbai, networkname.MumbaiChainName: Mumbai,
networkname.AmoyChainName: Amoy, networkname.AmoyChainName: Amoy,
networkname.BorMainnetChainName: BorMainnet, networkname.BorMainnetChainName: BorMainnet,
networkname.GnosisChainName: Gnosis, networkname.GnosisChainName: Gnosis,
networkname.ChiadoChainName: Chiado, networkname.ChiadoChainName: Chiado,
networkname.PulsechainChainName: PulseChainMainnet, networkname.PulsechainChainName: PulseChainMainnet,
networkname.PulsechainTestnetChainName: PulseChainTestnet, networkname.PulsechainTestnetV3ChainName: PulseChainTestnetV3,
} }
// KnownCfg return list of preverified hashes for given network, but apply whiteList filter if it's not empty // KnownCfg return list of preverified hashes for given network, but apply whiteList filter if it's not empty

2
go.mod
View File

@ -88,7 +88,7 @@ require (
github.com/valyala/fastjson v1.6.4 github.com/valyala/fastjson v1.6.4
github.com/vektah/gqlparser/v2 v2.5.10 github.com/vektah/gqlparser/v2 v2.5.10
github.com/xsleonard/go-merkle v1.1.0 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 go.uber.org/zap v1.26.0
golang.org/x/crypto v0.17.0 golang.org/x/crypto v0.17.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 golang.org/x/exp v0.0.0-20230905200255-921286631fa9

4
go.sum
View File

@ -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.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 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= 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.3 h1:jB55xBCttoM2mxD6PCYQxf/es0WuBePQYfU+VH4v+d8=
gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.2/go.mod h1:U/W4jVFkJQ1XeXul9ng2MFGYRV2bBqTxVjSEojtm18c= 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 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=

View File

@ -152,9 +152,9 @@ var PulsechainBootnodes = []string{
// Pulsechain Go Bootnodes // Pulsechain Go Bootnodes
} }
// PulsechainTestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on // PulsechainTestnetV3Bootnodes are the enode URLs of the P2P bootstrap nodes running on
// the Pulsechain testnet network. // the Pulsechain Testnet V3 network.
var PulsechainTestnetBootnodes = []string{ var PulsechainTestnetV3Bootnodes = []string{
"enode://5942169e5173992b2bab93e36bb2773e82b0fe91f2e70239a48232e85da6023673e2fab608f5b7fad4b8dcd2a29c4f2a6f800522aa00262a1b371fb80c7ec620@3.236.202.85:30303", // bootnode-aws-us-east-1-001 "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://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 "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 dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@"
var tld = ".ethdisco.net" 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" tld = ".pulsedisco.net"
dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@" dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@"
} }
@ -176,7 +176,7 @@ func KnownDNSNetwork(genesis libcommon.Hash, networkID uint64, protocol string)
switch genesis { switch genesis {
case MainnetGenesisHash: case MainnetGenesisHash:
switch networkID { switch networkID {
case NetworkIDByChainName(networkname.PulsechainTestnetChainName): case NetworkIDByChainName(networkname.PulsechainTestnetV3ChainName):
net = "testnet-v3" net = "testnet-v3"
default: default:
net = "mainnet" net = "mainnet"
@ -213,8 +213,8 @@ func BootnodeURLsOfChain(chain string) []string {
return ChiadoBootnodes return ChiadoBootnodes
case networkname.PulsechainChainName: case networkname.PulsechainChainName:
return PulsechainBootnodes return PulsechainBootnodes
case networkname.PulsechainTestnetChainName: case networkname.PulsechainTestnetV3ChainName:
return PulsechainTestnetBootnodes return PulsechainTestnetV3Bootnodes
default: default:
return []string{} return []string{}
} }

View File

@ -1,5 +1,5 @@
{ {
"ChainName": "pulsechain-testnet", "ChainName": "pulsechain-testnet-v3",
"chainId": 942, "chainId": 942,
"consensus": "ethash", "consensus": "ethash",
"homesteadBlock": 1150000, "homesteadBlock": 1150000,

View File

@ -155,7 +155,7 @@ var (
PulsechainDevnetChainConfig = readChainSpec("chainspecs/pulsechain-devnet.json") 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, "") CliqueSnapshot = NewSnapshotConfig(10, 1024, 16384, true, "")
@ -247,8 +247,8 @@ func ChainConfigByChainName(chain string) *chain.Config {
return PulsechainChainConfig return PulsechainChainConfig
case networkname.PulsechainDevnetChainName: case networkname.PulsechainDevnetChainName:
return PulsechainDevnetChainConfig return PulsechainDevnetChainConfig
case networkname.PulsechainTestnetChainName: case networkname.PulsechainTestnetV3ChainName:
return PulsechainTestnetChainConfig return PulsechainTestnetV3ChainConfig
default: default:
return nil return nil
} }
@ -280,7 +280,7 @@ func GenesisHashByChainName(chain string) *libcommon.Hash {
return &PulsechainGenesisHash return &PulsechainGenesisHash
case networkname.PulsechainDevnetChainName: case networkname.PulsechainDevnetChainName:
return &PulsechainDevnetGenesisHash return &PulsechainDevnetGenesisHash
case networkname.PulsechainTestnetChainName: case networkname.PulsechainTestnetV3ChainName:
return &PulsechainTetnetGenesisHash return &PulsechainTetnetGenesisHash
default: default:
return nil return nil

View File

@ -88,8 +88,8 @@ func NewNodConfigUrfave(ctx *cli.Context, logger log.Logger) *nodecfg.Config {
logger.Info("Starting Erigon on PulseChain...") logger.Info("Starting Erigon on PulseChain...")
case networkname.PulsechainDevnetChainName: case networkname.PulsechainDevnetChainName:
logger.Info("Starting Erigon on PulseChain Devnet...") logger.Info("Starting Erigon on PulseChain Devnet...")
case networkname.PulsechainTestnetChainName: case networkname.PulsechainTestnetV3ChainName:
logger.Info("Starting Erigon on PulseChain Testnet...") logger.Info("Starting Erigon on PulseChain Testnet V3...")
case "", networkname.MainnetChainName: case "", networkname.MainnetChainName:
if !ctx.IsSet(utils.NetworkIdFlag.Name) { if !ctx.IsSet(utils.NetworkIdFlag.Name) {
logger.Info("Starting Erigon on Ethereum mainnet...") logger.Info("Starting Erigon on Ethereum mainnet...")