From b10062a8566c82ce8b29892e133d3e5226b4df46 Mon Sep 17 00:00:00 2001 From: Zachinquarantine Date: Tue, 17 Aug 2021 12:43:25 -0400 Subject: [PATCH] cmd, core: remove calaveras testnet (#23366) --- cmd/geth/chaincmd.go | 1 - cmd/geth/consolecmd.go | 2 -- cmd/geth/dbcmd.go | 8 -------- cmd/geth/main.go | 4 ---- cmd/geth/usage.go | 1 - cmd/utils/flags.go | 20 +------------------- core/genesis.go | 13 ------------- core/genesis_test.go | 4 ---- params/bootnodes.go | 6 ------ params/config.go | 22 ---------------------- 10 files changed, 1 insertion(+), 80 deletions(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index a57449857f71..b2465792f764 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -68,7 +68,6 @@ It expects the genesis file as argument.`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, }, diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index ff2f32ab50e5..49eb768ecd7b 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -134,8 +134,6 @@ func remoteConsole(ctx *cli.Context) error { path = filepath.Join(path, "rinkeby") } else if ctx.GlobalBool(utils.GoerliFlag.Name) { path = filepath.Join(path, "goerli") - } else if ctx.GlobalBool(utils.CalaverasFlag.Name) { - path = filepath.Join(path, "calaveras") } else if ctx.GlobalBool(utils.SyscoinFlag.Name) { path = filepath.Join(path, "syscoin") } else if ctx.GlobalBool(utils.TanenbaumFlag.Name) { diff --git a/cmd/geth/dbcmd.go b/cmd/geth/dbcmd.go index bb1f66b90185..346fbc29718a 100644 --- a/cmd/geth/dbcmd.go +++ b/cmd/geth/dbcmd.go @@ -75,7 +75,6 @@ Remove blockchain and state databases`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, }, @@ -93,7 +92,6 @@ Remove blockchain and state databases`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, }, @@ -109,7 +107,6 @@ Remove blockchain and state databases`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, utils.CacheFlag, @@ -131,7 +128,6 @@ corruption if it is aborted during execution'!`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, }, @@ -149,7 +145,6 @@ corruption if it is aborted during execution'!`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, }, @@ -168,7 +163,6 @@ WARNING: This is a low-level operation which may cause database corruption!`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, }, @@ -187,7 +181,6 @@ WARNING: This is a low-level operation which may cause database corruption!`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, }, @@ -205,7 +198,6 @@ WARNING: This is a low-level operation which may cause database corruption!`, utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, }, diff --git a/cmd/geth/main.go b/cmd/geth/main.go index d938c94a86ea..7a343d89e8aa 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -140,7 +140,6 @@ var ( utils.RopstenFlag, utils.RinkebyFlag, utils.GoerliFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, utils.VMEnableDebugFlag, @@ -282,9 +281,6 @@ func prepare(ctx *cli.Context) { case ctx.GlobalIsSet(utils.GoerliFlag.Name): log.Info("Starting Geth on Görli testnet...") - case ctx.GlobalIsSet(utils.CalaverasFlag.Name): - log.Info("Starting Geth on Calaveras testnet...") - case ctx.GlobalIsSet(utils.SyscoinFlag.Name): log.Info("Starting Geth on Syscoin...") diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 8f729204524d..7ef23f4ac3c7 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -44,7 +44,6 @@ var AppHelpFlagGroups = []flags.FlagGroup{ utils.MainnetFlag, utils.GoerliFlag, utils.RinkebyFlag, - utils.CalaverasFlag, utils.SyscoinFlag, utils.TanenbaumFlag, utils.RopstenFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 68cab4025c91..5a4d010a26d6 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -151,10 +151,6 @@ var ( Name: "goerli", Usage: "Görli network: pre-configured proof-of-authority test network", } - CalaverasFlag = cli.BoolFlag{ - Name: "calaveras", - Usage: "Calaveras network: pre-configured proof-of-authority shortlived test network.", - } SyscoinFlag = cli.BoolFlag{ Name: "syscoin", Usage: "Syscoin network: pre-configured NEVM-based syscoin network.", @@ -814,9 +810,6 @@ func MakeDataDir(ctx *cli.Context) string { if ctx.GlobalBool(GoerliFlag.Name) { return filepath.Join(path, "goerli") } - if ctx.GlobalBool(CalaverasFlag.Name) { - return filepath.Join(path, "calaveras") - } if ctx.GlobalBool(SyscoinFlag.Name) { return filepath.Join(path, "syscoin") } @@ -875,8 +868,6 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { urls = params.RinkebyBootnodes case ctx.GlobalBool(GoerliFlag.Name): urls = params.GoerliBootnodes - case ctx.GlobalBool(CalaverasFlag.Name): - urls = params.CalaverasBootnodes case ctx.GlobalBool(SyscoinFlag.Name): urls = params.SyscoinBootnodes case ctx.GlobalBool(TanenbaumFlag.Name): @@ -1324,8 +1315,6 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) { cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby") case ctx.GlobalBool(GoerliFlag.Name) && cfg.DataDir == node.DefaultDataDir(): cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli") - case ctx.GlobalBool(CalaverasFlag.Name) && cfg.DataDir == node.DefaultDataDir(): - cfg.DataDir = filepath.Join(node.DefaultDataDir(), "calaveras") case ctx.GlobalBool(SyscoinFlag.Name) && cfg.DataDir == node.DefaultDataDir(): cfg.DataDir = filepath.Join(node.DefaultDataDir(), "syscoin") case ctx.GlobalBool(TanenbaumFlag.Name) && cfg.DataDir == node.DefaultDataDir(): @@ -1515,7 +1504,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, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, CalaverasFlag, SyscoinFlag, TanenbaumFlag) + CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, SyscoinFlag, TanenbaumFlag) CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light") CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 { @@ -1685,11 +1674,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { } cfg.Genesis = core.DefaultTanenbaumGenesisBlock() SetDNSDiscoveryDefaults(cfg, params.TanenbaumGenesisHash) - case ctx.GlobalBool(CalaverasFlag.Name): - if !ctx.GlobalIsSet(NetworkIdFlag.Name) { - cfg.NetworkId = 123 // https://gist.github.com/holiman/c5697b041b3dc18c50a5cdd382cbdd16 - } - cfg.Genesis = core.DefaultCalaverasGenesisBlock() case ctx.GlobalBool(DeveloperFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 1337 @@ -1910,8 +1894,6 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis { genesis = core.DefaultRinkebyGenesisBlock() case ctx.GlobalBool(GoerliFlag.Name): genesis = core.DefaultGoerliGenesisBlock() - case ctx.GlobalBool(CalaverasFlag.Name): - genesis = core.DefaultCalaverasGenesisBlock() case ctx.GlobalBool(SyscoinFlag.Name): genesis = core.DefaultSyscoinGenesisBlock() case ctx.GlobalBool(TanenbaumFlag.Name): diff --git a/core/genesis.go b/core/genesis.go index 7b26ca43da0f..3869ed8043dc 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -248,8 +248,6 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig { return params.RinkebyChainConfig case ghash == params.GoerliGenesisHash: return params.GoerliChainConfig - case ghash == params.CalaverasGenesisHash: - return params.CalaverasChainConfig case ghash == params.SyscoinGenesisHash: return params.SyscoinChainConfig case ghash == params.TanenbaumGenesisHash: @@ -403,17 +401,6 @@ func DefaultGoerliGenesisBlock() *Genesis { } } -func DefaultCalaverasGenesisBlock() *Genesis { - // Full genesis: https://gist.github.com/holiman/c6ed9269dce28304ad176314caa75e97 - return &Genesis{ - Config: params.CalaverasChainConfig, - Timestamp: 0x60b3877f, - ExtraData: hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000005211cea3870c7ba7c6c44b185e62eecdb864cd8c560228ce57d31efbf64c200b2c200aacec78cf17a7148e784fe95a7a750335f8b9572ee28d72e7650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), - GasLimit: 0x47b760, - Difficulty: big.NewInt(1), - Alloc: decodePrealloc(calaverasAllocData), - } -} // SYSCOIN func DefaultSyscoinGenesisBlock() *Genesis { diff --git a/core/genesis_test.go b/core/genesis_test.go index 7eb221ebd5f1..4e9ee3b9d9dd 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -185,10 +185,6 @@ func TestGenesisHashes(t *testing.T) { genesis: DefaultRinkebyGenesisBlock(), hash: params.RinkebyGenesisHash, }, - { - genesis: DefaultCalaverasGenesisBlock(), - hash: params.CalaverasGenesisHash, - }, // SYSCOIN { genesis: DefaultSyscoinGenesisBlock(), diff --git a/params/bootnodes.go b/params/bootnodes.go index d3fd500c2ac5..79545b5a22fb 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -67,12 +67,6 @@ var GoerliBootnodes = []string{ "enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@51.15.119.157:40303", } -// CalaverasBootnodes are the enode URLs of the P2P bootstrap nodes running on the -// Calaveras ephemeral test network. -var CalaverasBootnodes = []string{ - "enode://9e1096aa59862a6f164994cb5cb16f5124d6c992cdbf4535ff7dea43ea1512afe5448dca9df1b7ab0726129603f1a3336b631e4d7a1a44c94daddd03241587f9@3.9.20.133:30303", -} - // SyscoinBootnodes are the enode URLs of the P2P bootstrap nodes running on the // Syscoin NEVM-based network. var SyscoinBootnodes = []string{ diff --git a/params/config.go b/params/config.go index 96379d73d647..ecad35b5d16c 100644 --- a/params/config.go +++ b/params/config.go @@ -31,7 +31,6 @@ var ( RopstenGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d") RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177") GoerliGenesisHash = common.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a") - CalaverasGenesisHash = common.HexToHash("0xeb9233d066c275efcdfed8037f4fc082770176aefdbcb7691c71da412a5670f2") SyscoinGenesisHash = common.HexToHash("0x06213eb0669345b6b106bb19d9e2e198a8c06eae3a50e0f303a046ca6afd277f") TanenbaumGenesisHash = common.HexToHash("0x566d9454e219db7531bbfe882500cb12923ea22f5766917336a1cc81fc5b543d") ) @@ -308,27 +307,6 @@ var ( Threshold: 2, } - CalaverasChainConfig = &ChainConfig{ - ChainID: big.NewInt(123), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: nil, - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(500), - Clique: &CliqueConfig{ - Period: 30, - Epoch: 30000, - }, - } - // AllEthashProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Ethash consensus. //