github.com/prysmaticlabs/prysm@v1.4.4/shared/featureconfig/flags.go (about)

     1  package featureconfig
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/urfave/cli/v2"
     7  )
     8  
     9  var (
    10  	// ToledoTestnet flag for the multiclient Ethereum consensus testnet.
    11  	ToledoTestnet = &cli.BoolFlag{
    12  		Name:  "toledo",
    13  		Usage: "This defines the flag through which we can run on the Toledo Multiclient Testnet",
    14  	}
    15  	// PyrmontTestnet flag for the multiclient Ethereum consensus testnet.
    16  	PyrmontTestnet = &cli.BoolFlag{
    17  		Name:  "pyrmont",
    18  		Usage: "This defines the flag through which we can run on the Pyrmont Multiclient Testnet",
    19  	}
    20  	// PraterTestnet flag for the multiclient Ethereum consensus testnet.
    21  	PraterTestnet = &cli.BoolFlag{
    22  		Name:  "prater",
    23  		Usage: "Run Prysm configured for the Prater test network",
    24  	}
    25  	// Mainnet flag for easier tooling, no-op
    26  	Mainnet = &cli.BoolFlag{
    27  		Value: true,
    28  		Name:  "mainnet",
    29  		Usage: "Run on Ethereum Beacon Chain Main Net. This is the default and can be omitted.",
    30  	}
    31  	devModeFlag = &cli.BoolFlag{
    32  		Name:  "dev",
    33  		Usage: "Enable experimental features still in development. These features may not be stable.",
    34  	}
    35  	writeSSZStateTransitionsFlag = &cli.BoolFlag{
    36  		Name:  "interop-write-ssz-state-transitions",
    37  		Usage: "Write ssz states to disk after attempted state transition",
    38  	}
    39  	kafkaBootstrapServersFlag = &cli.StringFlag{
    40  		Name:  "kafka-url",
    41  		Usage: "Stream attestations and blocks to specified kafka servers. This field is used for bootstrap.servers kafka config field.",
    42  	}
    43  	enableExternalSlasherProtectionFlag = &cli.BoolFlag{
    44  		Name: "enable-external-slasher-protection",
    45  		Usage: "Enables the validator to connect to external slasher to prevent it from " +
    46  			"transmitting a slashable offence over the network.",
    47  	}
    48  	disableLookbackFlag = &cli.BoolFlag{
    49  		Name:  "disable-lookback",
    50  		Usage: "Disables use of the lookback feature and updates attestation history for validators from head to epoch 0",
    51  	}
    52  	disableGRPCConnectionLogging = &cli.BoolFlag{
    53  		Name:  "disable-grpc-connection-logging",
    54  		Usage: "Disables displaying logs for newly connected grpc clients",
    55  	}
    56  	attestationAggregationStrategy = &cli.StringFlag{
    57  		Name:  "attestation-aggregation-strategy",
    58  		Usage: "Which strategy to use when aggregating attestations, one of: naive, max_cover, opt_max_cover.",
    59  		Value: "max_cover",
    60  	}
    61  	forceOptMaxCoverAggregationStategy = &cli.BoolFlag{
    62  		Name:  "attestation-aggregation-force-opt-maxcover",
    63  		Usage: "When enabled, forces --attestation-aggregation-strategy=opt_max_cover setting.",
    64  	}
    65  	disableAccountsV2 = &cli.BoolFlag{
    66  		Name:  "disable-accounts-v2",
    67  		Usage: "Disables usage of v2 for Prysm validator accounts",
    68  	}
    69  	enablePeerScorer = &cli.BoolFlag{
    70  		Name:  "enable-peer-scorer",
    71  		Usage: "Enable experimental P2P peer scorer",
    72  	}
    73  	checkPtInfoCache = &cli.BoolFlag{
    74  		Name:  "use-check-point-cache",
    75  		Usage: "Enables check point info caching",
    76  	}
    77  	enableLargerGossipHistory = &cli.BoolFlag{
    78  		Name:  "enable-larger-gossip-history",
    79  		Usage: "Enables the node to store a larger amount of gossip messages in its cache.",
    80  	}
    81  	writeWalletPasswordOnWebOnboarding = &cli.BoolFlag{
    82  		Name: "write-wallet-password-on-web-onboarding",
    83  		Usage: "(Danger): Writes the wallet password to the wallet directory on completing Prysm web onboarding. " +
    84  			"We recommend against this flag unless you are an advanced user.",
    85  	}
    86  	disableAttestingHistoryDBCache = &cli.BoolFlag{
    87  		Name: "disable-attesting-history-db-cache",
    88  		Usage: "(Danger): Disables the cache for attesting history in the validator DB, greatly increasing " +
    89  			"disk reads and writes as well as increasing time required for attestations to be produced",
    90  	}
    91  	dynamicKeyReloadDebounceInterval = &cli.DurationFlag{
    92  		Name: "dynamic-key-reload-debounce-interval",
    93  		Usage: "(Advanced): Specifies the time duration the validator waits to reload new keys if they have " +
    94  			"changed on disk. Default 1s, can be any type of duration such as 1.5s, 1000ms, 1m.",
    95  		Value: time.Second,
    96  	}
    97  	disableBroadcastSlashingFlag = &cli.BoolFlag{
    98  		Name:  "disable-broadcast-slashings",
    99  		Usage: "Disables broadcasting slashings submitted to the beacon node.",
   100  	}
   101  	attestTimely = &cli.BoolFlag{
   102  		Name:  "attest-timely",
   103  		Usage: "Fixes validator can attest timely after current block processes. See #8185 for more details",
   104  	}
   105  	enableNextSlotStateCache = &cli.BoolFlag{
   106  		Name:  "enable-next-slot-state-cache",
   107  		Usage: "Improves attesting and proposing efficiency by caching the next slot state at the end of the current slot",
   108  	}
   109  	disableUpdateHeadTimely = &cli.BoolFlag{
   110  		Name:  "disable-update-head-timely",
   111  		Usage: "Disables updating head right after state transition",
   112  	}
   113  	disableProposerAttsSelectionUsingMaxCover = &cli.BoolFlag{
   114  		Name:  "disable-proposer-atts-selection-using-max-cover",
   115  		Usage: "Disable max-cover algorithm when selecting attestations for proposer",
   116  	}
   117  	enableSlashingProtectionPruning = &cli.BoolFlag{
   118  		Name:  "enable-slashing-protection-pruning",
   119  		Usage: "Enables the pruning of the validator client's slashing protectin database",
   120  	}
   121  	disableOptimizedBalanceUpdate = &cli.BoolFlag{
   122  		Name:  "disable-optimized-balance-update",
   123  		Usage: "Disable the optimized method of updating validator balances.",
   124  	}
   125  	enableDoppelGangerProtection = &cli.BoolFlag{
   126  		Name: "enable-doppelganger",
   127  		Usage: "Enables the validator to perform a doppelganger check. (Warning): This is not " +
   128  			"a foolproof method to find duplicate instances in the network. Your validator will still be" +
   129  			" vulnerable if it is being run in unsafe configurations.",
   130  	}
   131  	correctlyInsertOrphanedAtts = &cli.BoolFlag{
   132  		Name: "correctly-insert-orphaned-atts",
   133  		Usage: "This fixes a bug where orphaned attestations don't get reinserted back to mem pool. This improves validator profitability and overall network health," +
   134  			"see issue #9441 for further detail",
   135  	}
   136  	correctlyPruneCanonicalAtts = &cli.BoolFlag{
   137  		Name: "correctly-prune-canonical-atts",
   138  		Usage: "This fixes a bug where any block attestations can get incorrectly pruned. This improves validator profitability and overall network health," +
   139  			"see issue #9443 for further detail",
   140  	}
   141  )
   142  
   143  // devModeFlags holds list of flags that are set when development mode is on.
   144  var devModeFlags = []cli.Flag{
   145  	enableLargerGossipHistory,
   146  	enableNextSlotStateCache,
   147  	forceOptMaxCoverAggregationStategy,
   148  	correctlyInsertOrphanedAtts,
   149  	correctlyPruneCanonicalAtts,
   150  }
   151  
   152  // ValidatorFlags contains a list of all the feature flags that apply to the validator client.
   153  var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
   154  	writeWalletPasswordOnWebOnboarding,
   155  	enableExternalSlasherProtectionFlag,
   156  	disableAttestingHistoryDBCache,
   157  	ToledoTestnet,
   158  	PyrmontTestnet,
   159  	PraterTestnet,
   160  	Mainnet,
   161  	disableAccountsV2,
   162  	dynamicKeyReloadDebounceInterval,
   163  	attestTimely,
   164  	enableSlashingProtectionPruning,
   165  	enableDoppelGangerProtection,
   166  }...)
   167  
   168  // SlasherFlags contains a list of all the feature flags that apply to the slasher client.
   169  var SlasherFlags = append(deprecatedFlags, []cli.Flag{
   170  	disableLookbackFlag,
   171  	ToledoTestnet,
   172  	PyrmontTestnet,
   173  	PraterTestnet,
   174  	Mainnet,
   175  }...)
   176  
   177  // E2EValidatorFlags contains a list of the validator feature flags to be tested in E2E.
   178  var E2EValidatorFlags = []string{
   179  	"--enable-doppelganger",
   180  }
   181  
   182  // BeaconChainFlags contains a list of all the feature flags that apply to the beacon-chain client.
   183  var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
   184  	devModeFlag,
   185  	writeSSZStateTransitionsFlag,
   186  	kafkaBootstrapServersFlag,
   187  	disableGRPCConnectionLogging,
   188  	attestationAggregationStrategy,
   189  	ToledoTestnet,
   190  	PyrmontTestnet,
   191  	PraterTestnet,
   192  	Mainnet,
   193  	enablePeerScorer,
   194  	enableLargerGossipHistory,
   195  	checkPtInfoCache,
   196  	disableBroadcastSlashingFlag,
   197  	enableNextSlotStateCache,
   198  	forceOptMaxCoverAggregationStategy,
   199  	disableUpdateHeadTimely,
   200  	disableProposerAttsSelectionUsingMaxCover,
   201  	disableOptimizedBalanceUpdate,
   202  	correctlyInsertOrphanedAtts,
   203  	correctlyPruneCanonicalAtts,
   204  }...)
   205  
   206  // E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E.
   207  var E2EBeaconChainFlags = []string{
   208  	"--attestation-aggregation-strategy=opt_max_cover",
   209  	"--dev",
   210  	"--use-check-point-cache",
   211  	"--correctly-insert-orphaned-atts",
   212  	"--correctly-prune-canonical-atts",
   213  }