From f2634a468bfcf18bb35a3a73cc4123ccabf2a773 Mon Sep 17 00:00:00 2001 From: Shane Bammel Date: Mon, 17 Apr 2023 12:38:50 -0500 Subject: [PATCH] Add network config for Testnet-V4 --- README.md | 8 ++++---- cmd/devp2p/nodesetcmd.go | 4 ++-- cmd/geth/main.go | 4 ++-- cmd/utils/flags.go | 32 ++++++++++++++++---------------- core/genesis.go | 10 +++++----- eth/ethconfig/config.go | 2 +- params/bootnodes.go | 18 +++++++++--------- params/pulse.go | 6 +++--- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 0f19109e2..56eca6863 100644 --- a/README.md +++ b/README.md @@ -115,12 +115,12 @@ use separate accounts for play and real money. Unless you manually move accounts, `geth` will by default correctly separate the two networks and will not make any accounts available between them.* -### **Full node on PulseChain Testnet V3** +### **Full node on PulseChain Testnet V4** -To connect to the PulseChain Testnet V3: +To connect to the PulseChain Testnet V4: ```shell -$ geth --pulsechain-testnet-v3 console +$ geth --pulsechain-testnet-v4 console ``` ### Configuration @@ -149,7 +149,7 @@ Docker: ```shell docker run -d --name pulsechain-execution-node -v /Users/alice/pulse:/root \ -p 8545:8545 -p 30303:30303 \ - registry.gitlab.com/pulsechaincom/go-pulse --pulsechain-testnet-v3 + registry.gitlab.com/pulsechaincom/go-pulse --pulsechain-testnet-v4 ``` This will start `geth` in snap-sync mode with a DB memory allowance of 1GB, as the diff --git a/cmd/devp2p/nodesetcmd.go b/cmd/devp2p/nodesetcmd.go index c0389e3bb..0379c99d2 100644 --- a/cmd/devp2p/nodesetcmd.go +++ b/cmd/devp2p/nodesetcmd.go @@ -232,8 +232,8 @@ func ethFilter(args []string) (nodeFilter, error) { filter = forkid.NewStaticFilter(params.MainnetChainConfig, core.DefaultGenesisBlock().ToBlock()) case "PulseChain": filter = forkid.NewStaticFilter(params.PulseChainConfig, core.DefaultGenesisBlock().ToBlock()) - case "PulseChainTestnetV3": - filter = forkid.NewStaticFilter(params.PulseChainTestnetV3Config, core.DefaultGenesisBlock().ToBlock()) + case "PulseChainTestnetV4": + filter = forkid.NewStaticFilter(params.PulseChainTestnetV4Config, core.DefaultGenesisBlock().ToBlock()) case "goerli": filter = forkid.NewStaticFilter(params.GoerliChainConfig, core.DefaultGoerliGenesisBlock().ToBlock()) case "sepolia": diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 9101b4d4a..f627edc53 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -290,8 +290,8 @@ func prepare(ctx *cli.Context) { case ctx.IsSet(utils.HoleskyFlag.Name): log.Info("Starting Geth on Holesky testnet...") - case ctx.IsSet(utils.PulseChainTestnetV3Flag.Name): - log.Info("Starting Geth on PulseChain Testnet V3...") + case ctx.IsSet(utils.PulseChainTestnetV4Flag.Name): + log.Info("Starting Geth on PulseChain Testnet V4...") case ctx.IsSet(utils.DeveloperFlag.Name): log.Info("Starting Geth in ephemeral dev mode...") diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 0cfd42b45..70a1364eb 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -159,9 +159,9 @@ var ( Usage: "Holesky network: pre-configured proof-of-stake test network", Category: flags.EthCategory, } - PulseChainTestnetV3Flag = &cli.BoolFlag{ - Name: "pulsechain-testnet-v3", - Usage: "PulseChain Testnet V3: pre-configured proof-of-stake test network", + PulseChainTestnetV4Flag = &cli.BoolFlag{ + Name: "pulsechain-testnet-v4", + Usage: "PulseChain Testnet V4: pre-configured proof-of-stake test network", } // Dev mode @@ -925,7 +925,7 @@ var ( GoerliFlag, SepoliaFlag, HoleskyFlag, - PulseChainTestnetV3Flag, + PulseChainTestnetV4Flag, } // NetworkFlags is the flag group of all built-in supported networks. NetworkFlags = append([]cli.Flag{ @@ -961,8 +961,8 @@ func MakeDataDir(ctx *cli.Context) string { if ctx.Bool(HoleskyFlag.Name) { return filepath.Join(path, "holesky") } - if ctx.Bool(PulseChainTestnetV3Flag.Name) { - return filepath.Join(path, "pulsechain-testnet-v3") + if ctx.Bool(PulseChainTestnetV4Flag.Name) { + return filepath.Join(path, "pulsechain-testnet-v4") } return path } @@ -1028,8 +1028,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { urls = params.SepoliaBootnodes case ctx.Bool(GoerliFlag.Name): urls = params.GoerliBootnodes - case ctx.Bool(PulseChainTestnetV3Flag.Name): - urls = params.PulseChainTestnetV3Bootnodes + case ctx.Bool(PulseChainTestnetV4Flag.Name): + urls = params.PulseChainTestnetV4Bootnodes } } cfg.BootstrapNodes = mustParseBootnodes(urls) @@ -1459,8 +1459,8 @@ func SetDataDir(ctx *cli.Context, cfg *node.Config) { cfg.DataDir = filepath.Join(node.DefaultDataDir(), "sepolia") case ctx.Bool(HoleskyFlag.Name) && cfg.DataDir == node.DefaultDataDir(): cfg.DataDir = filepath.Join(node.DefaultDataDir(), "holesky") - case ctx.Bool(PulseChainTestnetV3Flag.Name) && cfg.DataDir == node.DefaultDataDir(): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "pulsechain-testnet-v3") + case ctx.Bool(PulseChainTestnetV4Flag.Name) && cfg.DataDir == node.DefaultDataDir(): + cfg.DataDir = filepath.Join(node.DefaultDataDir(), "pulsechain-testnet-v4") } } @@ -1612,7 +1612,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) { // SetEthConfig applies eth-related command line flags to the config. func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { // Avoid conflicting network flags - CheckExclusive(ctx, MainnetFlag, PulseChainFlag, DeveloperFlag, GoerliFlag, SepoliaFlag, HoleskyFlag, PulseChainTestnetV3Flag) + CheckExclusive(ctx, MainnetFlag, PulseChainFlag, DeveloperFlag, GoerliFlag, SepoliaFlag, HoleskyFlag, PulseChainTestnetV4Flag) CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer // Set configurations from CLI flags @@ -1787,11 +1787,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } cfg.Genesis = core.DefaultGoerliGenesisBlock() SetDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash) - case ctx.Bool(PulseChainTestnetV3Flag.Name): + case ctx.Bool(PulseChainTestnetV4Flag.Name): if !ctx.IsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 942 + cfg.NetworkId = 943 } - cfg.Genesis = core.DefaultPulseChainTestnetV3GenesisBlock() + cfg.Genesis = core.DefaultPulseChainTestnetV4GenesisBlock() SetDNSDiscoveryDefaults(cfg, params.MainnetGenesisHash) case ctx.Bool(DeveloperFlag.Name): if !ctx.IsSet(NetworkIdFlag.Name) { @@ -2104,8 +2104,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { genesis = core.DefaultSepoliaGenesisBlock() case ctx.Bool(GoerliFlag.Name): genesis = core.DefaultGoerliGenesisBlock() - case ctx.Bool(PulseChainTestnetV3Flag.Name): - genesis = core.DefaultPulseChainTestnetV3GenesisBlock() + case ctx.Bool(PulseChainTestnetV4Flag.Name): + genesis = core.DefaultPulseChainTestnetV4GenesisBlock() case ctx.Bool(DeveloperFlag.Name): Fatalf("Developer chains are ephemeral") } diff --git a/core/genesis.go b/core/genesis.go index dfa6b0bdf..d872f68b1 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -380,8 +380,8 @@ func (g *Genesis) configOrDefault(ghash common.Hash, chainId uint64) *params.Cha switch chainId { case params.PulseChainConfig.ChainID.Uint64(): return params.PulseChainConfig - case params.PulseChainTestnetV3Config.ChainID.Uint64(): - return params.PulseChainTestnetV3Config + case params.PulseChainTestnetV4Config.ChainID.Uint64(): + return params.PulseChainTestnetV4Config default: return params.MainnetChainConfig } @@ -566,10 +566,10 @@ func DefaultHoleskyGenesisBlock() *Genesis { } } -// DefaultPulseChainTestnetV3GenesisBlock returns the PulseChain Testnet V3 genesis block. -func DefaultPulseChainTestnetV3GenesisBlock() *Genesis { +// DefaultPulseChainTestnetV4GenesisBlock returns the PulseChain Testnet V4 genesis block. +func DefaultPulseChainTestnetV4GenesisBlock() *Genesis { return &Genesis{ - Config: params.PulseChainTestnetV3Config, + Config: params.PulseChainTestnetV4Config, Nonce: 66, ExtraData: hexutil.MustDecode("0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"), GasLimit: 5000, diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index ad664afb5..bc7da36ed 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -66,7 +66,7 @@ var Defaults = Config{ RPCGasCap: 50000000, RPCEVMTimeout: 5 * time.Second, GPO: FullNodeGPO, - RPCTxFeeCap: 1, // 1 ether + RPCTxFeeCap: 1000000, // 1 million ether } //go:generate go run github.com/fjl/gencodec -type Config -formats toml -out gen_config.go diff --git a/params/bootnodes.go b/params/bootnodes.go index 337d5447d..e23ee6aff 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -40,12 +40,12 @@ var HoleskyBootnodes = []string{ // the main PulseChain network. var PulseChainBootnodes []string // TODO -// PulseChainTestnetV3Bootnodes are the enode URLs of the P2P bootstrap nodes running on -// the main PulseChain 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 } // SepoliaBootnodes are the enode URLs of the P2P bootstrap nodes running on the @@ -107,7 +107,7 @@ func KnownDNSNetwork(genesis common.Hash, networkId uint64, protocol string) str var dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@" var tld = ".ethdisco.net" - if networkId == PulseChainConfig.ChainID.Uint64() || networkId == PulseChainTestnetV3Config.ChainID.Uint64() { + if networkId == PulseChainConfig.ChainID.Uint64() || networkId == PulseChainTestnetV4Config.ChainID.Uint64() { tld = ".pulsedisco.net" dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@" } @@ -115,8 +115,8 @@ func KnownDNSNetwork(genesis common.Hash, networkId uint64, protocol string) str switch genesis { case MainnetGenesisHash: switch networkId { - case PulseChainTestnetV3Config.ChainID.Uint64(): - net = "testnet-v3" + case PulseChainTestnetV4Config.ChainID.Uint64(): + net = "testnet-v4" default: net = "mainnet" } diff --git a/params/pulse.go b/params/pulse.go index c464cf569..e2fa0cf2a 100644 --- a/params/pulse.go +++ b/params/pulse.go @@ -44,8 +44,8 @@ var ( PrimordialPulseBlock: big.NewInt(15_700_000), // TODO: UPDATE FORK BLOCK } - PulseChainTestnetV3Config = &ChainConfig{ - ChainID: big.NewInt(942), + PulseChainTestnetV4Config = &ChainConfig{ + ChainID: big.NewInt(943), HomesteadBlock: big.NewInt(1_150_000), DAOForkBlock: big.NewInt(1_920_000), DAOForkSupport: true, @@ -71,7 +71,7 @@ var ( func testnetTreasury() *Treasury { var pulseChainTestnetTreasuryBalance math.HexOrDecimal256 - pulseChainTestnetTreasuryBalance.UnmarshalText([]byte("0xC9F2C9CD04674EDEA40000000")) + pulseChainTestnetTreasuryBalance.UnmarshalText([]byte("0x314DC6448D9338C15B0A00000000")) return &Treasury{ Addr: "0xA592ED65885bcbCeb30442F4902a0D1Cf3AcB8fC",