mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
warnings for flags due for deprecation (#14856)
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
This commit is contained in:
@@ -166,6 +166,7 @@ func applyHoleskyFeatureFlags(ctx *cli.Context) {
|
||||
// ConfigureBeaconChain sets the global config based
|
||||
// on what flags are enabled for the beacon-chain client.
|
||||
func ConfigureBeaconChain(ctx *cli.Context) error {
|
||||
warnDeprecationUpcoming(ctx)
|
||||
complainOnDeprecatedFlags(ctx)
|
||||
cfg := &Flags{}
|
||||
if ctx.Bool(devModeFlag.Name) {
|
||||
@@ -336,6 +337,22 @@ func complainOnDeprecatedFlags(ctx *cli.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
var upcomingDeprecationExtra = map[string]string{
|
||||
enableHistoricalSpaceRepresentation.Name: "The node needs to be resynced after flag removal.",
|
||||
}
|
||||
|
||||
func warnDeprecationUpcoming(ctx *cli.Context) {
|
||||
for _, f := range upcomingDeprecation {
|
||||
if ctx.IsSet(f.Names()[0]) {
|
||||
extra := "Please remove this flag from your configuration."
|
||||
if special, ok := upcomingDeprecationExtra[f.Names()[0]]; ok {
|
||||
extra += " " + special
|
||||
}
|
||||
log.Warnf("--%s is pending deprecation and will be removed in the next release. %s", f.Names()[0], extra)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func logEnabled(flag cli.DocGenerationFlag) {
|
||||
var name string
|
||||
if names := flag.Names(); len(names) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user