diff --git a/pkg/loop/ccip_commit.go b/pkg/loop/ccip_commit.go index 119de6128..598f06096 100644 --- a/pkg/loop/ccip_commit.go +++ b/pkg/loop/ccip_commit.go @@ -85,7 +85,7 @@ func NewCommitService(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec.Cm } func (m *CommitFactoryService) NewReportingPlugin(ctx context.Context, config ocrtypes.ReportingPluginConfig) (ocrtypes.ReportingPlugin, ocrtypes.ReportingPluginInfo, error) { - if err := m.Wait(); err != nil { + if err := m.WaitCtx(ctx); err != nil { return nil, ocrtypes.ReportingPluginInfo{}, err } return m.Service.NewReportingPlugin(ctx, config) diff --git a/pkg/loop/ccip_execution.go b/pkg/loop/ccip_execution.go index 099580c74..2df482a35 100644 --- a/pkg/loop/ccip_execution.go +++ b/pkg/loop/ccip_execution.go @@ -85,7 +85,7 @@ func NewExecutionService(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec } func (m *ExecutionFactoryService) NewReportingPlugin(ctx context.Context, config ocrtypes.ReportingPluginConfig) (ocrtypes.ReportingPlugin, ocrtypes.ReportingPluginInfo, error) { - if err := m.Wait(); err != nil { + if err := m.WaitCtx(ctx); err != nil { return nil, ocrtypes.ReportingPluginInfo{}, err } return m.Service.NewReportingPlugin(ctx, config) diff --git a/pkg/loop/internal/goplugin/plugin_service.go b/pkg/loop/internal/goplugin/plugin_service.go index 1b147f13c..bf02298e8 100644 --- a/pkg/loop/internal/goplugin/plugin_service.go +++ b/pkg/loop/internal/goplugin/plugin_service.go @@ -223,11 +223,6 @@ func (s *PluginService[P, S]) WaitCtx(ctx context.Context) error { } } -// Wait is the context-ignorant version of WaitCtx above. -func (s *PluginService[P, S]) Wait() error { - return s.WaitCtx(context.Background()) -} - // XXXTestHook returns a TestPluginService. // It must only be called once, and before Start. func (s *PluginService[P, S]) XXXTestHook() TestPluginService[P, S] { diff --git a/pkg/loop/internal/relayerset/relayer.go b/pkg/loop/internal/relayerset/relayer.go index a85dcdbc6..fe0cd4351 100644 --- a/pkg/loop/internal/relayerset/relayer.go +++ b/pkg/loop/internal/relayerset/relayer.go @@ -93,8 +93,8 @@ func (r *relayerClient) Name() string { return name } -func (r *relayerClient) LatestHead(_ context.Context) (types.Head, error) { - latestHead, err := r.relayerSetClient.RelayerLatestHead(context.Background(), r.relayerID) +func (r *relayerClient) LatestHead(ctx context.Context) (types.Head, error) { + latestHead, err := r.relayerSetClient.RelayerLatestHead(ctx, r.relayerID) if err != nil { r.log.Error("error getting latestHead", "error", err) return types.Head{}, err diff --git a/pkg/loop/median_service.go b/pkg/loop/median_service.go index 44bf302c7..eec104f7f 100644 --- a/pkg/loop/median_service.go +++ b/pkg/loop/median_service.go @@ -40,7 +40,7 @@ func NewMedianService(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec.Cm } func (m *MedianService) NewReportingPlugin(ctx context.Context, config ocrtypes.ReportingPluginConfig) (ocrtypes.ReportingPlugin, ocrtypes.ReportingPluginInfo, error) { - if err := m.Wait(); err != nil { + if err := m.WaitCtx(ctx); err != nil { return nil, ocrtypes.ReportingPluginInfo{}, err } return m.Service.NewReportingPlugin(ctx, config) diff --git a/pkg/loop/mercury_service.go b/pkg/loop/mercury_service.go index f3eca6e06..1696c343c 100644 --- a/pkg/loop/mercury_service.go +++ b/pkg/loop/mercury_service.go @@ -44,7 +44,7 @@ func NewMercuryV4Service(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec } func (m *MercuryV4Service) NewMercuryPlugin(ctx context.Context, config ocr3types.MercuryPluginConfig) (ocr3types.MercuryPlugin, ocr3types.MercuryPluginInfo, error) { - if err := m.Wait(); err != nil { + if err := m.WaitCtx(ctx); err != nil { return nil, ocr3types.MercuryPluginInfo{}, err } return m.Service.NewMercuryPlugin(ctx, config) @@ -78,7 +78,7 @@ func NewMercuryV3Service(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec } func (m *MercuryV3Service) NewMercuryPlugin(ctx context.Context, config ocr3types.MercuryPluginConfig) (ocr3types.MercuryPlugin, ocr3types.MercuryPluginInfo, error) { - if err := m.Wait(); err != nil { + if err := m.WaitCtx(ctx); err != nil { return nil, ocr3types.MercuryPluginInfo{}, err } return m.Service.NewMercuryPlugin(ctx, config) @@ -110,7 +110,7 @@ func NewMercuryV1Service(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec } func (m *MercuryV1Service) NewMercuryPlugin(ctx context.Context, config ocr3types.MercuryPluginConfig) (ocr3types.MercuryPlugin, ocr3types.MercuryPluginInfo, error) { - if err := m.Wait(); err != nil { + if err := m.WaitCtx(ctx); err != nil { return nil, ocr3types.MercuryPluginInfo{}, err } return m.Service.NewMercuryPlugin(ctx, config) @@ -144,7 +144,7 @@ func NewMercuryV2Service(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec } func (m *MercuryV2Service) NewMercuryPlugin(ctx context.Context, config ocr3types.MercuryPluginConfig) (ocr3types.MercuryPlugin, ocr3types.MercuryPluginInfo, error) { - if err := m.Wait(); err != nil { + if err := m.WaitCtx(ctx); err != nil { return nil, ocr3types.MercuryPluginInfo{}, err } return m.Service.NewMercuryPlugin(ctx, config) diff --git a/pkg/loop/reportingplugins/loopp_service.go b/pkg/loop/reportingplugins/loopp_service.go index 92b7db4fd..8fbbaa68c 100644 --- a/pkg/loop/reportingplugins/loopp_service.go +++ b/pkg/loop/reportingplugins/loopp_service.go @@ -60,7 +60,7 @@ func NewLOOPPService( } func (g *LOOPPService) NewReportingPlugin(ctx context.Context, config ocrtypes.ReportingPluginConfig) (ocrtypes.ReportingPlugin, ocrtypes.ReportingPluginInfo, error) { - if err := g.Wait(); err != nil { + if err := g.WaitCtx(ctx); err != nil { return nil, ocrtypes.ReportingPluginInfo{}, err } return g.Service.NewReportingPlugin(ctx, config) @@ -87,7 +87,7 @@ func NewLOOPPServiceValidation( } func (g *LOOPPServiceValidation) ValidateConfig(ctx context.Context, config map[string]interface{}) error { - if err := g.Wait(); err != nil { + if err := g.WaitCtx(ctx); err != nil { return err } diff --git a/pkg/loop/reportingplugins/ocr3/loopp_service.go b/pkg/loop/reportingplugins/ocr3/loopp_service.go index 7f3a088df..7b10fcabc 100644 --- a/pkg/loop/reportingplugins/ocr3/loopp_service.go +++ b/pkg/loop/reportingplugins/ocr3/loopp_service.go @@ -52,7 +52,7 @@ func NewLOOPPService( } func (g *LOOPPService) NewReportingPlugin(ctx context.Context, config ocr3types.ReportingPluginConfig) (ocr3types.ReportingPlugin[[]byte], ocr3types.ReportingPluginInfo, error) { - if err := g.Wait(); err != nil { + if err := g.WaitCtx(ctx); err != nil { return nil, ocr3types.ReportingPluginInfo{}, err } return g.Service.NewReportingPlugin(ctx, config)