Skip to content

feature request: event driven removal of dynamic contracts (data sources) #885

@saurabhburade

Description

@saurabhburade

Summary

HyperIndex supports dynamically registering contracts via the contractRegister handler (e.g. context.add<ContractName>(address)), but there is no supported way to remove / unregister a previously registered dynamic contract (dynamic data source).

For long-running indexers, this makes it difficult to handle:

  • contracts that are later disabled, paused, or delisted
  • factory-created instances that emit a “removed” or “deactivated” event
  • incorrect registrations due to bad emitted addresses or logic bugs
  • keeping the indexing scope bounded over time

Expected behavior

  • Provide a supported mechanism to explicitly remove / unregister a dynamic contract from within any event/block handler.

Acceptance criteria

  • API to explicitly remove a dynamic contract, e.g.: context.remove<ContractName>(address) or equivalent.
  • Calling the removal API inside an event/block handler immediately unregisters the contract.
  • Existing indexed data is preserved; removal only affects future indexing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions