Skip to content

Commit

Permalink
Remove testnets prior to spec v1.0.0 (#7802)
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvanloon committed Nov 13, 2020
1 parent 21d4c8f commit 8d50fa1
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 310 deletions.
32 changes: 1 addition & 31 deletions shared/featureconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ var log = logrus.WithField("prefix", "flags")
// Flags is a struct to represent which features the client will perform on runtime.
type Flags struct {
// Testnet Flags.
AltonaTestnet bool // AltonaTestnet defines the flag through which we can enable the node to run on the Altona testnet.
OnyxTestnet bool // OnyxTestnet defines the flag through which we can enable the node to run on the Onyx testnet.
MedallaTestnet bool // MedallaTestnet defines the flag through which we can enable the node to run on the Medalla testnet.
SpadinaTestnet bool // SpadinaTestnet defines the flag through which we can enable the node to run on the Spadina testnet.
ZinkenTestnet bool // ZinkenTestnet defines the flag through which we can enable the node to run on the Zinken testnet.
ToledoTestnet bool // ToledoTestnet defines the flag through which we can enable the node to run on the Toledo testnet.
PyrmontTestnet bool // PyrmontTestnet defines the flag through which we can enable the node to run on the Pyrmont testnet.

Expand Down Expand Up @@ -110,32 +105,7 @@ func InitWithReset(c *Flags) func() {

// configureTestnet sets the config according to specified testnet flag
func configureTestnet(ctx *cli.Context, cfg *Flags) {
if ctx.Bool(AltonaTestnet.Name) {
log.Warn("Running on Altona Testnet")
params.UseAltonaConfig()
params.UseAltonaNetworkConfig()
cfg.AltonaTestnet = true
} else if ctx.Bool(OnyxTestnet.Name) {
log.Warn("Running on Onyx Testnet")
params.UseOnyxConfig()
params.UseOnyxNetworkConfig()
cfg.OnyxTestnet = true
} else if ctx.Bool(MedallaTestnet.Name) {
log.Warn("Running on Medalla Testnet")
params.UseMedallaConfig()
params.UseMedallaNetworkConfig()
cfg.MedallaTestnet = true
} else if ctx.Bool(SpadinaTestnet.Name) {
log.Warn("Running on Spadina Testnet")
params.UseSpadinaConfig()
params.UseSpadinaNetworkConfig()
cfg.SpadinaTestnet = true
} else if ctx.Bool(ZinkenTestnet.Name) {
log.Warn("Running on Zinken Testnet")
params.UseZinkenConfig()
params.UseZinkenNetworkConfig()
cfg.ZinkenTestnet = true
} else if ctx.Bool(ToledoTestnet.Name) {
if ctx.Bool(ToledoTestnet.Name) {
log.Warn("Running on Toledo Testnet")
params.UseToledoConfig()
params.UseToledoNetworkConfig()
Expand Down
26 changes: 13 additions & 13 deletions shared/featureconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,44 @@ import (
func TestInitFeatureConfig(t *testing.T) {
defer Init(&Flags{})
cfg := &Flags{
MedallaTestnet: true,
PyrmontTestnet: true,
}
Init(cfg)
c := Get()
assert.Equal(t, true, c.MedallaTestnet)
assert.Equal(t, true, c.PyrmontTestnet)

// Reset back to false for the follow up tests.
cfg = &Flags{MedallaTestnet: false}
cfg = &Flags{PyrmontTestnet: false}
Init(cfg)
}

func TestInitWithReset(t *testing.T) {
defer Init(&Flags{})
Init(&Flags{
OnyxTestnet: true,
PyrmontTestnet: true,
})
assert.Equal(t, false, Get().AltonaTestnet)
assert.Equal(t, true, Get().OnyxTestnet)
assert.Equal(t, false, Get().ToledoTestnet)
assert.Equal(t, true, Get().PyrmontTestnet)

// Overwrite previously set value (value that didn't come by default).
resetCfg := InitWithReset(&Flags{
OnyxTestnet: false,
PyrmontTestnet: false,
})
assert.Equal(t, false, Get().AltonaTestnet)
assert.Equal(t, false, Get().OnyxTestnet)
assert.Equal(t, false, Get().ToledoTestnet)
assert.Equal(t, false, Get().PyrmontTestnet)

// Reset must get to previously set configuration (not to default config values).
resetCfg()
assert.Equal(t, false, Get().AltonaTestnet)
assert.Equal(t, true, Get().OnyxTestnet)
assert.Equal(t, false, Get().ToledoTestnet)
assert.Equal(t, true, Get().PyrmontTestnet)
}

func TestConfigureBeaconConfig(t *testing.T) {
app := cli.App{}
set := flag.NewFlagSet("test", 0)
set.Bool(MedallaTestnet.Name, true, "test")
set.Bool(PyrmontTestnet.Name, true, "test")
context := cli.NewContext(&app, set, nil)
ConfigureBeaconChain(context)
c := Get()
assert.Equal(t, true, c.MedallaTestnet)
assert.Equal(t, true, c.PyrmontTestnet)
}
40 changes: 0 additions & 40 deletions shared/featureconfig/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@ import (
)

var (
// AltonaTestnet flag for the multiclient eth2 testnet configuration.
AltonaTestnet = &cli.BoolFlag{
Name: "altona",
Usage: "This defines the flag through which we can run on the Altona Multiclient Testnet",
}
// OnyxTestnet flag for the Prysmatic Labs single-client testnet configuration.
OnyxTestnet = &cli.BoolFlag{
Name: "onyx",
Usage: "This defines the flag through which we can run on the Onyx Prysm Testnet",
}
// MedallaTestnet flag for the multiclient eth2 testnet.
MedallaTestnet = &cli.BoolFlag{
Name: "medalla",
Usage: "This defines the flag through which we can run on the Medalla Multiclient Testnet",
}
// ToledoTestnet flag for the multiclient eth2 testnet.
ToledoTestnet = &cli.BoolFlag{
Name: "toledo",
Expand All @@ -30,16 +15,6 @@ var (
Name: "pyrmont",
Usage: "This defines the flag through which we can run on the Pyrmont Multiclient Testnet",
}
// SpadinaTestnet flag for the multiclient eth2 testnet.
SpadinaTestnet = &cli.BoolFlag{
Name: "spadina",
Usage: "This defines the flag through which we can run on the Spadina Multiclient Testnet",
}
// ZinkenTestnet flag for the multiclient eth2 testnet.
ZinkenTestnet = &cli.BoolFlag{
Name: "zinken",
Usage: "This defines the flag through which we can run on the Zinken Multiclient Testnet",
}
// Mainnet flag for easier tooling, no-op
Mainnet = &cli.BoolFlag{
Value: true,
Expand Down Expand Up @@ -120,12 +95,7 @@ var devModeFlags = []cli.Flag{
var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
enableExternalSlasherProtectionFlag,
waitForSyncedFlag,
AltonaTestnet,
OnyxTestnet,
MedallaTestnet,
ToledoTestnet,
SpadinaTestnet,
ZinkenTestnet,
PyrmontTestnet,
Mainnet,
disableAccountsV2,
Expand All @@ -135,12 +105,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
// SlasherFlags contains a list of all the feature flags that apply to the slasher client.
var SlasherFlags = append(deprecatedFlags, []cli.Flag{
disableLookbackFlag,
AltonaTestnet,
OnyxTestnet,
MedallaTestnet,
ToledoTestnet,
SpadinaTestnet,
ZinkenTestnet,
PyrmontTestnet,
Mainnet,
}...)
Expand All @@ -158,12 +123,7 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
waitForSyncedFlag,
disableGRPCConnectionLogging,
attestationAggregationStrategy,
AltonaTestnet,
OnyxTestnet,
MedallaTestnet,
ToledoTestnet,
SpadinaTestnet,
ZinkenTestnet,
PyrmontTestnet,
Mainnet,
enableBlst,
Expand Down
5 changes: 0 additions & 5 deletions shared/params/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@ go_library(
"mainnet_config.go",
"minimal_config.go",
"network_config.go",
"testnet_altona_config.go",
"testnet_e2e_config.go",
"testnet_medalla_config.go",
"testnet_onyx_config.go",
"testnet_pyrmont_config.go",
"testnet_spadina_config.go",
"testnet_toledo_config.go",
"testnet_zinken_config.go",
"testutils.go",
],
importpath = "github.com/prysmaticlabs/prysm/shared/params",
Expand Down
41 changes: 0 additions & 41 deletions shared/params/testnet_altona_config.go

This file was deleted.

40 changes: 0 additions & 40 deletions shared/params/testnet_medalla_config.go

This file was deleted.

18 changes: 0 additions & 18 deletions shared/params/testnet_onyx_config.go

This file was deleted.

36 changes: 0 additions & 36 deletions shared/params/testnet_spadina_config.go

This file was deleted.

35 changes: 0 additions & 35 deletions shared/params/testnet_zinken_config.go

This file was deleted.

2 changes: 1 addition & 1 deletion tools/bootnode/bootnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type handler struct {

func main() {
// Using Medalla as the default configuration.
params.UseMedallaConfig()
params.UsePyrmontConfig()

flag.Parse()

Expand Down
3 changes: 1 addition & 2 deletions tools/cluster-pk-manager/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ type UnencryptedKeys struct {
}

func main() {
// Using Medalla as the default configuration.
params.UseMedallaConfig()
params.UsePyrmontConfig()

flag.Parse()

Expand Down

0 comments on commit 8d50fa1

Please sign in to comment.