From bc7e4f7751e7bbf7ea5b72d4215c4d9b01576e7e Mon Sep 17 00:00:00 2001 From: james-prysm <90280386+james-prysm@users.noreply.github.com> Date: Thu, 10 Jul 2025 13:57:36 -0500 Subject: [PATCH] switching enable to disable for duties (#15445) --- changelog/james-prysm_default-duties-v2.md | 3 ++ config/features/config.go | 8 +++--- config/features/flags.go | 10 +++---- .../client/grpc-api/grpc_validator_client.go | 28 +++++++++---------- 4 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 changelog/james-prysm_default-duties-v2.md diff --git a/changelog/james-prysm_default-duties-v2.md b/changelog/james-prysm_default-duties-v2.md new file mode 100644 index 0000000000..68353d2c63 --- /dev/null +++ b/changelog/james-prysm_default-duties-v2.md @@ -0,0 +1,3 @@ +### Changed + +- Changed `enable-duties-v2` to `disable-duties-v2` to default to using duties v2. \ No newline at end of file diff --git a/config/features/config.go b/config/features/config.go index b7ec21289f..19a28684cc 100644 --- a/config/features/config.go +++ b/config/features/config.go @@ -49,7 +49,7 @@ type Flags struct { EnableHistoricalSpaceRepresentation bool // EnableHistoricalSpaceRepresentation enables the saving of registry validators in separate buckets to save space EnableBeaconRESTApi bool // EnableBeaconRESTApi enables experimental usage of the beacon REST API by the validator when querying a beacon node EnableExperimentalAttestationPool bool // EnableExperimentalAttestationPool enables an experimental attestation pool design. - EnableDutiesV2 bool // EnableDutiesV2 sets validator client to use the get Duties V2 endpoint + DisableDutiesV2 bool // DisableDutiesV2 sets validator client to use the get Duties endpoint EnableWeb bool // EnableWeb enables the webui on the validator client SSZOnly bool // SSZOnly forces the validator client to use SSZ for communication with the beacon node when REST mode is enabled (useful for debugging) // Logging related toggles. @@ -332,9 +332,9 @@ func ConfigureValidator(ctx *cli.Context) error { logEnabled(EnableBeaconRESTApi) cfg.EnableBeaconRESTApi = true } - if ctx.Bool(EnableDutiesV2.Name) { - logEnabled(EnableDutiesV2) - cfg.EnableDutiesV2 = true + if ctx.Bool(DisableDutiesV2.Name) { + logEnabled(DisableDutiesV2) + cfg.DisableDutiesV2 = true } if ctx.Bool(EnableWebFlag.Name) { logEnabled(EnableWebFlag) diff --git a/config/features/flags.go b/config/features/flags.go index df055af5c8..ef0616d844 100644 --- a/config/features/flags.go +++ b/config/features/flags.go @@ -185,10 +185,10 @@ var ( Usage: "A comma-separatted list of 0x-prefixed hexstrings. Declares blocks with the given blockroots to be invalid. It downscores peers that send these blocks.", } - // EnableDutiesV2 sets the validator client to use the get duties v2 grpc endpoint - EnableDutiesV2 = &cli.BoolFlag{ - Name: "enable-duties-v2", - Usage: "Forces use of get duties v2 endpoint.", + // DisableDutiesV2 sets the validator client to use the get duties grpc endpoint + DisableDutiesV2 = &cli.BoolFlag{ + Name: "disable-duties-v2", + Usage: "Forces use of get duties endpoint instead of v2.", } // EnableWebFlag enables controlling the validator client via the Prysm web ui. This is a work in progress. @@ -223,7 +223,7 @@ var ValidatorFlags = append(deprecatedFlags, []cli.Flag{ EnableMinimalSlashingProtection, enableDoppelGangerProtection, EnableBeaconRESTApi, - EnableDutiesV2, + DisableDutiesV2, EnableWebFlag, SSZOnly, }...) diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index 18879ec6c2..e4f5086879 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -29,21 +29,21 @@ type grpcValidatorClient struct { } func (c *grpcValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.ValidatorDutiesContainer, error) { - if features.Get().EnableDutiesV2 { - dutiesResponse, err := c.beaconNodeValidatorClient.GetDutiesV2(ctx, in) - if err != nil { - if status.Code(err) == codes.Unimplemented { - log.Warn("GetDutiesV2 returned status code unavailable, falling back to GetDuties") - return c.getDuties(ctx, in) - } - return nil, errors.Wrap( - client.ErrConnectionIssue, - errors.Wrap(err, "getDutiesV2").Error(), - ) - } - return toValidatorDutiesContainerV2(dutiesResponse) + if features.Get().DisableDutiesV2 { + return c.getDuties(ctx, in) } - return c.getDuties(ctx, in) + dutiesResponse, err := c.beaconNodeValidatorClient.GetDutiesV2(ctx, in) + if err != nil { + if status.Code(err) == codes.Unimplemented { + log.Warn("GetDutiesV2 returned status code unavailable, falling back to GetDuties") + return c.getDuties(ctx, in) + } + return nil, errors.Wrap( + client.ErrConnectionIssue, + errors.Wrap(err, "getDutiesV2").Error(), + ) + } + return toValidatorDutiesContainerV2(dutiesResponse) } // getDuties is calling the v1 of get duties