featureconfig

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2020 License: GPL-3.0 Imports: 2 Imported by: 202

Documentation

Overview

Package featureconfig defines which features are enabled for runtime in order to selctively enable certain features to maintain a stable runtime.

The process for implementing new features using this package is as follows:

  1. Add a new CMD flag in flags.go, and place it in the proper list(s) var for its client.
  2. Add a condition for the flag in the proper Configure function(s) below.
  3. Place any "new" behavior in the `if flagEnabled` statement.
  4. Place any "previous" behavior in the `else` statement.
  5. Ensure any tests using the new feature fail if the flag isn't enabled. 5a. Use the following to enable your flag for tests: cfg := &featureconfig.Flags{ VerifyAttestationSigs: true, } featureconfig.Init(cfg)

Index

Constants

This section is empty.

Variables

View Source
var (
	// MinimalConfigFlag enables the minimal configuration.
	MinimalConfigFlag = cli.BoolFlag{
		Name:  "minimal-config",
		Usage: "Use minimal config with parameters as defined in the spec.",
	}

	// EnableAttestationCacheFlag see https://github.com/prysmaticlabs/prysm/issues/3106.
	EnableAttestationCacheFlag = cli.BoolFlag{
		Name:  "enable-attestation-cache",
		Usage: "Enable unsafe cache mechanism. See https://github.com/prysmaticlabs/prysm/issues/3106",
	}
	// EnableEth1DataVoteCacheFlag see https://github.com/prysmaticlabs/prysm/issues/3106.
	EnableEth1DataVoteCacheFlag = cli.BoolFlag{
		Name:  "enable-eth1-data-vote-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",
		Usage: "Use the new shuffled indices cache for committee. Much improvement than previous caching implementations",
	}
	// SkipBLSVerifyFlag skips BLS signature verification across the runtime for development purposes.
	SkipBLSVerifyFlag = cli.BoolFlag{
		Name:  "skip-bls-verify",
		Usage: "Whether or not to skip BLS verification of signature at runtime, this is unsafe and should only be used for development",
	}
)
View Source
var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
	noGenesisDelayFlag,
	MinimalConfigFlag,
	writeSSZStateTransitionsFlag,
	EnableAttestationCacheFlag,
	EnableEth1DataVoteCacheFlag,
	initSyncVerifyEverythingFlag,
	initSyncCacheState,
	NewCacheFlag,
	SkipBLSVerifyFlag,
	kafkaBootstrapServersFlag,
	enableBackupWebhookFlag,
	enableShuffledIndexCache,
	enableSkipSlotsCache,
	saveDepositData,
}...)

BeaconChainFlags contains a list of all the feature flags that apply to the beacon-chain client.

View Source
var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
	MinimalConfigFlag,
}...)

ValidatorFlags contains a list of all the feature flags that apply to the validator client.

Functions

func ConfigureBeaconChain

func ConfigureBeaconChain(ctx *cli.Context)

ConfigureBeaconChain sets the global config based on what flags are enabled for the beacon-chain client.

func ConfigureValidator

func ConfigureValidator(ctx *cli.Context)

ConfigureValidator sets the global config based on what flags are enabled for the validator client.

func Init

func Init(c *Flags)

Init sets the global config equal to the config that is passed in.

Types

type Flags added in v0.2.5

type Flags struct {
	NoGenesisDelay            bool   // NoGenesisDelay signals to start the chain as quickly as possible.
	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.
	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.
	InitSyncCacheState        bool   // InitSyncCacheState caches state during initial sync.
	KafkaBootstrapServers     string // KafkaBootstrapServers to find kafka servers to stream blocks, attestations, etc.
	EnableSavingOfDepositData bool   // EnableSavingOfDepositData allows the saving of eth1 related data such as deposits,chain data to be saved.

	// Cache toggles.
	EnableAttestationCache   bool // EnableAttestationCache; see https://github.com/prysmaticlabs/prysm/issues/3106.
	EnableEth1DataVoteCache  bool // EnableEth1DataVoteCache; see https://github.com/prysmaticlabs/prysm/issues/3106.
	EnableNewCache           bool // EnableNewCache enables the node to use the new caching scheme.
	EnableShuffledIndexCache bool // EnableShuffledIndexCache to cache expensive shuffled index computation.
	EnableSkipSlotsCache     bool // EnableSkipSlotsCache caches the state in skipped slots.
}

Flags is a struct to represent which features the client will perform on runtime.

func Get

func Get() *Flags

Get retrieves feature config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL