diff --git a/protocol/daemons/slinky/client/client.go b/protocol/daemons/slinky/client/client.go index 8c80844faa..577212832f 100644 --- a/protocol/daemons/slinky/client/client.go +++ b/protocol/daemons/slinky/client/client.go @@ -2,6 +2,7 @@ package client import ( "context" + "fmt" "sync" "time" @@ -82,6 +83,7 @@ func (c *Client) start( defer c.wg.Done() c.RunMarketPairFetcher(c.ctx, appFlags, grpcClient) }() + // 2. Start the PriceFetcher c.priceFetcher = NewPriceFetcher( c.marketPairFetcher, @@ -94,6 +96,17 @@ func (c *Client) start( defer c.wg.Done() c.RunPriceFetcher(c.ctx) }() + + // 3. Start the SidecarVersionChecker + c.sidecarVersionChecker = NewSidecarVersionChecker( + slinky, + c.logger, + ) + c.wg.Add(1) + go func() { + defer c.wg.Done() + c.RunSidecarVersionChecker(c.ctx) + }() return nil } @@ -160,6 +173,7 @@ func (c *Client) RunMarketPairFetcher(ctx context.Context, appFlags appflags.Fla // RunSidecarVersionChecker periodically calls the sidecarVersionChecker to check if the running sidecar version // is at least a minimum acceptable version func (c *Client) RunSidecarVersionChecker(ctx context.Context) { + fmt.Println("Running SidecarVersionChecker") err := c.sidecarVersionChecker.Start(ctx) if err != nil { c.logger.Error("Error initializing sidecarVersionChecker in slinky daemon: %w", err) diff --git a/protocol/daemons/slinky/client/constants.go b/protocol/daemons/slinky/client/constants.go index 83bfbba4fc..865289b150 100644 --- a/protocol/daemons/slinky/client/constants.go +++ b/protocol/daemons/slinky/client/constants.go @@ -12,7 +12,7 @@ var ( // SlinkyMarketParamFetchDelay is the frequency at which we query the x/price module to refresh mappings from // currency pair to x/price ID. SlinkyMarketParamFetchDelay = time.Millisecond * 1900 - SlinkySidecarCheckDelay = time.Minute * 10 + SlinkySidecarCheckDelay = time.Second * 10 ) const ( diff --git a/protocol/daemons/slinky/client/sidecar_version_checker.go b/protocol/daemons/slinky/client/sidecar_version_checker.go index 093bcc87ad..b8e0d66e5b 100644 --- a/protocol/daemons/slinky/client/sidecar_version_checker.go +++ b/protocol/daemons/slinky/client/sidecar_version_checker.go @@ -12,7 +12,7 @@ import ( ) const ( - MinSidecarVersion = "v1.0.12" + MinSidecarVersion = "v2.1.0" ) // SidecarVersionChecker is a lightweight process run in a goroutine by the slinky client. @@ -26,14 +26,14 @@ type SidecarVersionChecker interface { // SidecarVersionCheckerImpl implements the SidecarVersionChecker interface. type SidecarVersionCheckerImpl struct { - Logger log.Logger slinky oracleclient.OracleClient + logger log.Logger } -func NewSidecarVersionChecker(logger log.Logger, slinky oracleclient.OracleClient) SidecarVersionChecker { +func NewSidecarVersionChecker(slinky oracleclient.OracleClient, logger log.Logger) SidecarVersionChecker { return &SidecarVersionCheckerImpl{ - Logger: logger, slinky: slinky, + logger: logger, } } @@ -55,6 +55,7 @@ func (p *SidecarVersionCheckerImpl) CheckSidecarVersion(ctx context.Context) err return err } current, err := version.NewVersion(slinkyResponse.Version) + fmt.Println("Sidecar version", current) if err != nil { return fmt.Errorf("failed to parse current version: %w", err) } @@ -70,7 +71,7 @@ func (p *SidecarVersionCheckerImpl) CheckSidecarVersion(ctx context.Context) err } // Version is acceptable - p.Logger.Info("Sidecar version check passed", "version", current) + p.logger.Info("Sidecar version check passed", "version", current) return nil } diff --git a/protocol/docker-compose.yml b/protocol/docker-compose.yml index 7314dee56b..d4dfaf55e1 100644 --- a/protocol/docker-compose.yml +++ b/protocol/docker-compose.yml @@ -116,7 +116,7 @@ services: volumes: - ./localnet/dydxprotocol3:/dydxprotocol/chain/.dave/data connect0: - image: ghcr.io/skip-mev/connect-sidecar:v2.1.0 + image: ghcr.io/skip-mev/connect-sidecar:v2.0.1 entrypoint: > sh -c "connect --marketmap-provider dydx_migration_api --oracle-config /etc/connect/oracle.json --log-std-out-level error" environment: