diff --git a/beacon-chain/powchain/options.go b/beacon-chain/powchain/options.go index a73adf1be..0179bdf73 100644 --- a/beacon-chain/powchain/options.go +++ b/beacon-chain/powchain/options.go @@ -32,14 +32,6 @@ func WithHttpEndpoints(endpointStrings []string) Option { } } -// WithExecutionEndpoint for the execution node JSON-RPC endpoint. -func WithExecutionEndpoint(endpoint string) Option { - return func(s *Service) error { - s.cfg.executionEndpoint = endpoint - return nil - } -} - // WithExecutionClientJWTSecret for authenticating the execution node JSON-RPC endpoint. func WithExecutionClientJWTSecret(jwtSecret []byte) Option { return func(s *Service) error { diff --git a/beacon-chain/powchain/service.go b/beacon-chain/powchain/service.go index a61e3468f..116dca0b3 100644 --- a/beacon-chain/powchain/service.go +++ b/beacon-chain/powchain/service.go @@ -135,7 +135,6 @@ type config struct { eth1HeaderReqLimit uint64 beaconNodeStatsUpdater BeaconNodeStatsUpdater httpEndpoints []network.Endpoint - executionEndpoint string executionEndpointJWTSecret []byte currHttpEndpoint network.Endpoint finalizedStateAtStartup state.BeaconState @@ -213,13 +212,6 @@ func NewService(ctx context.Context, opts ...Option) (*Service, error) { } } - if err := s.initializeEngineAPIClient(ctx); err != nil { - return nil, errors.Wrap(err, "unable to initialize engine API client") - } - - // Check transition configuration for the engine API client in the background. - go s.checkTransitionConfiguration(ctx) - if err := s.ensureValidPowchainData(ctx); err != nil { return nil, errors.Wrap(err, "unable to validate powchain data") } @@ -254,6 +246,14 @@ func (s *Service) Start() { if s.cfg.currHttpEndpoint.Url == "" { return } + + if err := s.initializeEngineAPIClient(s.ctx); err != nil { + log.WithError(err).Fatal("unable to initialize engine API client") + } + + // Check transition configuration for the engine API client in the background. + go s.checkTransitionConfiguration(s.ctx) + go func() { s.isRunning = true s.waitForConnection() @@ -1058,13 +1058,10 @@ func (s *Service) ensureValidPowchainData(ctx context.Context) error { // Initializes a connection to the engine API if an execution provider endpoint is set. func (s *Service) initializeEngineAPIClient(ctx context.Context) error { - if s.cfg.executionEndpoint == "" { - return nil - } opts := []engine.Option{ engine.WithJWTSecret(s.cfg.executionEndpointJWTSecret), } - client, err := engine.New(ctx, s.cfg.executionEndpoint, opts...) + client, err := engine.New(ctx, s.cfg.currHttpEndpoint.Url, opts...) if err != nil { return err } diff --git a/cmd/beacon-chain/flags/base.go b/cmd/beacon-chain/flags/base.go index 94d984d33..bae11f76e 100644 --- a/cmd/beacon-chain/flags/base.go +++ b/cmd/beacon-chain/flags/base.go @@ -17,12 +17,6 @@ var ( Usage: "A mainchain web3 provider string http endpoint. Can contain auth header as well in the format --http-web3provider=\"https://goerli.infura.io/v3/xxxx,Basic xxx\" for project secret (base64 encoded) and --http-web3provider=\"https://goerli.infura.io/v3/xxxx,Bearer xxx\" for jwt use", Value: "", } - // ExecutionProvider provides an HTTP or IPC access endpoint to an ETH execution node. - ExecutionProviderFlag = &cli.StringFlag{ - Name: "execution-provider", - Usage: "An http endpoint for an Ethereum execution node", - Value: "", - } // ExecutionJWTSecretFlag provides a path to a file containing a hex-encoded string representing a 32 byte secret // used to authenticate with an execution node via HTTP. This is required if using an HTTP connection, otherwise all requests // to execution nodes for consensus-related calls will fail. This is not required if using an IPC connection. diff --git a/cmd/beacon-chain/main.go b/cmd/beacon-chain/main.go index b5152f407..f85c018fd 100644 --- a/cmd/beacon-chain/main.go +++ b/cmd/beacon-chain/main.go @@ -33,7 +33,6 @@ import ( var appFlags = []cli.Flag{ flags.DepositContractFlag, flags.HTTPWeb3ProviderFlag, - flags.ExecutionProviderFlag, flags.ExecutionJWTSecretFlag, flags.FallbackWeb3ProviderFlag, flags.RPCHost, diff --git a/cmd/beacon-chain/powchain/options.go b/cmd/beacon-chain/powchain/options.go index 26db9e295..cbc29caf6 100644 --- a/cmd/beacon-chain/powchain/options.go +++ b/cmd/beacon-chain/powchain/options.go @@ -18,7 +18,6 @@ var log = logrus.WithField("prefix", "cmd-powchain") // FlagOptions for powchain service flag configurations. func FlagOptions(c *cli.Context) ([]powchain.Option, error) { endpoints := parsePowchainEndpoints(c) - executionEndpoint := parseExecutionEndpoint(c) jwtSecret, err := parseJWTSecretFromFile(c) if err != nil { return nil, errors.Wrap(err, "could not read JWT secret file for authenticating execution API") @@ -27,9 +26,6 @@ func FlagOptions(c *cli.Context) ([]powchain.Option, error) { powchain.WithHttpEndpoints(endpoints), powchain.WithEth1HeaderRequestLimit(c.Uint64(flags.Eth1HeaderReqLimit.Name)), } - if executionEndpoint != "" { - opts = append(opts, powchain.WithExecutionEndpoint(executionEndpoint)) - } if len(jwtSecret) > 0 { opts = append(opts, powchain.WithExecutionClientJWTSecret(jwtSecret)) } @@ -85,7 +81,3 @@ func parsePowchainEndpoints(c *cli.Context) []string { endpoints = append(endpoints, c.StringSlice(flags.FallbackWeb3ProviderFlag.Name)...) return endpoints } - -func parseExecutionEndpoint(c *cli.Context) string { - return c.String(flags.ExecutionProviderFlag.Name) -} diff --git a/cmd/beacon-chain/usage.go b/cmd/beacon-chain/usage.go index 69bc1578f..c3e94aca9 100644 --- a/cmd/beacon-chain/usage.go +++ b/cmd/beacon-chain/usage.go @@ -107,7 +107,6 @@ var appHelpFlagGroups = []flagGroup{ flags.GRPCGatewayPort, flags.GPRCGatewayCorsDomain, flags.HTTPWeb3ProviderFlag, - flags.ExecutionProviderFlag, flags.ExecutionJWTSecretFlag, flags.FallbackWeb3ProviderFlag, flags.SetGCPercent,