diff --git a/erpc/evm_json_rpc_cache.go b/erpc/evm_json_rpc_cache.go index ac358989..7ca40965 100644 --- a/erpc/evm_json_rpc_cache.go +++ b/erpc/evm_json_rpc_cache.go @@ -85,10 +85,6 @@ func (c *EvmJsonRpcCache) Get(ctx context.Context, req *common.NormalizedRequest return nil, err } - if resultString == `""` || resultString == "null" || resultString == "[]" || resultString == "{}" { - return nil, nil - } - jrr := &common.JsonRpcResponse{ JSONRPC: rpcReq.JSONRPC, ID: rpcReq.ID, @@ -114,7 +110,7 @@ func (c *EvmJsonRpcCache) Set(ctx context.Context, req *common.NormalizedRequest lg := c.logger.With().Str("network", req.NetworkId()).Str("method", rpcReq.Method).Logger() - if resp == nil || resp.IsObjectNull() || resp.IsResultEmptyish() || rpcResp == nil || rpcResp.Result == nil || rpcResp.Error != nil { + if rpcResp == nil || rpcResp.Result == nil || rpcResp.Error != nil { lg.Debug().Msg("not caching response because it has no result or has error") return nil } diff --git a/erpc/networks.go b/erpc/networks.go index e4c23405..e437b4a9 100644 --- a/erpc/networks.go +++ b/erpc/networks.go @@ -116,7 +116,7 @@ func (n *Network) Forward(ctx context.Context, req *common.NormalizedRequest) (* if err != nil { lg.Debug().Err(err).Msgf("could not find response in cache") health.MetricNetworkCacheMisses.WithLabelValues(n.ProjectId, n.NetworkId, method).Inc() - } else if resp != nil && !resp.IsObjectNull() && !resp.IsResultEmptyish() { + } else if resp != nil { resp.SetFromCache(true) lg.Info().Msgf("response served from cache") health.MetricNetworkCacheHits.WithLabelValues(n.ProjectId, n.NetworkId, method).Inc()