Skip to content

Commit

Permalink
Rename the flag + add missing description
Browse files Browse the repository at this point in the history
  • Loading branch information
saolyn committed Mar 10, 2023
1 parent 9ffda22 commit 95f105e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions beacon-chain/execution/engine_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ func (s *Service) HeaderByNumber(ctx context.Context, number *big.Int) (*types.H
return hdr, err
}

// GetPayloadBodiesByHash --
// GetPayloadBodiesByHash returns the relevant payload bodies for the provided block hash.
func (s *Service) GetPayloadBodiesByHash(ctx context.Context, executionBlockHashes []common.Hash) ([]*pb.ExecutionPayloadBodyV1, error) {
if !features.Get().EnableCapellaEngineMethods {
return nil, errors.New("capella engine methods not enabled")
if !features.Get().EnableOptionalEngineMethods {
return nil, errors.New("optional engine methods not enabled")
}
ctx, span := trace.StartSpan(ctx, "powchain.engine-api-client.GetPayloadBodiesByHashV1")
defer span.End()
Expand All @@ -464,10 +464,10 @@ func (s *Service) GetPayloadBodiesByHash(ctx context.Context, executionBlockHash
return result, handleRPCError(err)
}

// GetPayloadBodiesByRange --
// GetPayloadBodiesByRange returns the relevant payload bodies for the provided range.
func (s *Service) GetPayloadBodiesByRange(ctx context.Context, start, count uint64) ([]*pb.ExecutionPayloadBodyV1, error) {
if !features.Get().EnableCapellaEngineMethods {
return nil, errors.New("capella engine methods not enabled")
if !features.Get().EnableOptionalEngineMethods {
return nil, errors.New("optional engine methods not enabled")
}
ctx, span := trace.StartSpan(ctx, "powchain.engine-api-client.GetPayloadBodiesByRangeV1")
defer span.End()
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/execution/engine_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ func newPayloadV2Setup(t *testing.T, status *pb.PayloadStatus, payload *pb.Execu

func TestCapella_PayloadBodiesByHash(t *testing.T) {
resetFn := features.InitWithReset(&features.Flags{
EnableCapellaEngineMethods: true,
EnableOptionalEngineMethods: true,
})
defer resetFn()
t.Run("empty response works", func(t *testing.T) {
Expand Down Expand Up @@ -2072,7 +2072,7 @@ func TestCapella_PayloadBodiesByHash(t *testing.T) {

func TestCapella_PayloadBodiesByRange(t *testing.T) {
resetFn := features.InitWithReset(&features.Flags{
EnableCapellaEngineMethods: true,
EnableOptionalEngineMethods: true,
})
defer resetFn()
t.Run("empty response works", func(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions config/features/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type Flags struct {
DisableStakinContractCheck bool // Disables check for deposit contract when proposing blocks

EnableVerboseSigVerification bool // EnableVerboseSigVerification specifies whether to verify individual signature if batch verification fails
EnableCapellaEngineMethods bool // EnableCapellaEngineMethods specifies whether to activate capella specific engine methods
EnableOptionalEngineMethods bool // EnableOptionalEngineMethods specifies whether to activate capella specific engine methods

// KeystoreImportDebounceInterval specifies the time duration the validator waits to reload new keys if they have
// changed on disk. This feature is for advanced use cases only.
Expand Down Expand Up @@ -256,9 +256,9 @@ func ConfigureBeaconChain(ctx *cli.Context) error {
logEnabled(enableVerboseSigVerification)
cfg.EnableVerboseSigVerification = true
}
if ctx.IsSet(EnableCapellaEngineMethods.Name) {
logEnabled(EnableCapellaEngineMethods)
cfg.EnableCapellaEngineMethods = true
if ctx.IsSet(EnableOptionalEngineMethods.Name) {
logEnabled(EnableOptionalEngineMethods)
cfg.EnableOptionalEngineMethods = true
}
Init(cfg)
return nil
Expand Down
8 changes: 4 additions & 4 deletions config/features/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ var (
Name: "enable-verbose-sig-verification",
Usage: "Enables identifying invalid signatures if batch verification fails when processing block",
}
EnableCapellaEngineMethods = &cli.BoolFlag{
Name: "enable-capella-engine-methods",
Usage: "Enables the capella engine methods",
EnableOptionalEngineMethods = &cli.BoolFlag{
Name: "enable-optional-engine-methods",
Usage: "Enables the optional engine methods",
}
)

Expand Down Expand Up @@ -186,7 +186,7 @@ var BeaconChainFlags = append(deprecatedBeaconFlags, append(deprecatedFlags, []c
disableDefensivePull,
enableFullSSZDataLogging,
enableVerboseSigVerification,
EnableCapellaEngineMethods,
EnableOptionalEngineMethods,
}...)...)

// E2EBeaconChainFlags contains a list of the beacon chain feature flags to be tested in E2E.
Expand Down

0 comments on commit 95f105e

Please sign in to comment.