Skip to content

Commit

Permalink
Make SlotsPerArchivedPoint configurable (#5888)
Browse files Browse the repository at this point in the history
* Make slots per archived point configurable

* 256 -> 2048

* Use beaconconfig
  • Loading branch information
terencechain committed May 17, 2020
1 parent 5900160 commit 343bee3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/flags/base.go
Expand Up @@ -111,7 +111,7 @@ var (
SlotsPerArchivedPoint = &cli.IntFlag{
Name: "slots-per-archive-point",
Usage: "The slot durations of when an archived state gets saved in the DB.",
Value: 128,
Value: 2048,
}
// DisableDiscv5 disables running discv5.
DisableDiscv5 = &cli.BoolFlag{
Expand Down
6 changes: 6 additions & 0 deletions beacon-chain/node/node.go
Expand Up @@ -97,6 +97,12 @@ func NewBeaconNode(cliCtx *cli.Context) (*BeaconNode, error) {
params.LoadChainConfigFile(chainConfigFileName)
}

if cliCtx.IsSet(flags.SlotsPerArchivedPoint.Name) {
c := params.BeaconConfig()
c.SlotsPerArchivedPoint = uint64(cliCtx.Int(flags.SlotsPerArchivedPoint.Name))
params.OverrideBeaconConfig(c)
}

featureconfig.ConfigureBeaconChain(cliCtx)
flags.ConfigureGlobalFlags(cliCtx)
registry := shared.NewServiceRegistry()
Expand Down
1 change: 1 addition & 0 deletions beacon-chain/usage.go
Expand Up @@ -98,6 +98,7 @@ var appHelpFlagGroups = []flagGroup{
flags.BlockBatchLimit,
flags.BlockBatchLimitBurstFactor,
flags.EnableDebugRPCEndpoints,
flags.SlotsPerArchivedPoint,
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion shared/params/config.go
Expand Up @@ -203,7 +203,7 @@ var defaultBeaconConfig = &BeaconChainConfig{
EmptySignature: [96]byte{},
DefaultPageSize: 250,
MaxPeersToSync: 15,
SlotsPerArchivedPoint: 256,
SlotsPerArchivedPoint: 2048,

// Slasher related values.
WeakSubjectivityPeriod: 54000,
Expand Down

0 comments on commit 343bee3

Please sign in to comment.