From a5881f924fee8a58f32c0b2ed690fc7aeab1a784 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Fri, 13 Dec 2019 06:00:29 -0800 Subject: [PATCH] Deprecate active count and committee cache flags (#4276) * Deprecate active count and committee cache flags * Merge branch 'master' into deprecate-flags --- beacon-chain/cache/feature_flag_test.go | 2 -- beacon-chain/db/iface/interface.go | 2 +- beacon-chain/db/kafka/passthrough.go | 2 +- beacon-chain/rpc/validator/server.go | 10 +++++----- shared/featureconfig/config.go | 10 ---------- shared/featureconfig/flags.go | 22 ++++++++++++---------- 6 files changed, 19 insertions(+), 29 deletions(-) diff --git a/beacon-chain/cache/feature_flag_test.go b/beacon-chain/cache/feature_flag_test.go index 68ded5fef..1aab9ed55 100644 --- a/beacon-chain/cache/feature_flag_test.go +++ b/beacon-chain/cache/feature_flag_test.go @@ -7,7 +7,5 @@ func init() { EnableAttestationCache: true, EnableEth1DataVoteCache: true, EnableShuffledIndexCache: true, - EnableCommitteeCache: true, - EnableActiveCountCache: true, }) } diff --git a/beacon-chain/db/iface/interface.go b/beacon-chain/db/iface/interface.go index e90da7bfd..741109a57 100644 --- a/beacon-chain/db/iface/interface.go +++ b/beacon-chain/db/iface/interface.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/common" eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - "github.com/prysmaticlabs/prysm/beacon-chain/db/filters" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" + "github.com/prysmaticlabs/prysm/beacon-chain/db/filters" ethereum_beacon_p2p_v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" ) diff --git a/beacon-chain/db/kafka/passthrough.go b/beacon-chain/db/kafka/passthrough.go index 0ab5e8a56..9a3c9b890 100644 --- a/beacon-chain/db/kafka/passthrough.go +++ b/beacon-chain/db/kafka/passthrough.go @@ -5,8 +5,8 @@ import ( "github.com/ethereum/go-ethereum/common" eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - "github.com/prysmaticlabs/prysm/beacon-chain/db/filters" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" + "github.com/prysmaticlabs/prysm/beacon-chain/db/filters" ethereum_beacon_p2p_v1 "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" ) diff --git a/beacon-chain/rpc/validator/server.go b/beacon-chain/rpc/validator/server.go index 3ac180847..d0593718a 100644 --- a/beacon-chain/rpc/validator/server.go +++ b/beacon-chain/rpc/validator/server.go @@ -6,11 +6,6 @@ import ( ptypes "github.com/gogo/protobuf/types" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" - pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" - "github.com/sirupsen/logrus" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/prysmaticlabs/prysm/beacon-chain/blockchain" "github.com/prysmaticlabs/prysm/beacon-chain/cache/depositcache" "github.com/prysmaticlabs/prysm/beacon-chain/core/feed" @@ -20,7 +15,12 @@ import ( "github.com/prysmaticlabs/prysm/beacon-chain/db" "github.com/prysmaticlabs/prysm/beacon-chain/powchain" "github.com/prysmaticlabs/prysm/beacon-chain/sync" + pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" + pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1" "github.com/prysmaticlabs/prysm/shared/bytesutil" + "github.com/sirupsen/logrus" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) var log logrus.FieldLogger diff --git a/shared/featureconfig/config.go b/shared/featureconfig/config.go index 75bd91f65..6313fab04 100644 --- a/shared/featureconfig/config.go +++ b/shared/featureconfig/config.go @@ -44,8 +44,6 @@ type Flags struct { EnableBLSPubkeyCache bool // EnableBLSPubkeyCache to improve wall time of PubkeyFromBytes. EnableShuffledIndexCache bool // EnableShuffledIndexCache to cache expensive shuffled index computation. EnableSkipSlotsCache bool // EnableSkipSlotsCache caches the state in skipped slots. - EnableCommitteeCache bool // EnableCommitteeCache to cache committee computation. - EnableActiveCountCache bool // EnableActiveCountCache. } var featureConfig *Flags @@ -126,14 +124,6 @@ func ConfigureBeaconChain(ctx *cli.Context) { log.Warn("Enabling experimental kafka streaming.") cfg.KafkaBootstrapServers = ctx.GlobalString(kafkaBootstrapServersFlag.Name) } - if ctx.GlobalBool(enableCommitteeCacheFlag.Name) { - log.Warn("Enabled committee cache.") - cfg.EnableCommitteeCache = true - } - if ctx.GlobalBool(enableActiveCountCacheFlag.Name) { - log.Warn("Enabled active count cache.") - cfg.EnableActiveCountCache = true - } if ctx.GlobalBool(enableSnappyDBCompressionFlag.Name) { log.Warn("Enabled snappy compression in the database.") cfg.EnableSnappyDBCompression = true diff --git a/shared/featureconfig/flags.go b/shared/featureconfig/flags.go index 4d8f4327e..f5926f12e 100644 --- a/shared/featureconfig/flags.go +++ b/shared/featureconfig/flags.go @@ -38,14 +38,6 @@ var ( Name: "enable-shuffled-index-cache", Usage: "Enable unsafe cache mechanism. See https://github.com/prysmaticlabs/prysm/issues/3106", } - enableCommitteeCacheFlag = cli.BoolFlag{ - Name: "enable-committee-cache", - Usage: "Enable unsafe cache mechanism. See https://github.com/prysmaticlabs/prysm/issues/3106", - } - enableActiveCountCacheFlag = cli.BoolFlag{ - Name: "enable-active-count-cache", - Usage: "Enable unsafe cache mechanism. See https://github.com/prysmaticlabs/prysm/issues/3106", - } // NewCacheFlag enables the node to use the new caching scheme. NewCacheFlag = cli.BoolFlag{ Name: "new-cache", @@ -134,6 +126,16 @@ var ( Usage: deprecatedUsage, Hidden: true, } + deprecatedEnableActiveCountCacheFlag = cli.BoolFlag{ + Name: "enable-active-count-cache", + Usage: deprecatedUsage, + Hidden: true, + } + deprecatedEnableCommitteeCacheFlag = cli.BoolFlag{ + Name: "enable-committee-cache", + Usage: deprecatedUsage, + Hidden: true, + } ) var deprecatedFlags = []cli.Flag{ @@ -144,6 +146,8 @@ var deprecatedFlags = []cli.Flag{ deprecatedOptimizeProcessEpoch, deprecatedInitSyncNoVerifyFlag, deprecatedEnableActiveIndicesCacheFlag, + deprecatedEnableActiveCountCacheFlag, + deprecatedEnableCommitteeCacheFlag, } // ValidatorFlags contains a list of all the feature flags that apply to the validator client. @@ -167,8 +171,6 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{ enableBackupWebhookFlag, enableBLSPubkeyCacheFlag, enableShuffledIndexCache, - enableCommitteeCacheFlag, - enableActiveCountCacheFlag, enableSkipSlotsCache, enableSnappyDBCompressionFlag, enablePruneBoundaryStateFlag,