Skip to content

Commit

Permalink
Remove stale networks rinkeby and gorli
Browse files Browse the repository at this point in the history
  • Loading branch information
alanorwick authored and wizeguyy committed Jan 25, 2023
1 parent b8d77bd commit 8be74f9
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 244 deletions.
3 changes: 0 additions & 3 deletions cmd/go-quai/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ It expects the genesis file as argument.`,
Flags: []cli.Flag{
utils.ColosseumFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.CalaverasFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
Expand Down
14 changes: 1 addition & 13 deletions cmd/go-quai/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ var (
utils.DeveloperFlag,
utils.DeveloperPeriodFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.CalaverasFlag,
utils.VMEnableDebugFlag,
utils.NetworkIdFlag,
utils.QuaiStatsURLFlag,
Expand Down Expand Up @@ -229,15 +226,6 @@ func prepare(ctx *cli.Context) {
case ctx.GlobalIsSet(utils.GardenFlag.Name):
log.Info("Starting Quai on Garden testnet...")

case ctx.GlobalIsSet(utils.RinkebyFlag.Name):
log.Info("Starting Quai on Rinkeby testnet...")

case ctx.GlobalIsSet(utils.GoerliFlag.Name):
log.Info("Starting Quai on Görli testnet...")

case ctx.GlobalIsSet(utils.CalaverasFlag.Name):
log.Info("Starting Quai on Calaveras testnet...")

case ctx.GlobalIsSet(utils.DeveloperFlag.Name):
log.Info("Starting Quai in ephemeral dev mode...")

Expand All @@ -247,7 +235,7 @@ func prepare(ctx *cli.Context) {
// If we're a full node on colosseum without --cache specified, bump default cache allowance
if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {
// Make sure we're not on any supported preconfigured testnet either
if !ctx.GlobalIsSet(utils.GardenFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
if !ctx.GlobalIsSet(utils.GardenFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on colosseum. Bump that cache up!
log.Info("Bumping default cache on colosseum", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096)
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(4096))
Expand Down
10 changes: 0 additions & 10 deletions cmd/go-quai/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ var (
utils.DataDirFlag,
utils.AncientFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.CacheTrieJournalFlag,
utils.BloomFilterSizeFlag,
},
Expand Down Expand Up @@ -91,8 +89,6 @@ the trie clean cache with default directory will be deleted.
utils.DataDirFlag,
utils.AncientFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
},
Description: `
quai snapshot verify-state <state-root>
Expand All @@ -111,8 +107,6 @@ In other words, this command does the snapshot to trie conversion.
utils.DataDirFlag,
utils.AncientFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
},
Description: `
quai snapshot traverse-state <state-root>
Expand All @@ -133,8 +127,6 @@ It's also usable without snapshot enabled.
utils.DataDirFlag,
utils.AncientFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
},
Description: `
quai snapshot traverse-rawstate <state-root>
Expand All @@ -156,8 +148,6 @@ It's also usable without snapshot enabled.
utils.DataDirFlag,
utils.AncientFlag,
utils.GardenFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.ExcludeCodeFlag,
utils.ExcludeStorageFlag,
utils.StartKeyFlag,
Expand Down
3 changes: 0 additions & 3 deletions cmd/go-quai/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ var AppHelpFlagGroups = []flags.FlagGroup{
utils.USBFlag,
utils.NetworkIdFlag,
utils.ColosseumFlag,
utils.GoerliFlag,
utils.RinkebyFlag,
utils.CalaverasFlag,
utils.GardenFlag,
utils.SyncModeFlag,
utils.ExitWhenSyncedFlag,
Expand Down
55 changes: 1 addition & 54 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,6 @@ var (
Name: "colosseum",
Usage: "Quai Colosseum testnet",
}
GoerliFlag = cli.BoolFlag{
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.",
}
RinkebyFlag = cli.BoolFlag{
Name: "rinkeby",
Usage: "Rinkeby network: pre-configured proof-of-authority test network",
}
GardenFlag = cli.BoolFlag{
Name: "garden",
Usage: "Garden network: pre-configured proof-of-work test network",
Expand Down Expand Up @@ -671,12 +659,6 @@ func MakeDataDir(ctx *cli.Context) string {
// Maintain compatibility with older Geth configurations storing the
// Garden database in `testnet` instead of `garden`.
path = filepath.Join(path, "garden")
} else if ctx.GlobalBool(RinkebyFlag.Name) {
path = filepath.Join(path, "rinkeby")
} else if ctx.GlobalBool(GoerliFlag.Name) {
path = filepath.Join(path, "goerli")
} else if ctx.GlobalBool(CalaverasFlag.Name) {
path = filepath.Join(path, "calaveras")
}
// Set specific directory for node location within the hierarchy
switch common.NodeLocation.Context() {
Expand Down Expand Up @@ -738,12 +720,6 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = SplitAndTrim(ctx.GlobalString(BootnodesFlag.Name))
case ctx.GlobalBool(GardenFlag.Name):
urls = params.GardenBootnodes
case ctx.GlobalBool(RinkebyFlag.Name):
urls = params.RinkebyBootnodes
case ctx.GlobalBool(GoerliFlag.Name):
urls = params.GoerliBootnodes
case ctx.GlobalBool(CalaverasFlag.Name):
urls = params.CalaverasBootnodes
case cfg.BootstrapNodes != nil:
return // already set, don't apply defaults.
}
Expand Down Expand Up @@ -1093,12 +1069,6 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = "" // unless explicitly requested, use memory databases
case ctx.GlobalBool(GardenFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "garden")
case ctx.GlobalBool(RinkebyFlag.Name) && cfg.DataDir == node.DefaultDataDir():
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")
}
// Set specific directory for node location within the hierarchy
switch common.NodeLocation.Context() {
Expand Down Expand Up @@ -1287,7 +1257,7 @@ func SetGlobalVars(ctx *cli.Context) {
// 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, ColosseumFlag, DeveloperFlag, GardenFlag, RinkebyFlag, GoerliFlag, CalaverasFlag)
CheckExclusive(ctx, ColosseumFlag, DeveloperFlag, GardenFlag)
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer

if ctx.GlobalString(GCModeFlag.Name) == "archive" && ctx.GlobalUint64(TxLookupLimitFlag.Name) != 0 {
Expand Down Expand Up @@ -1422,23 +1392,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
cfg.Genesis = core.DefaultGardenGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.GardenGenesisHash)
case ctx.GlobalBool(RinkebyFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 4
}
cfg.Genesis = core.DefaultRinkebyGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.RinkebyGenesisHash)
case ctx.GlobalBool(GoerliFlag.Name):
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 5
}
cfg.Genesis = core.DefaultGoerliGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.GoerliGenesisHash)
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
Expand Down Expand Up @@ -1565,12 +1518,6 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultGenesisBlock()
case ctx.GlobalBool(GardenFlag.Name):
genesis = core.DefaultGardenGenesisBlock()
case ctx.GlobalBool(RinkebyFlag.Name):
genesis = core.DefaultRinkebyGenesisBlock()
case ctx.GlobalBool(GoerliFlag.Name):
genesis = core.DefaultGoerliGenesisBlock()
case ctx.GlobalBool(CalaverasFlag.Name):
genesis = core.DefaultCalaverasGenesisBlock()
case ctx.GlobalBool(DeveloperFlag.Name):
Fatalf("Developer chains are ephemeral")
}
Expand Down
39 changes: 0 additions & 39 deletions core/forkid/forkid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,45 +92,6 @@ func TestCreation(t *testing.T) {
{11000000, ID{Hash: checksumToBytes(0x7119b6b3), Next: 0}}, // Future London block
},
},
// Rinkeby test cases
{
params.RinkebyChainConfig,
params.RinkebyGenesisHash,
[]testcase{
{0, ID{Hash: checksumToBytes(0x3b8e0691), Next: 1}}, // Unsynced, last Frontier block
{1, ID{Hash: checksumToBytes(0x60949295), Next: 2}}, // First and last Homestead block
{2, ID{Hash: checksumToBytes(0x8bde40dd), Next: 3}}, // First and last Tangerine block
{3, ID{Hash: checksumToBytes(0xcb3a64bb), Next: 1035301}}, // First Spurious block
{1035300, ID{Hash: checksumToBytes(0xcb3a64bb), Next: 1035301}}, // Last Spurious block
{1035301, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // First Byzantium block
{3660662, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // Last Byzantium block
{3660663, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // First Constantinople block
{4321233, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // Last Constantinople block
{4321234, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // First Petersburg block
{5435344, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // Last Petersburg block
{5435345, ID{Hash: checksumToBytes(0xcbdb8838), Next: 8290928}}, // First Istanbul block
{8290927, ID{Hash: checksumToBytes(0xcbdb8838), Next: 8290928}}, // Last Istanbul block
{8290928, ID{Hash: checksumToBytes(0x6910c8bd), Next: 8897988}}, // First Berlin block
{8897987, ID{Hash: checksumToBytes(0x6910c8bd), Next: 8897988}}, // Last Berlin block
{8897988, ID{Hash: checksumToBytes(0x8E29F2F3), Next: 0}}, // First London block
{10000000, ID{Hash: checksumToBytes(0x8E29F2F3), Next: 0}}, // Future London block
},
},
// Goerli test cases
{
params.GoerliChainConfig,
params.GoerliGenesisHash,
[]testcase{
{0, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople and first Petersburg block
{1561650, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Last Petersburg block
{1561651, ID{Hash: checksumToBytes(0xc25efa5c), Next: 4460644}}, // First Istanbul block
{4460643, ID{Hash: checksumToBytes(0xc25efa5c), Next: 4460644}}, // Last Istanbul block
{4460644, ID{Hash: checksumToBytes(0x757a1c47), Next: 5062605}}, // First Berlin block
{5000000, ID{Hash: checksumToBytes(0x757a1c47), Next: 5062605}}, // Last Berlin block
{5062605, ID{Hash: checksumToBytes(0xB8C6299D), Next: 0}}, // First London block
{6000000, ID{Hash: checksumToBytes(0xB8C6299D), Next: 0}}, // Future London block
},
},
}
for i, tt := range tests {
for j, ttt := range tt.cases {
Expand Down
42 changes: 0 additions & 42 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,6 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
return params.ColosseumChainConfig
case ghash == params.GardenGenesisHash:
return params.GardenChainConfig
case ghash == params.RinkebyGenesisHash:
return params.RinkebyChainConfig
case ghash == params.GoerliGenesisHash:
return params.GoerliChainConfig
case ghash == params.CalaverasGenesisHash:
return params.CalaverasChainConfig
default:
return params.AllBlake3powProtocolChanges
}
Expand Down Expand Up @@ -391,42 +385,6 @@ func DefaultGardenGenesisBlock() *Genesis {
}
}

// DefaultRinkebyGenesisBlock returns the Rinkeby network genesis block.
func DefaultRinkebyGenesisBlock() *Genesis {
return &Genesis{
Config: params.RinkebyChainConfig,
Timestamp: 1492009146,
ExtraData: hexutil.MustDecode("0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: []uint64{4700000, 4700000, 4700000},
Difficulty: []*big.Int{big.NewInt(1), big.NewInt(1), big.NewInt(1)},
Alloc: decodePrealloc(rinkebyAllocData),
}
}

// DefaultGoerliGenesisBlock returns the Görli network genesis block.
func DefaultGoerliGenesisBlock() *Genesis {
return &Genesis{
Config: params.GoerliChainConfig,
Timestamp: 1548854791,
ExtraData: hexutil.MustDecode("0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: []uint64{10485760, 10485760, 10485760},
Difficulty: []*big.Int{big.NewInt(1), big.NewInt(1), big.NewInt(1)},
Alloc: decodePrealloc(goerliAllocData),
}
}

func DefaultCalaverasGenesisBlock() *Genesis {
// Full genesis: https://gist.github.com/holiman/c6ed9269dce28304ad176314caa75e97
return &Genesis{
Config: params.CalaverasChainConfig,
Timestamp: 0x60b3877f,
ExtraData: hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000005211cea3870c7ba7c6c44b185e62eecdb864cd8c560228ce57d31efbf64c200b2c200aacec78cf17a7148e784fe95a7a750335f8b9572ee28d72e7650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: []uint64{0x47b760, 0x47b760, 0x47b760},
Difficulty: []*big.Int{big.NewInt(1), big.NewInt(1), big.NewInt(1)},
Alloc: decodePrealloc(calaverasAllocData),
}
}

// DeveloperGenesisBlock returns the 'geth --dev' genesis block.
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
// Override the default period to the user requested one
Expand Down
5 changes: 1 addition & 4 deletions core/genesis_alloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,4 @@ package core

// nolint: misspell
const colosseumAllocData = "\xc0"
const gardenAllocData = "\xc0"
const rinkebyAllocData = "\xc0"
const goerliAllocData = "\xc0"
const calaverasAllocData = "\xc0"
const gardenAllocData = "\xc0"
16 changes: 0 additions & 16 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ var ColosseumBootnodes = []string{
// Garden test network.
var GardenBootnodes = []string{}

// RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Rinkeby test network.
var RinkebyBootnodes = []string{}

// GoerliBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Görli test network.
var GoerliBootnodes = []string{}

// CalaverasBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Calaveras ephemeral test network.
var CalaverasBootnodes = []string{}

var V5Bootnodes = []string{}

const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@"
Expand All @@ -56,10 +44,6 @@ func KnownDNSNetwork(genesis common.Hash, protocol string) string {
net = "colosseum"
case GardenGenesisHash:
net = "garden"
case RinkebyGenesisHash:
net = "rinkeby"
case GoerliGenesisHash:
net = "goerli"
default:
return ""
}
Expand Down
Loading

0 comments on commit 8be74f9

Please sign in to comment.