mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 04:54:05 -05:00
Only use head if it's compatible with target (#15965)
* Only use head if it's compatible with target * Allow blocks from the previous epoch to be viable for checkpoints * Add feature flag to make it configurable * fix tests * @satushh's review * Manu's nit * Use fields in logs
This commit is contained in:
@@ -69,6 +69,7 @@ type Flags struct {
|
||||
|
||||
DisableResourceManager bool // Disables running the node with libp2p's resource manager.
|
||||
DisableStakinContractCheck bool // Disables check for deposit contract when proposing blocks
|
||||
DisableLastEpochTargets bool // Disables processing of states for attestations to old blocks.
|
||||
|
||||
EnableVerboseSigVerification bool // EnableVerboseSigVerification specifies whether to verify individual signature if batch verification fails
|
||||
|
||||
@@ -274,11 +275,14 @@ func ConfigureBeaconChain(ctx *cli.Context) error {
|
||||
logEnabled(forceHeadFlag)
|
||||
cfg.ForceHead = ctx.String(forceHeadFlag.Name)
|
||||
}
|
||||
|
||||
if ctx.IsSet(blacklistRoots.Name) {
|
||||
logEnabled(blacklistRoots)
|
||||
cfg.BlacklistedRoots = parseBlacklistedRoots(ctx.StringSlice(blacklistRoots.Name))
|
||||
}
|
||||
if ctx.IsSet(disableLastEpochTargets.Name) {
|
||||
logEnabled(disableLastEpochTargets)
|
||||
cfg.DisableLastEpochTargets = true
|
||||
}
|
||||
|
||||
cfg.AggregateIntervals = [3]time.Duration{aggregateFirstInterval.Value, aggregateSecondInterval.Value, aggregateThirdInterval.Value}
|
||||
Init(cfg)
|
||||
|
||||
@@ -197,6 +197,11 @@ var (
|
||||
Usage: "(Work in progress): Enables the web portal for the validator client.",
|
||||
Value: false,
|
||||
}
|
||||
// disableLastEpochTargets is a flag to disable processing of attestations for old blocks.
|
||||
disableLastEpochTargets = &cli.BoolFlag{
|
||||
Name: "disable-last-epoch-targets",
|
||||
Usage: "Disables processing of last epoch targets.",
|
||||
}
|
||||
)
|
||||
|
||||
// devModeFlags holds list of flags that are set when development mode is on.
|
||||
@@ -257,6 +262,7 @@ var BeaconChainFlags = combinedFlags([]cli.Flag{
|
||||
enableExperimentalAttestationPool,
|
||||
forceHeadFlag,
|
||||
blacklistRoots,
|
||||
disableLastEpochTargets,
|
||||
}, deprecatedBeaconFlags, deprecatedFlags, upcomingDeprecation)
|
||||
|
||||
func combinedFlags(flags ...[]cli.Flag) []cli.Flag {
|
||||
|
||||
Reference in New Issue
Block a user