featureconfig

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

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.Flag{ VerifyAttestationSigs: true, } featureconfig.Init(cfg)

Index

Constants

This section is empty.

Variables

View Source
var (
	// GenesisDelayFlag disables the standard genesis delay.
	GenesisDelayFlag = cli.BoolFlag{
		Name:  "genesis-delay",
		Usage: "Wait and process the genesis event at the midnight of the next day rather than 30s after the ETH1 block time of the chainstart triggering deposit",
	}
	// 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",
	}

	// InitSyncNoVerifyFlag enables the initial sync no verify configuration.
	InitSyncNoVerifyFlag = cli.BoolFlag{
		Name:  "init-sync-no-verify",
		Usage: "Initial sync to finalized check point w/o verifying block's signature, RANDAO and attestation's aggregated signatures",
	}
	// 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",
	}

	// OptimizeProcessEpoch optimizes process epoch.
	OptimizeProcessEpoch = cli.BoolFlag{
		Name:  "optimize-process-epoch",
		Usage: "Process epoch with optimizations",
	}
	// Scatter scatters sequential processes to  multiple cores
	Scatter = cli.BoolFlag{
		Name:  "scatter",
		Usage: "Scatter sequential processes to multiple cores",
	}
)
View Source
var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
	GenesisDelayFlag,
	MinimalConfigFlag,
	writeSSZStateTransitionsFlag,
	EnableAttestationCacheFlag,
	EnableEth1DataVoteCacheFlag,
	InitSyncNoVerifyFlag,
	NewCacheFlag,
	SkipBLSVerifyFlag,
	OptimizeProcessEpoch,
	Scatter,
	enableBackupWebhookFlag,
	enableBLSPubkeyCacheFlag,
	enableShuffledIndexCache,
	enableCommitteeCacheFlag,
	enableActiveIndicesCacheFlag,
	enableActiveCountCacheFlag,
	pruneFinalizedStatesFlag,
	enableSkipSlotsCache,
}...)

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 *Flag)

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

Types

type Flag

type Flag struct {
	GenesisDelay             bool // GenesisDelay when processing a chain start genesis event.
	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.
	OptimizeProcessEpoch     bool // OptimizeProcessEpoch to process epoch with optimizations by pre computing records.
	Scatter                  bool // Scatter sequential processing by scattering it to multiple cores.
	PruneFinalizedStates     bool // PruneFinalizedStates from the database.

	// 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.
	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.
	EnableActiveIndicesCache bool // EnableActiveIndicesCache.
	EnableActiveCountCache   bool // EnableActiveCountCache.
}

Flag is a struct to represent what features the client will perform on runtime.

func Get

func Get() *Flag

Get retrieves feature config.

Jump to

Keyboard shortcuts

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