From a5f075c539e2988c1b159947e56b8bc86b1c4943 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Sun, 7 Jul 2024 17:27:36 -0400 Subject: [PATCH 1/2] fix submitter bug [goreleaser] --- services/cctp-relayer/relayer/relayer.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/services/cctp-relayer/relayer/relayer.go b/services/cctp-relayer/relayer/relayer.go index 9b55aff097..d54894d92b 100644 --- a/services/cctp-relayer/relayer/relayer.go +++ b/services/cctp-relayer/relayer/relayer.go @@ -2,6 +2,7 @@ package relayer import ( "context" + "errors" "fmt" "sync" "time" @@ -304,11 +305,13 @@ func (c *CCTPRelayer) Run(parentCtx context.Context) error { }) g.Go(func() error { - err := c.txSubmitter.Start(ctx) - if err != nil { - err = fmt.Errorf("could not start tx submitter: %w", err) + if !c.txSubmitter.Started() { + err := c.txSubmitter.Start(ctx) + if err != nil && !errors.Is(err, submitter.ErrSubmitterAlreadyStarted) { + return fmt.Errorf("could not start tx submitter: %w", err) + } } - return err + return nil }) g.Go(func() error { From 307513e3f7a75ec999c395a8125d413f17c11dd9 Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Sun, 7 Jul 2024 17:30:44 -0400 Subject: [PATCH 2/2] part 2 [goreleaser] --- services/rfq/relayer/service/relayer.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/rfq/relayer/service/relayer.go b/services/rfq/relayer/service/relayer.go index 78499e7637..22d0b3a91b 100644 --- a/services/rfq/relayer/service/relayer.go +++ b/services/rfq/relayer/service/relayer.go @@ -2,6 +2,7 @@ package service import ( "context" + "errors" "fmt" "math/big" "sync" @@ -237,9 +238,12 @@ func (r *Relayer) Start(ctx context.Context) (err error) { }) g.Go(func() error { - err := r.submitter.Start(ctx) - if err != nil { - return fmt.Errorf("could not start submitter: %w", err) + if !r.submitter.Started() { + err := r.submitter.Start(ctx) + if err != nil && !errors.Is(err, submitter.ErrSubmitterAlreadyStarted) { + return fmt.Errorf("could not start submitter: %w", err) + } + return nil } return nil })