Skip to content

Commit

Permalink
Make Mainnet Config Default, No More Demo Config (#5367)
Browse files Browse the repository at this point in the history
* bye bye demo config

* gaz

* fix usage

* fix dep

* gaz

* Update default balance for sendDeposits

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Preston Van Loon <[email protected]>
  • Loading branch information
3 people authored Apr 10, 2020
1 parent 97df02f commit 4256321
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 90 deletions.
1 change: 0 additions & 1 deletion beacon-chain/blockchain/process_attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func TestStore_SaveCheckpointState(t *testing.T) {
ctx := context.Background()
db := testDB.SetupDB(t)
defer testDB.TeardownDB(t, db)
params.UseDemoBeaconConfig()

cfg := &Config{
BeaconDB: db,
Expand Down
2 changes: 1 addition & 1 deletion endtoend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Evaluators have 3 parts, the name for it's test name, a `policy` which declares

## Current end-to-end tests
* Minimal Config - 4 beacon nodes, 64 validators, running for 6 epochs
* ~~Demo Config - 2 beacon nodes, 16,384 validators, running for 5 epochs~~ Disabled for now
* ~~Mainnet Config - 2 beacon nodes, 16,384 validators, running for 5 epochs~~ Disabled for now

## Instructions
If you wish to run all the E2E tests, you can run them through bazel with:
Expand Down
66 changes: 25 additions & 41 deletions shared/featureconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,28 @@ var log = logrus.WithField("prefix", "flags")

// Flags is a struct to represent which features the client will perform on runtime.
type Flags struct {
NoCustomConfig bool // NoCustomConfigFlag determines whether to launch a beacon chain using real parameters or demo parameters.
MinimalConfig bool // MinimalConfig as defined in the spec.
WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory.
InitSyncNoVerify bool // InitSyncNoVerify when initial syncing w/o verifying block's contents.
EnableDynamicCommitteeSubnets bool // Enables dynamic attestation committee subnets via p2p.
SkipBLSVerify bool // Skips BLS verification across the runtime.
EnableBackupWebhook bool // EnableBackupWebhook to allow database backups to trigger from monitoring port /db/backup.
PruneEpochBoundaryStates bool // PruneEpochBoundaryStates prunes the epoch boundary state before last finalized check point.
EnableSnappyDBCompression bool // EnableSnappyDBCompression in the database.
ProtectProposer bool // ProtectProposer prevents the validator client from signing any proposals that would be considered a slashable offense.
ProtectAttester bool // ProtectAttester prevents the validator client from signing any attestations that would be considered a slashable offense.
DisableStrictAttestationPubsubVerification bool // DisableStrictAttestationPubsubVerification will disabling strict signature verification in pubsub.
DisableUpdateHeadPerAttestation bool // DisableUpdateHeadPerAttestation will disabling update head on per attestation basis.
EnableByteMempool bool // EnaableByteMempool memory management.
EnableDomainDataCache bool // EnableDomainDataCache caches validator calls to DomainData per epoch.
EnableStateGenSigVerify bool // EnableStateGenSigVerify verifies proposer and randao signatures during state gen.
CheckHeadState bool // CheckHeadState checks the current headstate before retrieving the desired state from the db.
DontPruneStateStartUp bool // DontPruneStateStartUp disables pruning state upon beacon node start up.
DisableNewStateMgmt bool // NewStateMgmt disables the new state mgmt service.
DisableInitSyncQueue bool // DisableInitSyncQueue disables the new initial sync implementation.
EnableFieldTrie bool // EnableFieldTrie enables the state from using field specific tries when computing the root.
EnableBlockHTR bool // EnableBlockHTR enables custom hashing of our beacon blocks.
NoInitSyncBatchSaveBlocks bool // NoInitSyncBatchSaveBlocks disables batch save blocks mode during initial syncing.
MinimalConfig bool // MinimalConfig as defined in the spec.
WriteSSZStateTransitions bool // WriteSSZStateTransitions to tmp directory.
InitSyncNoVerify bool // InitSyncNoVerify when initial syncing w/o verifying block's contents.
EnableDynamicCommitteeSubnets bool // Enables dynamic attestation committee subnets via p2p.
SkipBLSVerify bool // Skips BLS verification across the runtime.
EnableBackupWebhook bool // EnableBackupWebhook to allow database backups to trigger from monitoring port /db/backup.
PruneEpochBoundaryStates bool // PruneEpochBoundaryStates prunes the epoch boundary state before last finalized check point.
EnableSnappyDBCompression bool // EnableSnappyDBCompression in the database.
ProtectProposer bool // ProtectProposer prevents the validator client from signing any proposals that would be considered a slashable offense.
ProtectAttester bool // ProtectAttester prevents the validator client from signing any attestations that would be considered a slashable offense.
DisableStrictAttestationPubsubVerification bool // DisableStrictAttestationPubsubVerification will disabling strict signature verification in pubsub.
DisableUpdateHeadPerAttestation bool // DisableUpdateHeadPerAttestation will disabling update head on per attestation basis.
EnableByteMempool bool // EnaableByteMempool memory management.
EnableDomainDataCache bool // EnableDomainDataCache caches validator calls to DomainData per epoch.
EnableStateGenSigVerify bool // EnableStateGenSigVerify verifies proposer and randao signatures during state gen.
CheckHeadState bool // CheckHeadState checks the current headstate before retrieving the desired state from the db.
DontPruneStateStartUp bool // DontPruneStateStartUp disables pruning state upon beacon node start up.
DisableNewStateMgmt bool // NewStateMgmt disables the new state mgmt service.
DisableInitSyncQueue bool // DisableInitSyncQueue disables the new initial sync implementation.
EnableFieldTrie bool // EnableFieldTrie enables the state from using field specific tries when computing the root.
EnableBlockHTR bool // EnableBlockHTR enables custom hashing of our beacon blocks.
NoInitSyncBatchSaveBlocks bool // NoInitSyncBatchSaveBlocks disables batch save blocks mode during initial syncing.
// DisableForkChoice disables using LMD-GHOST fork choice to update
// the head of the chain based on attestations and instead accepts any valid received block
// as the chain head. UNSAFE, use with caution.
Expand Down Expand Up @@ -221,27 +220,12 @@ func complainOnDeprecatedFlags(ctx *cli.Context) {
}

func configureConfig(ctx *cli.Context, cfg *Flags) *Flags {
if ctx.Bool(noCustomConfigFlag.Name) {
log.Warn("Using default mainnet config")
cfg.NoCustomConfig = true
}
if ctx.Bool(minimalConfigFlag.Name) {
log.Warn("Using minimal config")
cfg.MinimalConfig = true
}
// Use custom config values if the --no-custom-config flag is not set.
if !cfg.NoCustomConfig {
if cfg.MinimalConfig {
log.WithField(
"config", "minimal-spec",
).Info("Using custom chain parameters")
params.UseMinimalConfig()
} else {
log.WithField(
"config", "demo",
).Info("Using custom chain parameters")
params.UseDemoBeaconConfig()
}
params.UseMinimalConfig()
} else {
log.Warn("Using default mainnet config")
}
return cfg
}
11 changes: 6 additions & 5 deletions shared/featureconfig/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ var (
Name: "broadcast-slashing",
Usage: "Broadcast slashings from slashing pool.",
}
noCustomConfigFlag = &cli.BoolFlag{
Name: "no-custom-config",
Usage: "Run the beacon chain with the real parameters from phase 0.",
}
minimalConfigFlag = &cli.BoolFlag{
Name: "minimal-config",
Usage: "Use minimal config with parameters as defined in the spec.",
Expand Down Expand Up @@ -142,6 +138,11 @@ var (
const deprecatedUsage = "DEPRECATED. DO NOT USE."

var (
deprecatedNoCustomConfigFlag = &cli.BoolFlag{
Name: "no-custom-config",
Usage: deprecatedUsage,
Hidden: true,
}
deprecatedEnableNoiseHandshake = &cli.BoolFlag{
Name: "enable-noise",
Usage: deprecatedUsage,
Expand Down Expand Up @@ -280,6 +281,7 @@ var (
)

var deprecatedFlags = []cli.Flag{
deprecatedNoCustomConfigFlag,
deprecatedEnableNoiseHandshake,
deprecatedEnableInitSyncQueue,
deprecatedEnableFinalizedBlockRootIndexFlag,
Expand Down Expand Up @@ -324,7 +326,6 @@ var E2EValidatorFlags = []string{

// BeaconChainFlags contains a list of all the feature flags that apply to the beacon-chain client.
var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
noCustomConfigFlag,
customGenesisDelayFlag,
minimalConfigFlag,
writeSSZStateTransitionsFlag,
Expand Down
23 changes: 0 additions & 23 deletions shared/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,24 +229,6 @@ func MainnetConfig() *BeaconChainConfig {
return defaultBeaconConfig
}

// DemoBeaconConfig retrieves the demo beacon chain config. This is mainnet config with 1/10th of
// mainnet deposit values.
func DemoBeaconConfig() *BeaconChainConfig {
demoConfig := *MainnetConfig()

demoConfig.MinDepositAmount /= 10
demoConfig.MaxEffectiveBalance /= 10
demoConfig.EjectionBalance /= 10
demoConfig.EffectiveBalanceIncrement /= 10

demoConfig.InactivityPenaltyQuotient /= 10

// Increment this number after a full testnet tear down.
demoConfig.GenesisForkVersion = []byte{0, 0, 0, 4}

return &demoConfig
}

// MinimalSpecConfig retrieves the minimal config used in spec tests.
func MinimalSpecConfig() *BeaconChainConfig {
minimalConfig := *defaultBeaconConfig
Expand Down Expand Up @@ -319,11 +301,6 @@ func MinimalSpecConfig() *BeaconChainConfig {
return &minimalConfig
}

// UseDemoBeaconConfig for beacon chain services.
func UseDemoBeaconConfig() {
beaconConfig = DemoBeaconConfig()
}

// UseMinimalConfig for beacon chain services.
func UseMinimalConfig() {
beaconConfig = MinimalSpecConfig()
Expand Down
1 change: 0 additions & 1 deletion tools/blocktree/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ go_library(
"//beacon-chain/db/filters:go_default_library",
"//shared/attestationutil:go_default_library",
"//shared/bytesutil:go_default_library",
"//shared/params:go_default_library",
"@com_github_emicklei_dot//:go_default_library",
"@com_github_prysmaticlabs_go_ssz//:go_default_library",
],
Expand Down
3 changes: 0 additions & 3 deletions tools/blocktree/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/prysmaticlabs/prysm/beacon-chain/db/filters"
"github.com/prysmaticlabs/prysm/shared/attestationutil"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
"github.com/prysmaticlabs/prysm/shared/params"
)

var (
Expand All @@ -41,8 +40,6 @@ type node struct {
}

func main() {
params.UseDemoBeaconConfig()

flag.Parse()
db, err := db.NewDB(*datadir, cache.NewStateSummaryCache())
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion tools/cluster-pk-manager/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ go_library(
"//shared/bls:go_default_library",
"//shared/bytesutil:go_default_library",
"//shared/keystore:go_default_library",
"//shared/params:go_default_library",
"//shared/prometheus:go_default_library",
"@com_github_ethereum_go_ethereum//:go_default_library",
"@com_github_ethereum_go_ethereum//accounts/abi/bind:go_default_library",
Expand Down
6 changes: 2 additions & 4 deletions tools/cluster-pk-manager/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"net"

pb "github.com/prysmaticlabs/prysm/proto/cluster"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/prysmaticlabs/prysm/shared/prometheus"
"github.com/sirupsen/logrus"
_ "go.uber.org/automaxprocs"
"google.golang.org/grpc"

"github.com/prysmaticlabs/prysm/shared/prometheus"
)

var (
Expand All @@ -33,8 +33,6 @@ func main() {
if *verbose {
logrus.SetLevel(logrus.DebugLevel)
}
// use demo-config for cluster deployments
params.UseDemoBeaconConfig()
if *ensureDeposited {
log.Warn("--ensure-deposited: Ensuring all keys are deposited or deleting them from database!")
}
Expand Down
2 changes: 0 additions & 2 deletions tools/forkchecker/forkchecker.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ func (e *endpoint) Set(value string) error {
}

func main() {
params.UseDemoBeaconConfig()

var endpts endpoint
clients := make(map[string]pb.BeaconChainClient)

Expand Down
2 changes: 1 addition & 1 deletion tools/sendDepositTx/sendDeposits.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func main() {
},
&cli.Int64Flag{
Name: "depositAmount",
Value: 3200,
Value: int64(params.BeaconConfig().MaxEffectiveBalance),
Usage: "Maximum deposit value allowed in contract(in gwei)",
Destination: &depositAmount,
},
Expand Down
5 changes: 0 additions & 5 deletions validator/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import (
)

var (
// NoCustomConfigFlag determines whether to launch a beacon chain using real parameters or demo parameters.
NoCustomConfigFlag = &cli.BoolFlag{
Name: "no-custom-config",
Usage: "Run the beacon chain with the real parameters from phase 0.",
}
// BeaconRPCProviderFlag defines a beacon node RPC endpoint.
BeaconRPCProviderFlag = &cli.StringFlag{
Name: "beacon-rpc-provider",
Expand Down
1 change: 0 additions & 1 deletion validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func startNode(ctx *cli.Context) error {
}

var appFlags = []cli.Flag{
flags.NoCustomConfigFlag,
flags.BeaconRPCProviderFlag,
flags.CertFlag,
flags.GraffitiFlag,
Expand Down
1 change: 0 additions & 1 deletion validator/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ var appHelpFlagGroups = []flagGroup{
{
Name: "validator",
Flags: []cli.Flag{
flags.NoCustomConfigFlag,
flags.BeaconRPCProviderFlag,
flags.CertFlag,
flags.KeyManager,
Expand Down

0 comments on commit 4256321

Please sign in to comment.