Rename unsafe-sync to head-sync (#7570)

* Rename unsafe-sync to head-sync

* Update comments

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
terence tsao 2020-10-19 13:03:31 -07:00 committed by GitHub
parent dccf0992e5
commit e25cd08049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 10 deletions

View File

@ -425,7 +425,7 @@ func (s *Service) initializeChainInfo(ctx context.Context) error {
}
s.genesisRoot = genesisBlkRoot
if flags.Get().UnsafeSync {
if flags.Get().HeadSync {
headBlock, err := s.beaconDB.HeadBlock(ctx)
if err != nil {
return errors.Wrap(err, "could not retrieve head block")

View File

@ -90,9 +90,9 @@ var (
Usage: "The percentage of freshly allocated data to live data on which the gc will be run again.",
Value: 100,
}
// UnsafeSync starts the beacon node from the previously saved head state and syncs from there.
UnsafeSync = &cli.BoolFlag{
Name: "unsafe-sync",
// HeadSync starts the beacon node from the previously saved head state and syncs from there.
HeadSync = &cli.BoolFlag{
Name: "head-sync",
Usage: "Starts the beacon node with the previously saved head state instead of finalized state.",
}
// SlotsPerArchivedPoint specifies the number of slots between the archived points, to save beacon state in the cold

View File

@ -9,7 +9,7 @@ import (
// GlobalFlags specifies all the global flags for the
// beacon node.
type GlobalFlags struct {
UnsafeSync bool
HeadSync bool
DisableSync bool
DisableDiscv5 bool
MinimumSyncPeers int
@ -36,9 +36,9 @@ func Init(c *GlobalFlags) {
// based on the provided cli context.
func ConfigureGlobalFlags(ctx *cli.Context) {
cfg := &GlobalFlags{}
if ctx.Bool(UnsafeSync.Name) {
log.Warn("Using Unsafe Sync flag, it is insecure to use this flag with your beacon node.")
cfg.UnsafeSync = true
if ctx.Bool(HeadSync.Name) {
log.Warn("Using Head Sync flag, it starts syncing from last saved head.")
cfg.HeadSync = true
}
if ctx.Bool(DisableSync.Name) {
log.Warn("Using Disable Sync flag, using this flag on a live network might lead to adverse consequences.")

View File

@ -39,7 +39,7 @@ var appFlags = []cli.Flag{
flags.MinSyncPeers,
flags.ContractDeploymentBlock,
flags.SetGCPercent,
flags.UnsafeSync,
flags.HeadSync,
flags.DisableSync,
flags.DisableDiscv5,
flags.BlockBatchLimit,

View File

@ -98,7 +98,7 @@ var appHelpFlagGroups = []flagGroup{
flags.GPRCGatewayCorsDomain,
flags.HTTPWeb3ProviderFlag,
flags.SetGCPercent,
flags.UnsafeSync,
flags.HeadSync,
flags.DisableSync,
flags.SlotsPerArchivedPoint,
flags.DisableDiscv5,