Skip to content

Commit

Permalink
Invert state field trie (#6013)
Browse files Browse the repository at this point in the history
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
terencechain and prylabs-bulldozer[bot] committed May 28, 2020
1 parent 9e8eafd commit e3180cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
7 changes: 4 additions & 3 deletions shared/featureconfig/config.go
Expand Up @@ -189,9 +189,10 @@ func ConfigureBeaconChain(ctx *cli.Context) {
log.Warn("Enabling state management service")
cfg.NewStateMgmt = true
}
if ctx.Bool(enableFieldTrie.Name) {
log.Warn("Enabling state field trie")
cfg.EnableFieldTrie = true
cfg.EnableFieldTrie = true
if ctx.Bool(disableFieldTrie.Name) {
log.Warn("Disabling state field trie")
cfg.EnableFieldTrie = false
}
if ctx.Bool(disableInitSyncBatchSaveBlocks.Name) {
log.Warn("Disabling init sync batch save blocks mode")
Expand Down
16 changes: 10 additions & 6 deletions shared/featureconfig/flags.go
Expand Up @@ -124,10 +124,11 @@ var (
Name: "enable-new-state-mgmt",
Usage: "This enable the usage of state mgmt service across Prysm",
}
enableFieldTrie = &cli.BoolFlag{
Name: "enable-state-field-trie",
Usage: "Enables the usage of state field tries to compute the state root",
disableFieldTrie = &cli.BoolFlag{
Name: "disable-state-field-trie",
Usage: "Disables the usage of state field tries to compute the state root",
}

disableInitSyncBatchSaveBlocks = &cli.BoolFlag{
Name: "disable-init-sync-batch-save-blocks",
Usage: "Instead of saving batch blocks to the DB during initial syncing, this disables batch saving of blocks",
Expand Down Expand Up @@ -160,7 +161,6 @@ var (

// devModeFlags holds list of flags that are set when development mode is on.
var devModeFlags = []cli.Flag{
enableFieldTrie,
enableNewStateMgmt,
enableInitSyncWeightedRoundRobin,
}
Expand Down Expand Up @@ -375,6 +375,10 @@ var (
Usage: deprecatedUsage,
Hidden: true,
}
deprecateEnableFieldTrie = &cli.BoolFlag{
Name: "enable-state-field-trie",
Usage: deprecatedUsage,
Hidden: true}
)

var deprecatedFlags = []cli.Flag{
Expand Down Expand Up @@ -419,6 +423,7 @@ var deprecatedFlags = []cli.Flag{
deprecatedBroadcastSlashingFlag,
deprecatedDisableHistoricalDetectionFlag,
deprecateEnableStateRefCopy,
deprecateEnableFieldTrie,
}

// ValidatorFlags contains a list of all the feature flags that apply to the validator client.
Expand Down Expand Up @@ -470,11 +475,11 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
dontPruneStateStartUp,
disableBroadcastSlashingFlag,
enableNewStateMgmt,
enableFieldTrie,
disableInitSyncBatchSaveBlocks,
waitForSyncedFlag,
skipRegenHistoricalStates,
enableInitSyncWeightedRoundRobin,
disableFieldTrie,
disableStateRefCopy,
}...)

Expand All @@ -483,7 +488,6 @@ var E2EBeaconChainFlags = []string{
"--cache-filtered-block-tree",
"--enable-state-gen-sig-verify",
"--check-head-state",
"--enable-state-field-trie",
"--enable-new-state-mgmt",
"--enable-init-sync-wrr",
}

0 comments on commit e3180cf

Please sign in to comment.