2021-09-15 01:18:39 +00:00
package features
2019-03-21 02:57:25 +00:00
import (
2021-01-05 00:52:12 +00:00
"time"
2020-05-31 06:44:34 +00:00
"github.com/urfave/cli/v2"
2019-03-21 02:57:25 +00:00
)
var (
2021-06-26 19:00:33 +00:00
// PraterTestnet flag for the multiclient Ethereum consensus testnet.
2021-03-17 14:14:07 +00:00
PraterTestnet = & cli . BoolFlag {
Name : "prater" ,
Usage : "Run Prysm configured for the Prater test network" ,
}
2020-11-06 18:02:04 +00:00
// Mainnet flag for easier tooling, no-op
Mainnet = & cli . BoolFlag {
Value : true ,
Name : "mainnet" ,
2021-06-26 19:00:33 +00:00
Usage : "Run on Ethereum Beacon Chain Main Net. This is the default and can be omitted." ,
2020-11-06 18:02:04 +00:00
}
2020-04-20 17:27:24 +00:00
devModeFlag = & cli . BoolFlag {
Name : "dev" ,
Usage : "Enable experimental features still in development. These features may not be stable." ,
}
2020-03-19 21:46:44 +00:00
writeSSZStateTransitionsFlag = & cli . BoolFlag {
2019-09-24 15:19:37 +00:00
Name : "interop-write-ssz-state-transitions" ,
2019-09-23 23:36:12 +00:00
Usage : "Write ssz states to disk after attempted state transition" ,
}
2020-05-20 15:23:22 +00:00
enableExternalSlasherProtectionFlag = & cli . BoolFlag {
Name : "enable-external-slasher-protection" ,
2021-09-29 18:17:37 +00:00
Usage : "Enables the validator to connect to a beacon node using the --slasher flag" +
"for remote slashing protection" ,
2020-05-20 15:23:22 +00:00
}
2020-06-12 20:41:05 +00:00
disableGRPCConnectionLogging = & cli . BoolFlag {
Name : "disable-grpc-connection-logging" ,
Usage : "Disables displaying logs for newly connected grpc clients" ,
}
2020-08-13 17:33:57 +00:00
enablePeerScorer = & cli . BoolFlag {
Name : "enable-peer-scorer" ,
Usage : "Enable experimental P2P peer scorer" ,
}
2020-09-24 15:03:35 +00:00
checkPtInfoCache = & cli . BoolFlag {
Name : "use-check-point-cache" ,
Usage : "Enables check point info caching" ,
2020-08-24 22:11:45 +00:00
}
2020-11-20 15:36:02 +00:00
enableLargerGossipHistory = & cli . BoolFlag {
Name : "enable-larger-gossip-history" ,
Usage : "Enables the node to store a larger amount of gossip messages in its cache." ,
}
2020-11-23 22:11:42 +00:00
writeWalletPasswordOnWebOnboarding = & cli . BoolFlag {
Name : "write-wallet-password-on-web-onboarding" ,
Usage : "(Danger): Writes the wallet password to the wallet directory on completing Prysm web onboarding. " +
"We recommend against this flag unless you are an advanced user." ,
}
2020-12-11 18:31:35 +00:00
disableAttestingHistoryDBCache = & cli . BoolFlag {
Name : "disable-attesting-history-db-cache" ,
Usage : "(Danger): Disables the cache for attesting history in the validator DB, greatly increasing " +
"disk reads and writes as well as increasing time required for attestations to be produced" ,
}
2021-01-05 00:52:12 +00:00
dynamicKeyReloadDebounceInterval = & cli . DurationFlag {
Name : "dynamic-key-reload-debounce-interval" ,
Usage : "(Advanced): Specifies the time duration the validator waits to reload new keys if they have " +
"changed on disk. Default 1s, can be any type of duration such as 1.5s, 1000ms, 1m." ,
Value : time . Second ,
}
2021-01-04 19:36:17 +00:00
disableBroadcastSlashingFlag = & cli . BoolFlag {
Name : "disable-broadcast-slashings" ,
Usage : "Disables broadcasting slashings submitted to the beacon node." ,
}
2021-06-15 20:48:47 +00:00
attestTimely = & cli . BoolFlag {
Name : "attest-timely" ,
Usage : "Fixes validator can attest timely after current block processes. See #8185 for more details" ,
2021-01-09 01:54:46 +00:00
}
2021-09-29 18:17:37 +00:00
enableSlasherFlag = & cli . BoolFlag {
Name : "slasher" ,
Usage : "Enables a slasher in the beacon node for detecting slashable offenses" ,
}
2021-03-19 17:54:47 +00:00
enableSlashingProtectionPruning = & cli . BoolFlag {
2021-11-09 16:49:28 +00:00
Name : "enable-slashing-protection-history-pruning" ,
2021-08-26 18:48:25 +00:00
Usage : "Enables the pruning of the validator client's slashing protection database" ,
2021-03-19 17:54:47 +00:00
}
2021-07-02 04:11:09 +00:00
enableDoppelGangerProtection = & cli . BoolFlag {
Name : "enable-doppelganger" ,
Usage : "Enables the validator to perform a doppelganger check. (Warning): This is not " +
"a foolproof method to find duplicate instances in the network. Your validator will still be" +
" vulnerable if it is being run in unsafe configurations." ,
}
2021-07-27 20:02:53 +00:00
enableHistoricalSpaceRepresentation = & cli . BoolFlag {
Name : "enable-historical-state-representation" ,
Usage : "Enables the beacon chain to save historical states in a space efficient manner." +
" (Warning): Once enabled, this feature migrates your database in to a new schema and " +
"there is no going back. At worst, your entire database might get corrupted." ,
}
2021-09-13 20:10:45 +00:00
disableCorrectlyPruneCanonicalAtts = & cli . BoolFlag {
Name : "disable-correctly-prune-canonical-atts" ,
Usage : "Disable the fix for bug where any block attestations can get incorrectly pruned, which improves validator profitability and overall network health," +
2021-08-24 00:33:17 +00:00
"see issue #9443 for further detail" ,
}
2022-02-14 12:33:02 +00:00
enableNativeState = & cli . BoolFlag {
Name : "enable-native-state" ,
Usage : "Enables representing the beacon state as a pure Go struct." ,
}
2022-02-28 13:56:12 +00:00
enableVecHTR = & cli . BoolFlag {
Name : "enable-vectorized-htr" ,
Usage : "Enables new go sha256 library which utilizes optimized routines for merkle trees" ,
}
2022-03-09 03:05:51 +00:00
enableForkChoiceDoublyLinkedTree = & cli . BoolFlag {
Name : "enable-forkchoice-doubly-linked-tree" ,
Usage : "Enables new forkchoice store structure that uses doubly linked trees" ,
}
2022-05-04 04:47:53 +00:00
enableGossipBatchAggregation = & cli . BoolFlag {
Name : "enable-gossip-batch-aggregation" ,
Usage : "Enables new methods to further aggregate our gossip batches before verifying them." ,
}
2019-03-21 02:57:25 +00:00
)
2020-04-20 17:27:24 +00:00
// devModeFlags holds list of flags that are set when development mode is on.
2020-06-16 18:06:32 +00:00
var devModeFlags = [ ] cli . Flag {
2022-02-09 12:51:59 +00:00
enablePeerScorer ,
2022-03-09 03:05:51 +00:00
enableVecHTR ,
enableForkChoiceDoublyLinkedTree ,
2022-05-04 04:47:53 +00:00
enableGossipBatchAggregation ,
2020-06-16 18:06:32 +00:00
}
2020-04-20 17:27:24 +00:00
2019-03-21 02:57:25 +00:00
// ValidatorFlags contains a list of all the feature flags that apply to the validator client.
2019-10-29 15:30:14 +00:00
var ValidatorFlags = append ( deprecatedFlags , [ ] cli . Flag {
2020-11-23 22:11:42 +00:00
writeWalletPasswordOnWebOnboarding ,
2020-05-20 15:23:22 +00:00
enableExternalSlasherProtectionFlag ,
2020-12-11 18:31:35 +00:00
disableAttestingHistoryDBCache ,
2021-03-17 14:14:07 +00:00
PraterTestnet ,
2020-11-06 18:02:04 +00:00
Mainnet ,
2021-01-05 00:52:12 +00:00
dynamicKeyReloadDebounceInterval ,
2021-06-15 20:48:47 +00:00
attestTimely ,
2021-03-19 17:54:47 +00:00
enableSlashingProtectionPruning ,
2021-07-02 04:11:09 +00:00
enableDoppelGangerProtection ,
2019-10-29 15:30:14 +00:00
} ... )
2019-03-21 02:57:25 +00:00
2020-01-27 02:42:10 +00:00
// E2EValidatorFlags contains a list of the validator feature flags to be tested in E2E.
2021-07-02 04:11:09 +00:00
var E2EValidatorFlags = [ ] string {
"--enable-doppelganger" ,
}
2020-01-27 02:42:10 +00:00
2019-03-21 02:57:25 +00:00
// BeaconChainFlags contains a list of all the feature flags that apply to the beacon-chain client.
2019-10-29 15:30:14 +00:00
var BeaconChainFlags = append ( deprecatedFlags , [ ] cli . Flag {
2020-04-20 17:27:24 +00:00
devModeFlag ,
2019-09-23 23:36:12 +00:00
writeSSZStateTransitionsFlag ,
2020-06-12 20:41:05 +00:00
disableGRPCConnectionLogging ,
2021-03-17 14:14:07 +00:00
PraterTestnet ,
2020-11-06 18:02:04 +00:00
Mainnet ,
2020-08-13 17:33:57 +00:00
enablePeerScorer ,
2020-11-20 15:36:02 +00:00
enableLargerGossipHistory ,
2020-09-24 15:03:35 +00:00
checkPtInfoCache ,
2021-01-04 19:36:17 +00:00
disableBroadcastSlashingFlag ,
2021-09-29 18:17:37 +00:00
enableSlasherFlag ,
2021-07-27 20:02:53 +00:00
enableHistoricalSpaceRepresentation ,
2021-09-13 20:10:45 +00:00
disableCorrectlyPruneCanonicalAtts ,
2022-02-14 12:33:02 +00:00
enableNativeState ,
2022-02-28 13:56:12 +00:00
enableVecHTR ,
2022-03-09 03:05:51 +00:00
enableForkChoiceDoublyLinkedTree ,
2022-05-04 04:47:53 +00:00
enableGossipBatchAggregation ,
2019-10-29 15:30:14 +00:00
} ... )
2020-01-27 02:42:10 +00:00
// E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E.
var E2EBeaconChainFlags = [ ] string {
2020-06-16 18:06:32 +00:00
"--dev" ,
2020-08-24 22:11:45 +00:00
"--use-check-point-cache" ,
2021-08-26 14:32:40 +00:00
"--enable-active-balance-cache" ,
2022-05-09 13:02:34 +00:00
"--enable-native-state" ,
2020-01-27 02:42:10 +00:00
}