Skip to content

Commit

Permalink
Invert reduce attester state copies (#6185)
Browse files Browse the repository at this point in the history
* Invert cfg.ReduceAttesterStateCopy flag

* Fix build
  • Loading branch information
terencechain committed Jun 9, 2020
1 parent c956905 commit 568d8c7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
10 changes: 5 additions & 5 deletions shared/featureconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ func ConfigureBeaconChain(ctx *cli.Context) {
log.Warn("Disabling state reference copy")
cfg.EnableStateRefCopy = false
}
if ctx.Bool(reduceAttesterStateCopy.Name) {
log.Warn("Enabling feature that reduces attester state copy")
cfg.ReduceAttesterStateCopy = true
}
if ctx.IsSet(deprecatedP2PWhitelist.Name) {
log.Warnf("--%s is deprecated, please use --%s", deprecatedP2PWhitelist.Name, cmd.P2PAllowList.Name)
if err := ctx.Set(cmd.P2PAllowList.Name, ctx.String(deprecatedP2PWhitelist.Name)); err != nil {
Expand All @@ -233,7 +229,11 @@ func ConfigureBeaconChain(ctx *cli.Context) {
log.WithError(err).Error("Failed to update P2PDenyList flag")
}
}

cfg.ReduceAttesterStateCopy = true
if ctx.Bool(disableReduceAttesterStateCopy.Name) {
log.Warn("Disabling reducing attester state copy")
cfg.ReduceAttesterStateCopy = false
}
Init(cfg)
}

Expand Down
16 changes: 10 additions & 6 deletions shared/featureconfig/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,16 @@ var (
Name: "enable-init-sync-wrr",
Usage: "Enables weighted round robin fetching optimization",
}
reduceAttesterStateCopy = &cli.BoolFlag{
Name: "reduce-attester-state-copy",
Usage: "Reduces the amount of state copies for attester rpc",
disableReduceAttesterStateCopy = &cli.BoolFlag{
Name: "disable-reduce-attester-state-copy",
Usage: "Disables the feature to reduce the amount of state copies for attester rpc",
}
)

// devModeFlags holds list of flags that are set when development mode is on.
var devModeFlags = []cli.Flag{
enableNewStateMgmt,
enableInitSyncWeightedRoundRobin,
reduceAttesterStateCopy,
}

// Deprecated flags list.
Expand Down Expand Up @@ -400,6 +399,11 @@ var (
Usage: deprecatedUsage,
Hidden: true,
}
deprecateReduceAttesterStateCopies = &cli.BoolFlag{
Name: "reduce-attester-state-copy",
Usage: deprecatedUsage,
Hidden: true,
}
)

var deprecatedFlags = []cli.Flag{
Expand Down Expand Up @@ -448,6 +452,7 @@ var deprecatedFlags = []cli.Flag{
deprecateEnableFieldTrie,
deprecatedP2PWhitelist,
deprecatedP2PBlacklist,
deprecateReduceAttesterStateCopies,
}

// ValidatorFlags contains a list of all the feature flags that apply to the validator client.
Expand Down Expand Up @@ -505,7 +510,7 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
enableInitSyncWeightedRoundRobin,
disableFieldTrie,
disableStateRefCopy,
reduceAttesterStateCopy,
disableReduceAttesterStateCopy,
}...)

// E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E.
Expand All @@ -515,5 +520,4 @@ var E2EBeaconChainFlags = []string{
"--check-head-state",
"--enable-new-state-mgmt",
"--enable-init-sync-wrr",
"--reduce-attester-state-copy",
}

0 comments on commit 568d8c7

Please sign in to comment.