featureconfig

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 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 (
	// NoGenesisDelayFlag disables the standard genesis delay.
	NoGenesisDelayFlag = cli.BoolFlag{
		Name:  "no-genesis-delay",
		Usage: "Process genesis event 30s after the ETH1 block time, rather than wait to midnight of the next day.",
	}
	// 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",
	}
)
View Source
var BeaconChainFlags = []cli.Flag{
	NoGenesisDelayFlag,
	MinimalConfigFlag,
	writeSSZStateTransitionsFlag,
	EnableAttestationCacheFlag,
	EnableEth1DataVoteCacheFlag,
	InitSyncNoVerifyFlag,
	NewCacheFlag,
	SkipBLSVerifyFlag,
	OptimizeProcessEpoch,
	enableBackupWebhookFlag,
	enableBLSPubkeyCacheFlag,
}

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

View Source
var ValidatorFlags = []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 {
	NoGenesisDelay           bool // NoGenesisDelay 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

	// 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.
}

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