diff --git a/pkg/client/block/client.go b/pkg/client/block/client.go index 5987b4ab0..60674d6a9 100644 --- a/pkg/client/block/client.go +++ b/pkg/client/block/client.go @@ -191,6 +191,7 @@ func (b *blockReplayClient) queryLatestBlock( defer client.AllQueriesTotalCounter.With( "method", "block", "client_type", "block", + "msg_type", "", ).Add(1) queryBlockResult, err := b.onStartQueryClient.Block(ctx, nil) diff --git a/pkg/client/query/appquerier.go b/pkg/client/query/appquerier.go index 9ac17139f..09eccadc2 100644 --- a/pkg/client/query/appquerier.go +++ b/pkg/client/query/appquerier.go @@ -9,7 +9,6 @@ import ( gogogrpc "github.com/cosmos/gogoproto/grpc" "github.com/pokt-network/poktroll/pkg/client" - "github.com/pokt-network/poktroll/pkg/client/query/cache" apptypes "github.com/pokt-network/poktroll/x/application/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -24,7 +23,6 @@ type appQuerier struct { clientConn gogogrpc.ClientConn applicationQuerier apptypes.QueryClient - paramsCache client.QueryCache[*apptypes.Params] } // NewApplicationQuerier returns a new instance of a client.ApplicationQueryClient @@ -41,7 +39,7 @@ func NewApplicationQuerier( opt(cfg) } - paramsQuerier, err := NewBaseParamsQuerier[*apptypes.Params, apptypes.ApplicationQueryClient]( + paramsQuerier, err := NewCachedParamsQuerier[*apptypes.Params, apptypes.ApplicationQueryClient]( deps, apptypes.NewAppQueryClient, WithModuleInfo[*sharedtypes.Params](sharedtypes.ModuleName, sharedtypes.ErrSharedParamInvalid), WithParamsCacheOptions(cfg.CacheOpts...), @@ -51,11 +49,10 @@ func NewApplicationQuerier( } aq := &appQuerier{ - paramsCache: cache.NewInMemoryCache[*apptypes.Params](cfg.CacheOpts...), ParamsQuerier: paramsQuerier, } - if err := depinject.Inject( + if err = depinject.Inject( deps, &aq.clientConn, ); err != nil { diff --git a/pkg/client/query/cache/config.go b/pkg/client/query/cache/config.go index 793a26fe2..c70fe7951 100644 --- a/pkg/client/query/cache/config.go +++ b/pkg/client/query/cache/config.go @@ -15,8 +15,8 @@ const ( // CacheConfig is the configuration options for a cache. type CacheConfig struct { - // MaxItems is the maximum number of items the cache can hold. - MaxItems int64 + // MaxKeys is the maximum number of items the cache can hold. + MaxKeys int64 // EvictionPolicy is how items should be removed when the cache is full. EvictionPolicy EvictionPolicy // TTL is how long items should remain in the cache @@ -51,10 +51,10 @@ func WithHistoricalMode(pruneOlderThan int64) CacheOption { } } -// WithMaxSize sets the maximum size of the cache -func WithMaxSize(size int64) CacheOption { +// WithMaxKeys sets the maximum size of the cache +func WithMaxKeys(size int64) CacheOption { return func(cfg *CacheConfig) { - cfg.MaxItems = size + cfg.MaxKeys = size } } diff --git a/pkg/client/query/cache/errors.go b/pkg/client/query/cache/errors.go index cc810c111..10e017568 100644 --- a/pkg/client/query/cache/errors.go +++ b/pkg/client/query/cache/errors.go @@ -5,7 +5,6 @@ import "cosmossdk.io/errors" const codesace = "client/query/cache" var ( - // TODO_IN_THIS_COMMIT: godoc... ErrCacheMiss = errors.Register(codesace, 1, "cache miss") ErrHistoricalModeNotEnabled = errors.Register(codesace, 2, "historical mode not enabled") ) diff --git a/pkg/client/query/cache/memory.go b/pkg/client/query/cache/memory.go index 549ff135b..06732f55a 100644 --- a/pkg/client/query/cache/memory.go +++ b/pkg/client/query/cache/memory.go @@ -123,7 +123,7 @@ func (c *InMemoryCache[T]) Set(key string, value T) error { return c.SetAtHeight(key, value, c.latestHeight.Load()) } - if c.config.MaxItems > 0 && int64(len(c.items)) >= c.config.MaxItems { + if c.config.MaxKeys > 0 && int64(len(c.items)) >= c.config.MaxKeys { c.evict() } diff --git a/pkg/client/query/cache/memory_test.go b/pkg/client/query/cache/memory_test.go index 50532aff2..ae8b6a92f 100644 --- a/pkg/client/query/cache/memory_test.go +++ b/pkg/client/query/cache/memory_test.go @@ -61,7 +61,7 @@ func TestInMemoryCache_NonHistorical(t *testing.T) { t.Run("max size eviction", func(t *testing.T) { cache := NewInMemoryCache[string]( - WithMaxSize(2), + WithMaxKeys(2), WithEvictionPolicy(FirstInFirstOut), ) diff --git a/pkg/client/query/options.go b/pkg/client/query/options.go index 42d2e6c14..ee110d800 100644 --- a/pkg/client/query/options.go +++ b/pkg/client/query/options.go @@ -15,8 +15,6 @@ type ParamsQuerierConfig struct { ModuleName string // ModuleParamError is the base error type for parameter query errors ModuleParamError *sdkerrors.Error - //// ParamsRequest is the request type used to query params - //ParamsRequest R } // ParamsQuerierOptionFn defines a function that configures a ParamsQuerierConfig @@ -28,8 +26,8 @@ func DefaultParamsQuerierConfig() *ParamsQuerierConfig { CacheOpts: []cache.CacheOption{ // TODO_IN_THIS_COMMIT: extract to constants. cache.WithHistoricalMode(100), - // TODO_IN_THIS_COMMIT: reconcile the fact that MaxItems doesn't apply to historical mode... - //cache.WithMaxSize(1), + // TODO_IN_THIS_COMMIT: reconcile the fact that MaxKeys doesn't apply to historical mode... + cache.WithMaxKeys(1), // TODO_IN_THIS_COMMIT: extract to constants. cache.WithEvictionPolicy(cache.FirstInFirstOut), }, @@ -51,19 +49,6 @@ func WithParamsCacheOptions(opts ...cache.CacheOption) ParamsQuerierOptionFn { } } -//// SharedQuerierConfig holds the configuration for the shared querier -//type SharedQuerierConfig = ParamsQuerierConfig -// -//// SharedQuerierOptionFn defines a function that configures a SharedQuerierConfig -//type SharedQuerierOptionFn = ParamsQuerierOptionFn -// -//// DefaultSharedQuerierConfig returns the default configuration -//// -//// TODO_IN_THIS_COMMIT: update comment... last option wins. -//func DefaultSharedQuerierConfig() *SharedQuerierConfig { -// return DefaultParamsQuerierConfig[*sharedtypes.QueryParamsRequest]() -//} - // WithCacheOptions adds cache configuration options to the shared querier func WithCacheOptions(opts ...cache.CacheOption) ParamsQuerierOptionFn { return func(cfg *ParamsQuerierConfig) { diff --git a/pkg/client/query/paramsquerier.go b/pkg/client/query/paramsquerier.go index f44a6e335..58d80ebba 100644 --- a/pkg/client/query/paramsquerier.go +++ b/pkg/client/query/paramsquerier.go @@ -13,28 +13,34 @@ import ( "github.com/pokt-network/poktroll/pkg/polylog" ) -// TODO_IN_THIS_COMMIT: godoc... +var _ client.ParamsQuerier[cosmostypes.Msg] = (*cachedParamsQuerier[cosmostypes.Msg, paramsQuerierIface[cosmostypes.Msg]])(nil) + +// paramsQuerierIface is an interface which generated query clients MUST implement +// to be compatible with the cachedParamsQuerier. +// DEV_NOTE: It is mainly required due to syntactic constraints imposed by the generics +// (i.e. otherwise, P here MUST be a value type, and there's no way to express that Q +// (below) SHOULD be the concrete type of P in NewCachedParamsQuerier). type paramsQuerierIface[P cosmostypes.Msg] interface { GetParams(context.Context) (P, error) } -// TODO_IN_THIS_COMMIT: update godoc... -// NewBaseParamsQuerier creates a new params querier with the given configuration -func NewBaseParamsQuerier[P cosmostypes.Msg, Q paramsQuerierIface[P]]( +// NewCachedParamsQuerier creates a new params querier with the given configuration +func NewCachedParamsQuerier[P cosmostypes.Msg, Q paramsQuerierIface[P]]( deps depinject.Config, queryClientConstructor func(conn gogogrpc.ClientConn) Q, opts ...ParamsQuerierOptionFn, -) (_ *baseParamsQuerier[P, Q], err error) { +) (_ client.ParamsQuerier[P], err error) { cfg := DefaultParamsQuerierConfig() for _, opt := range opts { opt(cfg) } - querier := &baseParamsQuerier[P, Q]{ + querier := &cachedParamsQuerier[P, Q]{ + config: cfg, paramsCache: cache.NewInMemoryCache[P](cfg.CacheOpts...), } - if err := depinject.Inject( + if err = depinject.Inject( deps, &querier.clientConn, ); err != nil { @@ -47,10 +53,10 @@ func NewBaseParamsQuerier[P cosmostypes.Msg, Q paramsQuerierIface[P]]( } // TODO_IN_THIS_COMMIT: update godoc... -// baseParamsQuerier provides common functionality for all params queriers. +// cachedParamsQuerier provides common functionality for all params queriers. // It handles parameter caching and chain querying in a generic way, where // R is the type of the parameters and Q is the type of the query client. -type baseParamsQuerier[P cosmostypes.Msg, Q paramsQuerierIface[P]] struct { +type cachedParamsQuerier[P cosmostypes.Msg, Q paramsQuerierIface[P]] struct { clientConn gogogrpc.ClientConn queryClient Q paramsCache client.HistoricalQueryCache[P] @@ -59,7 +65,7 @@ type baseParamsQuerier[P cosmostypes.Msg, Q paramsQuerierIface[P]] struct { // TODO_IN_THIS_COMMIT: update godoc... // GetParams implements the common parameter querying with caching -func (bq *baseParamsQuerier[P, Q]) GetParams(ctx context.Context) (P, error) { +func (bq *cachedParamsQuerier[P, Q]) GetParams(ctx context.Context) (P, error) { logger := polylog.Ctx(ctx).With( "querier", bq.config.ModuleName, "method", "GetParams", @@ -97,7 +103,7 @@ func (bq *baseParamsQuerier[P, Q]) GetParams(ctx context.Context) (P, error) { // TODO_IN_THIS_COMMIT: update godoc... // GetParamsAtHeight returns parameters as they were at a specific height -func (bq *baseParamsQuerier[P, Q]) GetParamsAtHeight(ctx context.Context, height int64) (P, error) { +func (bq *cachedParamsQuerier[P, Q]) GetParamsAtHeight(ctx context.Context, height int64) (P, error) { logger := polylog.Ctx(ctx).With( "querier", bq.config.ModuleName, "method", "GetParamsAtHeight", diff --git a/pkg/client/query/proofquerier.go b/pkg/client/query/proofquerier.go index 68b9019ec..78dbba230 100644 --- a/pkg/client/query/proofquerier.go +++ b/pkg/client/query/proofquerier.go @@ -5,7 +5,6 @@ import ( "github.com/cosmos/gogoproto/grpc" "github.com/pokt-network/poktroll/pkg/client" - "github.com/pokt-network/poktroll/pkg/client/query/cache" prooftypes "github.com/pokt-network/poktroll/x/proof/types" ) @@ -22,7 +21,6 @@ type proofQuerier struct { clientConn grpc.ClientConn proofQuerier prooftypes.QueryClient - paramsCache client.QueryCache[*prooftypes.Params] } // NewProofQuerier returns a new instance of a client.ProofQueryClient by @@ -42,7 +40,7 @@ func NewProofQuerier( opt(paramsQuerierCfg) } - paramsQuerier, err := NewBaseParamsQuerier[*prooftypes.Params, prooftypes.ProofQueryClient]( + paramsQuerier, err := NewCachedParamsQuerier[*prooftypes.Params, prooftypes.ProofQueryClient]( deps, prooftypes.NewProofQueryClient, WithModuleInfo[*prooftypes.Params](prooftypes.ModuleName, prooftypes.ErrProofParamInvalid), WithParamsCacheOptions(paramsQuerierCfg.CacheOpts...), @@ -52,13 +50,10 @@ func NewProofQuerier( } querier := &proofQuerier{ - // TODO_IN_THIS_COMMIT: extract this to an option. - // TODO_IMPROVE: add an option for persistent cache. - paramsCache: cache.NewInMemoryCache[*prooftypes.Params](paramsQuerierCfg.CacheOpts...), ParamsQuerier: paramsQuerier, } - if err := depinject.Inject( + if err = depinject.Inject( deps, &querier.clientConn, ); err != nil { diff --git a/pkg/client/query/servicequerier.go b/pkg/client/query/servicequerier.go index 63b61f46d..84beed5ad 100644 --- a/pkg/client/query/servicequerier.go +++ b/pkg/client/query/servicequerier.go @@ -7,7 +7,6 @@ import ( gogogrpc "github.com/cosmos/gogoproto/grpc" "github.com/pokt-network/poktroll/pkg/client" - "github.com/pokt-network/poktroll/pkg/client/query/cache" servicetypes "github.com/pokt-network/poktroll/x/service/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -22,7 +21,6 @@ type serviceQuerier struct { clientConn gogogrpc.ClientConn serviceQuerier servicetypes.QueryClient - paramsCache client.QueryCache[*servicetypes.Params] } // NewServiceQuerier returns a new instance of a client.ServiceQueryClient by @@ -39,7 +37,7 @@ func NewServiceQuerier( opt(paramsQuerierCfg) } - paramsQuerier, err := NewBaseParamsQuerier[*servicetypes.Params, servicetypes.ServiceQueryClient]( + paramsQuerier, err := NewCachedParamsQuerier[*servicetypes.Params, servicetypes.ServiceQueryClient]( deps, servicetypes.NewServiceQueryClient, WithModuleInfo[*servicetypes.Params](servicetypes.ModuleName, servicetypes.ErrServiceParamInvalid), WithParamsCacheOptions(paramsQuerierCfg.CacheOpts...), @@ -49,13 +47,10 @@ func NewServiceQuerier( } querier := &serviceQuerier{ - // TODO_IN_THIS_COMMIT: extract this to an option. - // TODO_IMPROVE: add an option for persistent cache. - paramsCache: cache.NewInMemoryCache[*servicetypes.Params](paramsQuerierCfg.CacheOpts...), ParamsQuerier: paramsQuerier, } - if err := depinject.Inject( + if err = depinject.Inject( deps, &querier.clientConn, ); err != nil { @@ -77,6 +72,8 @@ func (servq *serviceQuerier) GetService( Id: serviceId, } + // TODO_IN_THIS_COMMIT: historically cache services... + res, err := servq.serviceQuerier.Service(ctx, req) if err != nil { return sharedtypes.Service{}, ErrQueryRetrieveService.Wrapf( @@ -97,6 +94,8 @@ func (servq *serviceQuerier) GetServiceRelayDifficulty( ServiceId: serviceId, } + // TODO_IN_THIS_COMMIT: historically cache relay mining difficulties... + res, err := servq.serviceQuerier.RelayMiningDifficulty(ctx, req) if err != nil { return servicetypes.RelayMiningDifficulty{}, err diff --git a/pkg/client/query/sessionquerier.go b/pkg/client/query/sessionquerier.go index 926b9742e..77804a9c5 100644 --- a/pkg/client/query/sessionquerier.go +++ b/pkg/client/query/sessionquerier.go @@ -26,7 +26,6 @@ type sessionQuerier struct { clientConn grpc.ClientConn sessionQuerier sessiontypes.QueryClient sessionCache client.QueryCache[*sessiontypes.Session] - paramsCache client.QueryCache[*sessiontypes.Params] } // NewSessionQuerier returns a new instance of a client.SessionQueryClient by @@ -43,7 +42,7 @@ func NewSessionQuerier( opt(paramsQuerierCfg) } - paramsQuerier, err := NewBaseParamsQuerier[*sessiontypes.Params, sessiontypes.SessionQueryClient]( + paramsQuerier, err := NewCachedParamsQuerier[*sessiontypes.Params, sessiontypes.SessionQueryClient]( deps, sessiontypes.NewSessionQueryClient, WithModuleInfo[*sessiontypes.Params](sessiontypes.ModuleName, sessiontypes.ErrSessionParamInvalid), WithParamsCacheOptions(paramsQuerierCfg.CacheOpts...), @@ -56,21 +55,18 @@ func NewSessionQuerier( // TODO_IN_THIS_COMMIT: consider supporting multiple cache configs per query client. sessionCache := cache.NewInMemoryCache[*sessiontypes.Session]( // TODO_IN_THIS_COMMIT: extract to an option fn. - cache.WithMaxSize(100), + cache.WithMaxKeys(100), cache.WithEvictionPolicy(cache.LeastRecentlyUsed), // TODO_IN_THIS_COMMIT: extract to a constant. cache.WithTTL(time.Hour*3), ) querier := &sessionQuerier{ - // TODO_IN_THIS_COMMIT: extract this to an option. - // TODO_IMPROVE: add an option for persistent cache. - paramsCache: cache.NewInMemoryCache[*sessiontypes.Params](paramsQuerierCfg.CacheOpts...), ParamsQuerier: paramsQuerier, sessionCache: sessionCache, } - if err := depinject.Inject( + if err = depinject.Inject( deps, &querier.clientConn, ); err != nil { @@ -131,38 +127,3 @@ func (sq *sessionQuerier) GetSession( return res.Session, nil } - -// GetParams queries & returns the session module on-chain parameters. -func (sq *sessionQuerier) GetParams(ctx context.Context) (*sessiontypes.Params, error) { - logger := polylog.Ctx(ctx).With( - "querier", "session", - "method", "GetSession", - ) - - // Check cache first - cached, err := sq.paramsCache.Get("params") - - switch { - case err == nil: - logger.Debug().Msg("cache hit") - return cached, nil - case !errors.Is(err, cache.ErrCacheMiss): - return nil, err - } - - logger.Debug().Msg("cache miss") - - // If not in cache, query the chain - req := &sessiontypes.QueryParamsRequest{} - res, err := sq.sessionQuerier.Params(ctx, req) - if err != nil { - return nil, ErrQuerySessionParams.Wrapf("%s", err) - } - - // Cache the result before returning - if err = sq.paramsCache.Set("params", &res.Params); err != nil { - return nil, err - } - - return &res.Params, nil -} diff --git a/pkg/client/query/sharedquerier.go b/pkg/client/query/sharedquerier.go index f21974991..1970778e2 100644 --- a/pkg/client/query/sharedquerier.go +++ b/pkg/client/query/sharedquerier.go @@ -2,14 +2,11 @@ package query import ( "context" - "errors" "cosmossdk.io/depinject" "github.com/cosmos/gogoproto/grpc" "github.com/pokt-network/poktroll/pkg/client" - "github.com/pokt-network/poktroll/pkg/client/query/cache" - "github.com/pokt-network/poktroll/pkg/polylog" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -18,13 +15,11 @@ var _ client.SharedQueryClient = (*sharedQuerier)(nil) // sharedQuerier is a wrapper around the sharedtypes.QueryClient that enables the // querying of on-chain shared information type sharedQuerier struct { - *baseParamsQuerier[*sharedtypes.Params, client.SharedQueryClient] + client.ParamsQuerier[*sharedtypes.Params] clientConn grpc.ClientConn sharedQuerier sharedtypes.QueryClient blockQuerier client.BlockQueryClient - paramsQuerier client.ParamsQuerier[*sharedtypes.Params] - paramsCache client.QueryCache[*sharedtypes.Params] } // NewSharedQuerier returns a new instance of a client.SharedQueryClient by @@ -42,7 +37,7 @@ func NewSharedQuerier( opt(paramsQuerierCfg) } - paramsQuerier, err := NewBaseParamsQuerier[*sharedtypes.Params, sharedtypes.SharedQueryClient]( + paramsQuerier, err := NewCachedParamsQuerier[*sharedtypes.Params, sharedtypes.SharedQueryClient]( deps, sharedtypes.NewSharedQueryClient, WithModuleInfo[*sharedtypes.Params](sharedtypes.ModuleName, sharedtypes.ErrSharedParamInvalid), WithParamsCacheOptions(paramsQuerierCfg.CacheOpts...), @@ -52,13 +47,10 @@ func NewSharedQuerier( } sq := &sharedQuerier{ - // TODO_IN_THIS_COMMIT: extract this to an option. - // TODO_IMPROVE: add an option for persistent cache. - paramsCache: cache.NewInMemoryCache[*sharedtypes.Params](paramsQuerierCfg.CacheOpts...), - paramsQuerier: paramsQuerier, + ParamsQuerier: paramsQuerier, } - if err := depinject.Inject( + if err = depinject.Inject( deps, &sq.clientConn, &sq.blockQuerier, @@ -71,44 +63,6 @@ func NewSharedQuerier( return sq, nil } -// GetParams queries & returns the shared module on-chain parameters. -// -// TODO_TECHDEBT(#543): We don't really want to have to query the params for every method call. -// Once `ModuleParamsClient` is implemented, use its replay observable's `#Last()` method -// to get the most recently (asynchronously) observed (and cached) value. -func (sq *sharedQuerier) GetParams(ctx context.Context) (*sharedtypes.Params, error) { - logger := polylog.Ctx(ctx).With( - "querier", "session", - "method", "GetSession", - ) - - // Check cache first - cached, err := sq.paramsCache.Get("params") - switch { - case err == nil: - logger.Debug().Msg("cache hit") - return cached, nil - case !errors.Is(err, cache.ErrCacheMiss): - return nil, err - } - - logger.Debug().Msg("cache miss") - - // If not in cache, query the chain - req := &sharedtypes.QueryParamsRequest{} - res, err := sq.sharedQuerier.Params(ctx, req) - if err != nil { - return nil, ErrQuerySessionParams.Wrapf("%s", err) - } - - // Cache the result before returning - if err = sq.paramsCache.Set("params", &res.Params); err != nil { - return nil, err - } - - return &res.Params, nil -} - // GetClaimWindowOpenHeight returns the block height at which the claim window of // the session that includes queryHeight opens. // diff --git a/pkg/client/query/sharedquerier_test.go b/pkg/client/query/sharedquerier_test.go index 222b821ce..bde227919 100644 --- a/pkg/client/query/sharedquerier_test.go +++ b/pkg/client/query/sharedquerier_test.go @@ -40,10 +40,10 @@ func (s *SharedQuerierTestSuite) SetupTest() { s.mockBlock = mockclient.NewMockCometRPC(s.ctrl) s.TTL = 200 * time.Millisecond - cfg := depinject.Supply(s.mockConn, s.mockBlock) + deps := depinject.Supply(s.mockConn, s.mockBlock) // Create querier with test-specific cache settings - querier, err := query.NewSharedQuerier(cfg, + querier, err := query.NewSharedQuerier(deps, query.WithCacheOptions( cache.WithTTL(s.TTL), cache.WithHistoricalMode(100), diff --git a/pkg/client/query/supplierquerier.go b/pkg/client/query/supplierquerier.go index 4174c6fde..e1c4c1424 100644 --- a/pkg/client/query/supplierquerier.go +++ b/pkg/client/query/supplierquerier.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/gogoproto/grpc" "github.com/pokt-network/poktroll/pkg/client" - "github.com/pokt-network/poktroll/pkg/client/query/cache" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" ) @@ -22,7 +21,6 @@ type supplierQuerier struct { clientConn grpc.ClientConn supplierQuerier suppliertypes.QueryClient - paramsCache client.QueryCache[*suppliertypes.Params] } // NewSupplierQuerier returns a new instance of a client.SupplierQueryClient by @@ -39,7 +37,7 @@ func NewSupplierQuerier( opt(paramsQuerierCfg) } - paramsQuerier, err := NewBaseParamsQuerier[*suppliertypes.Params, suppliertypes.SupplierQueryClient]( + paramsQuerier, err := NewCachedParamsQuerier[*suppliertypes.Params, suppliertypes.SupplierQueryClient]( deps, suppliertypes.NewSupplierQueryClient, WithModuleInfo[*suppliertypes.Params](suppliertypes.ModuleName, suppliertypes.ErrSupplierParamInvalid), WithParamsCacheOptions(paramsQuerierCfg.CacheOpts...), @@ -49,11 +47,10 @@ func NewSupplierQuerier( } sq := &supplierQuerier{ - paramsCache: cache.NewInMemoryCache[*suppliertypes.Params](paramsQuerierCfg.CacheOpts...), ParamsQuerier: paramsQuerier, } - if err := depinject.Inject( + if err = depinject.Inject( deps, &sq.clientConn, ); err != nil {