From cab037e76c299036e733c9121869880cb80c2b84 Mon Sep 17 00:00:00 2001 From: Felipe Alvarado Date: Thu, 19 Dec 2024 10:54:49 +0100 Subject: [PATCH 1/2] Remove ens client mainnet base url The URL https://api.thegraph.com/subgraphs/name/ensdomains/ens is no longer supported and it is necessary to use the ENS Mainnet subgraph (https://thegraph.com/explorer/subgraphs/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH) and the subgraph config to make the same queries to the TheGraph api. --- .../history/services/collectibles_service.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/safe_transaction_service/history/services/collectibles_service.py b/safe_transaction_service/history/services/collectibles_service.py index 78fceed90..4839b36b5 100644 --- a/safe_transaction_service/history/services/collectibles_service.py +++ b/safe_transaction_service/history/services/collectibles_service.py @@ -172,11 +172,12 @@ def __init__(self, ethereum_client: EthereumClient, redis: Redis): api_key=api_key, subgraph_id=subgraph_id, ) - # Else, provide fallback for Sepolia, Holesky and Mainnet + # Else, provide fallback for Sepolia, Holesky or empty configuration. else: logger.warning( "Using fallback EnsClient configuration. This configuration is not suitable for production and it is " - "recommended to setup a Subgraph API key. See https://docs.ens.domains/web/subgraph" + "recommended to setup a Subgraph API key. Mandatory for networks other than Sepolia or Holesky." + "See https://docs.ens.domains/web/subgraph" ) config = self.fallback_ens_client() @@ -197,9 +198,7 @@ def fallback_ens_client(self) -> EnsClient.Config: "https://api.studio.thegraph.com/query/49574/ensholesky/version/latest", ) else: - return EnsClient.Config( - "https://api.thegraph.com/subgraphs/name/ensdomains/ens/", - ) + return EnsClient.Config("") def get_metadata_cache_key(self, address: str, token_id: int): return f"metadata:{address}:{token_id}" From 262f471a997b54f65a7b81525bfb1ebea978cb45 Mon Sep 17 00:00:00 2001 From: Felipe Alvarado Date: Thu, 26 Dec 2024 14:03:44 +0100 Subject: [PATCH 2/2] Add log for unavailable ens client config --- .../history/services/collectibles_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/safe_transaction_service/history/services/collectibles_service.py b/safe_transaction_service/history/services/collectibles_service.py index 4839b36b5..8f9712700 100644 --- a/safe_transaction_service/history/services/collectibles_service.py +++ b/safe_transaction_service/history/services/collectibles_service.py @@ -198,6 +198,10 @@ def fallback_ens_client(self) -> EnsClient.Config: "https://api.studio.thegraph.com/query/49574/ensholesky/version/latest", ) else: + logger.warning( + "No fallback Ens Client configuration for network=%s available", + self.ethereum_network, + ) return EnsClient.Config("") def get_metadata_cache_key(self, address: str, token_id: int):