From 17fa851d5ee8ec1879446e8ec6f2a46fae2b2672 Mon Sep 17 00:00:00 2001 From: Shane Bammel Date: Thu, 13 Apr 2023 14:57:33 -0500 Subject: [PATCH] Add network config for Testnet-V4 --- common/paths/paths.go | 4 ++-- core/genesis.go | 14 +++++------ core/skip_analysis.go | 2 +- eth/ethconfig/config.go | 2 +- go.mod | 2 +- go.sum | 2 ++ params/bootnodes.go | 24 ++++++++++--------- ...net-v3.json => pulsechain-testnet-v4.json} | 6 ++--- params/config.go | 8 +++---- params/networkname/network_name.go | 4 ++-- turbo/node/node.go | 4 ++-- turbo/snapshotsync/snapcfg/util.go | 8 +++---- 12 files changed, 42 insertions(+), 38 deletions(-) rename params/chainspecs/{pulsechain-testnet-v3.json => pulsechain-testnet-v4.json} (87%) diff --git a/common/paths/paths.go b/common/paths/paths.go index ef75132d4..1dca5d588 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.PulsechainTestnetV3ChainName: - return networkDataDirCheckingLegacy(datadir, "pulsechain-testnet-v3") + case networkname.PulsechainTestnetV4ChainName: + return networkDataDirCheckingLegacy(datadir, "pulsechain-testnet-v4") default: return datadir diff --git a/core/genesis.go b/core/genesis.go index eaccde81c..c6984e85e 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -318,7 +318,7 @@ func WriteGenesisBlock(db kv.RwTx, genesis *Genesis, overrideShanghaiTime *big.I func (g *Genesis) configOrDefault(genesisHash libcommon.Hash, chainId uint64) *chain.Config { pulseChainConfig := params.ChainConfigByChainName(networkname.PulsechainChainName) - pulseChainTestnetV3Config := params.ChainConfigByChainName(networkname.PulsechainTestnetV3ChainName) + pulseChainTestnetV4Config := params.ChainConfigByChainName(networkname.PulsechainTestnetV4ChainName) config := &chain.Config{} switch { case g != nil: @@ -326,8 +326,8 @@ func (g *Genesis) configOrDefault(genesisHash libcommon.Hash, chainId uint64) *c case pulseChainConfig.ChainID.Uint64() == chainId: config = params.ChainConfigByChainName(networkname.PulsechainChainName) break - case pulseChainTestnetV3Config.ChainID.Uint64() == chainId: - config = params.ChainConfigByChainName(networkname.PulsechainTestnetV3ChainName) + case pulseChainTestnetV4Config.ChainID.Uint64() == chainId: + config = params.ChainConfigByChainName(networkname.PulsechainTestnetV4ChainName) break default: config = params.ChainConfigByGenesisHash(genesisHash) @@ -796,9 +796,9 @@ func DefaultPulsechainGenesisBlock() *Genesis { } } -func DefaultPulsechainTestnetV3GenesisBlock() *Genesis { +func DefaultPulsechainTestnetV4GenesisBlock() *Genesis { return &Genesis{ - Config: params.PulsechainTestnetV3ChainConfig, + Config: params.PulsechainTestnetV4ChainConfig, Nonce: 66, ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"), GasLimit: 5000, @@ -887,8 +887,8 @@ func DefaultGenesisBlockByChainName(chain string) *Genesis { return DefaultPulsechainGenesisBlock() case networkname.PulsechainDevnetChainName: return DefaultPulsechainDevnetGenesisBlock() - case networkname.PulsechainTestnetV3ChainName: - return DefaultPulsechainTestnetV3GenesisBlock() + case networkname.PulsechainTestnetV4ChainName: + return DefaultPulsechainTestnetV4GenesisBlock() default: return nil } diff --git a/core/skip_analysis.go b/core/skip_analysis.go index 7d61c3a44..b681b1a0b 100644 --- a/core/skip_analysis.go +++ b/core/skip_analysis.go @@ -41,7 +41,7 @@ var analysisBlocks = map[string][]uint64{ networkname.BSCChainName: {19_278_044}, 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}, + 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 { diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 4b753242e..4c0b36600 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -93,7 +93,7 @@ var Defaults = Config{ DeprecatedTxPool: core.DeprecatedDefaultTxPoolConfig, RPCGasCap: 50000000, GPO: FullNodeGPO, - RPCTxFeeCap: 1, // 1 ether + RPCTxFeeCap: 1000000, // 1 million ether ImportMode: false, Snapshot: Snapshot{ diff --git a/go.mod b/go.mod index 1ab656160..5a86bae2d 100644 --- a/go.mod +++ b/go.mod @@ -82,7 +82,7 @@ require ( github.com/valyala/fastjson v1.6.4 github.com/vektah/gqlparser/v2 v2.5.1 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/atomic v1.10.0 go.uber.org/zap v1.24.0 golang.org/x/crypto v0.6.0 diff --git a/go.sum b/go.sum index a776be9f0..148261520 100644 --- a/go.sum +++ b/go.sum @@ -953,6 +953,8 @@ gitlab.com/pulsechaincom/erigon-lib v1.0.4 h1:Rx7o8SB07GUoVR90KUjtPzcMB0sSYm9gr2 gitlab.com/pulsechaincom/erigon-lib v1.0.4/go.mod h1:nyJqfX9uPm1P/poZB1211DFe5DnAKOhYqvkEPyW7dXM= 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.4 h1:i0X9LQINUyOUTb5Eak1bZzwyDzo9aS8hBbMOygXazdM= +gitlab.com/pulsechaincom/erigon-pulse-snapshot v0.0.4/go.mod h1:U/W4jVFkJQ1XeXul9ng2MFGYRV2bBqTxVjSEojtm18c= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= diff --git a/params/bootnodes.go b/params/bootnodes.go index 8e48fdb16..b842f8f69 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -248,12 +248,12 @@ var PulsechainBootnodes = []string{ // Pulsechain Go Bootnodes } -// 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 +// PulsechainTestnetV4Bootnodes are the enode URLs of the P2P bootstrap nodes running on +// the Pulsechain Testnet V4 network. +var PulsechainTestnetV4Bootnodes = []string{ + "enode://499f821836b8fec272c0664e79b95e8ec50b4320d201e02ac83c5bf63bcff33869c411e8290b1774d74ed01b7a53e838e3689cfe46992243094886a0980a9c60@3.142.166.203:30303", // bootnode-aws-us-east-2-001 + "enode://133f45485d3b5221d10e5ed288bf1da827d5adbe454a9a9ae3cd4ae15d14b65d0b6d937b0a1a0ba3b9b2ebbf50c40e379573293f1ff51b553e997d843faa2c4b@18.118.188.165:30303", // bootnode-aws-us-east-2-002 + "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 @@ -264,7 +264,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.PulsechainTestnetV3ChainName) { + if networkID == NetworkIDByChainName(networkname.PulsechainChainName) || networkID == NetworkIDByChainName(networkname.PulsechainTestnetV4ChainName) { tld = ".pulsedisco.net" dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@" } @@ -272,8 +272,10 @@ func KnownDNSNetwork(genesis libcommon.Hash, networkID uint64, protocol string) switch genesis { case MainnetGenesisHash: switch networkID { - case NetworkIDByChainName(networkname.PulsechainTestnetV3ChainName): - net = "testnet-v3" + case NetworkIDByChainName(networkname.PulsechainTestnetV4ChainName): + // Using short name here because the tld "pulsedisco" is + // unique, we don't need a pulsechain- prefix. + net = "testnet-v4" default: net = "mainnet" } @@ -315,8 +317,8 @@ func BootnodeURLsOfChain(chain string) []string { return ChiadoBootnodes case networkname.PulsechainChainName: return PulsechainBootnodes - case networkname.PulsechainTestnetV3ChainName: - return PulsechainTestnetV3Bootnodes + case networkname.PulsechainTestnetV4ChainName: + return PulsechainTestnetV4Bootnodes default: return []string{} } diff --git a/params/chainspecs/pulsechain-testnet-v3.json b/params/chainspecs/pulsechain-testnet-v4.json similarity index 87% rename from params/chainspecs/pulsechain-testnet-v3.json rename to params/chainspecs/pulsechain-testnet-v4.json index 6c227db37..89b74b3cc 100644 --- a/params/chainspecs/pulsechain-testnet-v3.json +++ b/params/chainspecs/pulsechain-testnet-v4.json @@ -1,6 +1,6 @@ { - "ChainName": "pulsechain-testnet-v3", - "chainId": 942, + "ChainName": "pulsechain-testnet-v4", + "chainId": 943, "consensus": "ethash", "homesteadBlock": 1150000, "daoForkBlock": 1920000, @@ -24,7 +24,7 @@ "pulseChain": { "treasury": { "addr": "0xA592ED65885bcbCeb30442F4902a0D1Cf3AcB8fC", - "balance": "0xc9f2c9cd04674edea40000000" + "balance": "0x314DC6448D9338C15B0A00000000" } } } \ No newline at end of file diff --git a/params/config.go b/params/config.go index c95dc082f..94c4375be 100644 --- a/params/config.go +++ b/params/config.go @@ -159,7 +159,7 @@ var ( 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, "") @@ -257,8 +257,8 @@ func ChainConfigByChainName(chain string) *chain.Config { return PulsechainChainConfig case networkname.PulsechainDevnetChainName: return PulsechainDevnetChainConfig - case networkname.PulsechainTestnetV3ChainName: - return PulsechainTestnetV3ChainConfig + case networkname.PulsechainTestnetV4ChainName: + return PulsechainTestnetV4ChainConfig default: return nil } @@ -296,7 +296,7 @@ func GenesisHashByChainName(chain string) *libcommon.Hash { return &PulsechainGenesisHash case networkname.PulsechainDevnetChainName: return &PulsechainDevnetGenesisHash - case networkname.PulsechainTestnetV3ChainName: + case networkname.PulsechainTestnetV4ChainName: return &PulsechainTetnetGenesisHash default: return nil diff --git a/params/networkname/network_name.go b/params/networkname/network_name.go index 10d6bab17..453651753 100644 --- a/params/networkname/network_name.go +++ b/params/networkname/network_name.go @@ -17,7 +17,7 @@ const ( ChiadoChainName = "chiado" PulsechainChainName = "pulsechain" PulsechainDevnetChainName = "pulsechain-devnet" - PulsechainTestnetV3ChainName = "pulsechain-testnet-v3" + PulsechainTestnetV4ChainName = "pulsechain-testnet-v4" ) var All = []string{ @@ -36,5 +36,5 @@ var All = []string{ ChiadoChainName, PulsechainChainName, PulsechainDevnetChainName, - PulsechainTestnetV3ChainName, + PulsechainTestnetV4ChainName, } diff --git a/turbo/node/node.go b/turbo/node/node.go index 260c4f491..47ffe3618 100644 --- a/turbo/node/node.go +++ b/turbo/node/node.go @@ -78,8 +78,8 @@ func NewNodConfigUrfave(ctx *cli.Context) *nodecfg.Config { log.Info("Starting Erigon on PulseChain...") case networkname.PulsechainDevnetChainName: log.Info("Starting Erigon on PulseChain Devnet...") - case networkname.PulsechainTestnetV3ChainName: - log.Info("Starting Erigon on PulseChain Testnet V3...") + case networkname.PulsechainTestnetV4ChainName: + log.Info("Starting Erigon on PulseChain Testnet V4...") case "", networkname.MainnetChainName: if !ctx.IsSet(utils.NetworkIdFlag.Name) { log.Info("Starting Erigon on Ethereum mainnet...") diff --git a/turbo/snapshotsync/snapcfg/util.go b/turbo/snapshotsync/snapcfg/util.go index 2939c0d26..e820b7011 100644 --- a/turbo/snapshotsync/snapcfg/util.go +++ b/turbo/snapshotsync/snapcfg/util.go @@ -24,7 +24,7 @@ var ( Gnosis = fromToml(snapshothashes.Gnosis) Chiado = fromToml(snapshothashes.Chiado) PulseChainMainnet = fromToml(pulseSnapshotHashes.PulseChainMainnet) - PulseChainTestnetV3 = fromToml(pulseSnapshotHashes.PulseChainTestnetV3) + PulseChainTestnetV4 = fromToml(pulseSnapshotHashes.PulseChainTestnetV4) MainnetHistory = fromToml(snapshothashes.MainnetHistory) SepoliaHistory = fromToml(snapshothashes.SepoliaHistory) @@ -35,7 +35,7 @@ var ( GnosisHistory = fromToml(snapshothashes.GnosisHistory) ChiadoHistory = fromToml(snapshothashes.ChiadoHistory) PulseChainMainnetHistory = fromToml(pulseSnapshotHashes.PulseChainMainnetHistory) - PulseChainTestnetV3History = fromToml(pulseSnapshotHashes.PulseChainTestnetV3History) + PulseChainTestnetV4History = fromToml(pulseSnapshotHashes.PulseChainTestnetV4History) ) type PreverifiedItem struct { @@ -71,7 +71,7 @@ var ( GnosisChainSnapshotCfg = newCfg(Gnosis, GnosisHistory) ChiadoChainSnapshotCfg = newCfg(Chiado, ChiadoHistory) PulseChainMainnetChainSnapshotCfg = newCfg(PulseChainMainnet, PulseChainMainnetHistory) - PulseChainTestnetV3ChainSnapshotCfg = newCfg(PulseChainTestnetV3, PulseChainTestnetV3History) + PulseChainTestnetV4ChainSnapshotCfg = newCfg(PulseChainTestnetV4, PulseChainTestnetV4History) ) func newCfg(preverified, preverifiedHistory Preverified) *Cfg { @@ -124,7 +124,7 @@ var KnownCfgs = map[string]*Cfg{ networkname.GnosisChainName: GnosisChainSnapshotCfg, networkname.ChiadoChainName: ChiadoChainSnapshotCfg, networkname.PulsechainChainName: PulseChainMainnetChainSnapshotCfg, - networkname.PulsechainTestnetV3ChainName: PulseChainTestnetV3ChainSnapshotCfg, + networkname.PulsechainTestnetV4ChainName: PulseChainTestnetV4ChainSnapshotCfg, } // KnownCfg return list of preverified hashes for given network, but apply whiteList filter if it's not empty