Add network config for Testnet-V4

This commit is contained in:
Shane Bammel 2023-04-13 14:57:33 -05:00
parent c03cba2adc
commit 43ef4304ee
13 changed files with 40 additions and 36 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.PulsechainTestnetV3ChainName: case networkname.PulsechainTestnetV4ChainName:
return networkDataDirCheckingLegacy(datadir, "pulsechain-testnet-v3") return networkDataDirCheckingLegacy(datadir, "pulsechain-testnet-v4")
default: default:
return datadir return datadir

View File

@ -479,9 +479,9 @@ func PulsechainGenesisBlock() *types.Genesis {
} }
} }
func PulsechainTestnetV3GenesisBlock() *types.Genesis { func PulsechainTestnetV4GenesisBlock() *types.Genesis {
return &types.Genesis{ return &types.Genesis{
Config: params.PulsechainTestnetV3ChainConfig, Config: params.PulsechainTestnetV4ChainConfig,
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.PulsechainTestnetV3ChainName: case networkname.PulsechainTestnetV4ChainName:
return PulsechainTestnetV3GenesisBlock() return PulsechainTestnetV4GenesisBlock()
case networkname.PulsechainDevnetChainName: case networkname.PulsechainDevnetChainName:
return PulsechainDevnetGenesisBlock() return PulsechainDevnetGenesisBlock()
default: default:

View File

@ -39,7 +39,7 @@ 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.PulsechainTestnetV3ChainName: {5_800_596, 6_426_298, 6_426_432, 11_079_912, 13_119_520, 15_081_051}, networkname.PulsechainTestnetV4ChainName: {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)
pulseChainTestnetV3Config := params.ChainConfigByChainName(networkname.PulsechainTestnetV3ChainName) pulseChainTestnetV4Config := params.ChainConfigByChainName(networkname.PulsechainTestnetV4ChainName)
switch chainId { switch chainId {
case pulseChainConfig.ChainID.Uint64(): case pulseChainConfig.ChainID.Uint64():
config = pulseChainConfig config = pulseChainConfig
case pulseChainTestnetV3Config.ChainID.Uint64(): case pulseChainTestnetV4Config.ChainID.Uint64():
config = pulseChainTestnetV3Config config = pulseChainTestnetV4Config
default: default:
config = params.ChainConfigByGenesisHash(genesisHash) config = params.ChainConfigByGenesisHash(genesisHash)
} }

View File

@ -15,7 +15,7 @@ const (
ChiadoChainName = "chiado" ChiadoChainName = "chiado"
PulsechainChainName = "pulsechain" PulsechainChainName = "pulsechain"
PulsechainDevnetChainName = "pulsechain-devnet" PulsechainDevnetChainName = "pulsechain-devnet"
PulsechainTestnetV3ChainName = "pulsechain-testnet-v3" PulsechainTestnetV4ChainName = "pulsechain-testnet-v4"
) )
var All = []string{ var All = []string{
@ -31,5 +31,5 @@ var All = []string{
ChiadoChainName, ChiadoChainName,
PulsechainChainName, PulsechainChainName,
PulsechainDevnetChainName, PulsechainDevnetChainName,
PulsechainTestnetV3ChainName, PulsechainTestnetV4ChainName,
} }

View File

@ -25,7 +25,7 @@ var (
Gnosis = fromToml(snapshothashes.Gnosis) Gnosis = fromToml(snapshothashes.Gnosis)
Chiado = fromToml(snapshothashes.Chiado) Chiado = fromToml(snapshothashes.Chiado)
PulseChainMainnet = fromToml(pulseSnapshotHashes.PulseChainMainnet) PulseChainMainnet = fromToml(pulseSnapshotHashes.PulseChainMainnet)
PulseChainTestnetV3 = fromToml(pulseSnapshotHashes.PulseChainTestnetV3) PulseChainTestnetV4 = fromToml(pulseSnapshotHashes.PulseChainTestnetV4)
) )
type PreverifiedItem struct { type PreverifiedItem struct {
@ -148,7 +148,7 @@ var knownPreverified = map[string]Preverified{
networkname.GnosisChainName: Gnosis, networkname.GnosisChainName: Gnosis,
networkname.ChiadoChainName: Chiado, networkname.ChiadoChainName: Chiado,
networkname.PulsechainChainName: PulseChainMainnet, networkname.PulsechainChainName: PulseChainMainnet,
networkname.PulsechainTestnetV3ChainName: PulseChainTestnetV3, networkname.PulsechainTestnetV4ChainName: PulseChainTestnetV4,
} }
// 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

View File

@ -97,7 +97,7 @@ var Defaults = Config{
DeprecatedTxPool: DeprecatedDefaultTxPoolConfig, DeprecatedTxPool: DeprecatedDefaultTxPoolConfig,
RPCGasCap: 50000000, RPCGasCap: 50000000,
GPO: FullNodeGPO, GPO: FullNodeGPO,
RPCTxFeeCap: 1, // 1 ether RPCTxFeeCap: 1000000, // 1 million ether
ImportMode: false, ImportMode: false,
Snapshot: BlocksFreezing{ Snapshot: BlocksFreezing{

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.3 gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.4
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

2
go.sum
View File

@ -930,6 +930,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
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.3 h1:jB55xBCttoM2mxD6PCYQxf/es0WuBePQYfU+VH4v+d8= 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= gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.3/go.mod h1:U/W4jVFkJQ1XeXul9ng2MFGYRV2bBqTxVjSEojtm18c=
gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.4 h1:i0X9LQINUyOUTb5Eak1bZzwyDzo9aS8hBbMOygXazdM=
gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.4/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,12 +152,12 @@ var PulsechainBootnodes = []string{
// Pulsechain Go Bootnodes // Pulsechain Go Bootnodes
} }
// PulsechainTestnetV3Bootnodes are the enode URLs of the P2P bootstrap nodes running on // PulsechainTestnetV4Bootnodes are the enode URLs of the P2P bootstrap nodes running on
// the Pulsechain Testnet V3 network. // the Pulsechain Testnet V4 network.
var PulsechainTestnetV3Bootnodes = []string{ var PulsechainTestnetV4Bootnodes = []string{
"enode://5942169e5173992b2bab93e36bb2773e82b0fe91f2e70239a48232e85da6023673e2fab608f5b7fad4b8dcd2a29c4f2a6f800522aa00262a1b371fb80c7ec620@3.236.202.85:30303", // bootnode-aws-us-east-1-001 "enode://499f821836b8fec272c0664e79b95e8ec50b4320d201e02ac83c5bf63bcff33869c411e8290b1774d74ed01b7a53e838e3689cfe46992243094886a0980a9c60@3.142.166.203:30303", // bootnode-aws-us-east-2-001
"enode://fa1420f97362e6c3e86dfcd38c3877748860b51c021de2662e46daf007d6de22c7668a838c9bf3468496fd10c2374544d16911dd2e2554aef7981e2858349952@44.202.85.131:30303", // bootnode-aws-us-east-1-002 "enode://133f45485d3b5221d10e5ed288bf1da827d5adbe454a9a9ae3cd4ae15d14b65d0b6d937b0a1a0ba3b9b2ebbf50c40e379573293f1ff51b553e997d843faa2c4b@18.118.188.165:30303", // bootnode-aws-us-east-2-002
"enode://eee9a1665c202b7fec55be2a5c1106b283f5694a426d727215d3cb0287074d3c72bc7943282b2492b0d39246daad28032d09a2adbeddd43a3e7d4da0e40fd840@174.129.96.223:30303", // bootnode-aws-us-east-1-003 "enode://ef4bf6197515e2aa3290f5bf5e43e2b99022254fcbd540507d325d2de40e9c6fd87581d88e9affe97bc7c099946a84ca66de0c7752a1ab616c7b51ef1f10b2fb@3.138.107.144:30303", // bootnode-aws-us-east-2-003
} }
// KnownDNSNetwork returns the address of a public DNS-based node list for the given // KnownDNSNetwork returns the address of a public DNS-based node list for the given
@ -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.PulsechainTestnetV3ChainName) { if networkID == NetworkIDByChainName(networkname.PulsechainChainName) || networkID == NetworkIDByChainName(networkname.PulsechainTestnetV4ChainName) {
tld = ".pulsedisco.net" tld = ".pulsedisco.net"
dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@" dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@"
} }
@ -176,8 +176,10 @@ func KnownDNSNetwork(genesis libcommon.Hash, networkID uint64, protocol string)
switch genesis { switch genesis {
case MainnetGenesisHash: case MainnetGenesisHash:
switch networkID { switch networkID {
case NetworkIDByChainName(networkname.PulsechainTestnetV3ChainName): case NetworkIDByChainName(networkname.PulsechainTestnetV4ChainName):
net = "testnet-v3" // Using short name here because the tld "pulsedisco" is
// unique, we don't need a pulsechain- prefix.
net = "testnet-v4"
default: default:
net = "mainnet" net = "mainnet"
} }
@ -213,8 +215,8 @@ func BootnodeURLsOfChain(chain string) []string {
return ChiadoBootnodes return ChiadoBootnodes
case networkname.PulsechainChainName: case networkname.PulsechainChainName:
return PulsechainBootnodes return PulsechainBootnodes
case networkname.PulsechainTestnetV3ChainName: case networkname.PulsechainTestnetV4ChainName:
return PulsechainTestnetV3Bootnodes return PulsechainTestnetV4Bootnodes
default: default:
return []string{} return []string{}
} }

View File

@ -1,6 +1,6 @@
{ {
"ChainName": "pulsechain-testnet-v3", "ChainName": "pulsechain-testnet-v4",
"chainId": 942, "chainId": 943,
"consensus": "ethash", "consensus": "ethash",
"homesteadBlock": 1150000, "homesteadBlock": 1150000,
"daoForkBlock": 1920000, "daoForkBlock": 1920000,
@ -24,7 +24,7 @@
"pulseChain": { "pulseChain": {
"treasury": { "treasury": {
"addr": "0xA592ED65885bcbCeb30442F4902a0D1Cf3AcB8fC", "addr": "0xA592ED65885bcbCeb30442F4902a0D1Cf3AcB8fC",
"balance": "0xc9f2c9cd04674edea40000000" "balance": "0x314DC6448D9338C15B0A00000000"
} }
} }
} }

View File

@ -155,7 +155,7 @@ var (
PulsechainDevnetChainConfig = readChainSpec("chainspecs/pulsechain-devnet.json") PulsechainDevnetChainConfig = readChainSpec("chainspecs/pulsechain-devnet.json")
PulsechainTestnetV3ChainConfig = readChainSpec("chainspecs/pulsechain-testnet-v3.json") PulsechainTestnetV4ChainConfig = readChainSpec("chainspecs/pulsechain-testnet-v4.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.PulsechainTestnetV3ChainName: case networkname.PulsechainTestnetV4ChainName:
return PulsechainTestnetV3ChainConfig return PulsechainTestnetV4ChainConfig
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.PulsechainTestnetV3ChainName: case networkname.PulsechainTestnetV4ChainName:
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.PulsechainTestnetV3ChainName: case networkname.PulsechainTestnetV4ChainName:
logger.Info("Starting Erigon on PulseChain Testnet V3...") logger.Info("Starting Erigon on PulseChain Testnet V4...")
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...")