diff --git a/src/dipdup/config.py b/src/dipdup/config.py index f1263b620..ecdf4e4b7 100644 --- a/src/dipdup/config.py +++ b/src/dipdup/config.py @@ -555,8 +555,6 @@ class OperationIndexConfig(IndexConfig): :param datasource: Alias of index datasource in `datasources` section :param contracts: Aliases of contracts being indexed in `contracts` section :param stateless: Makes index dynamic. DipDup will synchronize index from the first block on every run - :param subscribe_by_entrypoints: Subscribe to operations by list of entrypoints instead of per-address in dynamic indexes (factories). - Helps to reduce total number of subscriptions at a cost of additional computations and traffic. :param first_block: First block to process (use with `--oneshot` run argument) :param last_block: Last block to process (use with `--oneshot` run argument) :param handlers: List of indexer handlers @@ -568,7 +566,6 @@ class OperationIndexConfig(IndexConfig): contracts: Optional[List[Union[str, ContractConfig]]] = None stateless: bool = False - subscribe_by_entrypoints: bool = False first_block: int = 0 last_block: int = 0 diff --git a/src/dipdup/datasources/datasource.py b/src/dipdup/datasources/datasource.py index 320d6dfe8..2856b2f88 100644 --- a/src/dipdup/datasources/datasource.py +++ b/src/dipdup/datasources/datasource.py @@ -88,7 +88,6 @@ def emit_head(self, block: HeadBlockData) -> None: @dataclass class Subscriptions: address_transactions: Set[str] = Field(default_factory=set) - entrypoint_transactions: Set[str] = Field(default_factory=set) originations: bool = False head: bool = False big_maps: DefaultDict[str, Set[str]] = Field(default_factory=partial(defaultdict, set)) @@ -96,7 +95,6 @@ class Subscriptions: def get_pending(self, active_subscriptions: 'Subscriptions') -> 'Subscriptions': return Subscriptions( address_transactions=self.address_transactions.difference(active_subscriptions.address_transactions), - entrypoint_transactions=self.entrypoint_transactions.difference(active_subscriptions.entrypoint_transactions), originations=not active_subscriptions.originations, head=not active_subscriptions.head, big_maps=defaultdict(set, {k: self.big_maps[k] for k in set(self.big_maps) - set(active_subscriptions.big_maps)}), @@ -111,9 +109,6 @@ def __init__(self) -> None: def add_address_transaction_subscription(self, address: str) -> None: self._subscriptions.address_transactions.add(address) - def add_entrypoint_transaction_subscription(self, entrypoint: str) -> None: - self._subscriptions.entrypoint_transactions.add(entrypoint) - def add_origination_subscription(self) -> None: self._subscriptions.originations = True diff --git a/src/dipdup/datasources/tzkt/datasource.py b/src/dipdup/datasources/tzkt/datasource.py index 75373d35a..f1ac09abb 100644 --- a/src/dipdup/datasources/tzkt/datasource.py +++ b/src/dipdup/datasources/tzkt/datasource.py @@ -457,14 +457,8 @@ async def add_index(self, index_config: IndexConfigTemplateT) -> None: """Register index config in internal mappings and matchers. Find and register subscriptions.""" if isinstance(index_config, OperationIndexConfig): - parent_config = cast(Optional[OperationIndexConfig], index_config.parent) - subscribe_by_entrypoints = parent_config.subscribe_by_entrypoints if parent_config else index_config.subscribe_by_entrypoints - if subscribe_by_entrypoints: - for entrypoint in index_config.entrypoints: - self._subscriptions.add_entrypoint_transaction_subscription(entrypoint) - else: - for contract_config in index_config.contracts or []: - self._subscriptions.add_address_transaction_subscription(cast(ContractConfig, contract_config).address) + for contract_config in index_config.contracts or []: + self._subscriptions.add_address_transaction_subscription(cast(ContractConfig, contract_config).address) for handler_config in index_config.handlers: for pattern_config in handler_config.pattern: @@ -529,8 +523,6 @@ async def subscribe(self) -> None: for address in pending_subscriptions.address_transactions: await self._subscribe_to_address_transactions(address) - if pending_subscriptions.entrypoint_transactions: - await self._subscribe_to_entrypoint_transactions(pending_subscriptions.entrypoint_transactions) if pending_subscriptions.originations: await self._subscribe_to_originations() if pending_subscriptions.head: @@ -560,19 +552,6 @@ async def _subscribe_to_address_transactions(self, address: str) -> None: ], ) - async def _subscribe_to_entrypoint_transactions(self, entrypoints: Set[str]) -> None: - """Subscribe to contract's operations on established WS connection""" - self._logger.info('Subscribing to %s transactions', entrypoints) - await self._send( - 'SubscribeToOperations', - [ - { - 'entrypoints': tuple(entrypoints), - 'types': 'transaction', - } - ], - ) - async def _subscribe_to_originations(self) -> None: """Subscribe to all originations on established WS connection""" self._logger.info('Subscribing to originations')