From 5634b18d885e763d8f4be63203d9634f2a110231 Mon Sep 17 00:00:00 2001 From: rauljordan Date: Thu, 9 Apr 2020 16:00:22 -0500 Subject: [PATCH 1/6] bye bye demo config --- .../blockchain/process_attestation_test.go | 1 - endtoend/README.md | 2 +- shared/featureconfig/config.go | 66 +++++++------------ shared/featureconfig/flags.go | 11 ++-- shared/params/config.go | 23 ------- tools/blocktree/main.go | 2 - tools/cluster-pk-manager/server/main.go | 6 +- tools/forkchecker/forkchecker.go | 2 - validator/flags/flags.go | 5 -- validator/main.go | 1 - 10 files changed, 34 insertions(+), 85 deletions(-) diff --git a/beacon-chain/blockchain/process_attestation_test.go b/beacon-chain/blockchain/process_attestation_test.go index 443581dad8b..e78b0a63cc8 100644 --- a/beacon-chain/blockchain/process_attestation_test.go +++ b/beacon-chain/blockchain/process_attestation_test.go @@ -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, diff --git a/endtoend/README.md b/endtoend/README.md index b20b4a985cd..75a9f77810e 100644 --- a/endtoend/README.md +++ b/endtoend/README.md @@ -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: diff --git a/shared/featureconfig/config.go b/shared/featureconfig/config.go index f7a1470f534..466700ecaeb 100644 --- a/shared/featureconfig/config.go +++ b/shared/featureconfig/config.go @@ -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. @@ -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 } diff --git a/shared/featureconfig/flags.go b/shared/featureconfig/flags.go index c0a13225c72..d12cd2ebf7e 100644 --- a/shared/featureconfig/flags.go +++ b/shared/featureconfig/flags.go @@ -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.", @@ -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, @@ -280,6 +281,7 @@ var ( ) var deprecatedFlags = []cli.Flag{ + deprecatedNoCustomConfigFlag, deprecatedEnableNoiseHandshake, deprecatedEnableInitSyncQueue, deprecatedEnableFinalizedBlockRootIndexFlag, @@ -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, diff --git a/shared/params/config.go b/shared/params/config.go index cde379749a6..e507666ce06 100644 --- a/shared/params/config.go +++ b/shared/params/config.go @@ -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 @@ -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() diff --git a/tools/blocktree/main.go b/tools/blocktree/main.go index c55221e49ef..50bc7dbb6c1 100644 --- a/tools/blocktree/main.go +++ b/tools/blocktree/main.go @@ -41,8 +41,6 @@ type node struct { } func main() { - params.UseDemoBeaconConfig() - flag.Parse() db, err := db.NewDB(*datadir, cache.NewStateSummaryCache()) if err != nil { diff --git a/tools/cluster-pk-manager/server/main.go b/tools/cluster-pk-manager/server/main.go index 597374100ef..ad716d96848 100644 --- a/tools/cluster-pk-manager/server/main.go +++ b/tools/cluster-pk-manager/server/main.go @@ -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 ( @@ -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!") } diff --git a/tools/forkchecker/forkchecker.go b/tools/forkchecker/forkchecker.go index f6773363654..b8ea409a238 100644 --- a/tools/forkchecker/forkchecker.go +++ b/tools/forkchecker/forkchecker.go @@ -37,8 +37,6 @@ func (e *endpoint) Set(value string) error { } func main() { - params.UseDemoBeaconConfig() - var endpts endpoint clients := make(map[string]pb.BeaconChainClient) diff --git a/validator/flags/flags.go b/validator/flags/flags.go index c0716ccde2a..b8cc39dc2e1 100644 --- a/validator/flags/flags.go +++ b/validator/flags/flags.go @@ -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", diff --git a/validator/main.go b/validator/main.go index 99fe64f87b5..fef024dfb9b 100644 --- a/validator/main.go +++ b/validator/main.go @@ -33,7 +33,6 @@ func startNode(ctx *cli.Context) error { } var appFlags = []cli.Flag{ - flags.NoCustomConfigFlag, flags.BeaconRPCProviderFlag, flags.CertFlag, flags.GraffitiFlag, From b37492445904d5c0f0b50cb5d7a4c69be87a67d6 Mon Sep 17 00:00:00 2001 From: rauljordan Date: Thu, 9 Apr 2020 16:18:13 -0500 Subject: [PATCH 2/6] gaz --- tools/cluster-pk-manager/server/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/cluster-pk-manager/server/BUILD.bazel b/tools/cluster-pk-manager/server/BUILD.bazel index 540c96063cd..ea4c8841eb8 100644 --- a/tools/cluster-pk-manager/server/BUILD.bazel +++ b/tools/cluster-pk-manager/server/BUILD.bazel @@ -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", From 3fdbb06d1f80577983ee24649d551b8755ea66d1 Mon Sep 17 00:00:00 2001 From: rauljordan Date: Thu, 9 Apr 2020 16:29:42 -0500 Subject: [PATCH 3/6] fix usage --- validator/usage.go | 1 - 1 file changed, 1 deletion(-) diff --git a/validator/usage.go b/validator/usage.go index 54dd02ca558..11f7b9678bb 100644 --- a/validator/usage.go +++ b/validator/usage.go @@ -72,7 +72,6 @@ var appHelpFlagGroups = []flagGroup{ { Name: "validator", Flags: []cli.Flag{ - flags.NoCustomConfigFlag, flags.BeaconRPCProviderFlag, flags.CertFlag, flags.KeyManager, From 3c097c0485fbc77e442e01a733e6fc40676caab4 Mon Sep 17 00:00:00 2001 From: rauljordan Date: Thu, 9 Apr 2020 16:38:37 -0500 Subject: [PATCH 4/6] fix dep --- tools/blocktree/main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/blocktree/main.go b/tools/blocktree/main.go index 50bc7dbb6c1..f5a73a4ff52 100644 --- a/tools/blocktree/main.go +++ b/tools/blocktree/main.go @@ -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 ( From 5ba8d6c570d9814d50313031e3e99403c8d66cb2 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Thu, 9 Apr 2020 17:24:12 -0500 Subject: [PATCH 5/6] gaz --- tools/blocktree/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/blocktree/BUILD.bazel b/tools/blocktree/BUILD.bazel index 3d385bd4671..fb7ad2e7c7f 100644 --- a/tools/blocktree/BUILD.bazel +++ b/tools/blocktree/BUILD.bazel @@ -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", ], From a7d0088ffb4c406e68a70c20a1dbc8170d0fa20f Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Thu, 9 Apr 2020 16:34:54 -0700 Subject: [PATCH 6/6] Update default balance for sendDeposits --- tools/sendDepositTx/sendDeposits.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/sendDepositTx/sendDeposits.go b/tools/sendDepositTx/sendDeposits.go index 80695671679..64fc9d894ec 100644 --- a/tools/sendDepositTx/sendDeposits.go +++ b/tools/sendDepositTx/sendDeposits.go @@ -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, },